Skip to content

Commit eabab18

Browse files
authored
Merge pull request #12 from bcpeinhardt/fix-quotes-bug
Fix quotes bug
2 parents 2fab9de + 4f8bdf4 commit eabab18

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
## v2.0.2 - 25 October 2024
6+
- Patch to fix bug with handling closing quotes before a newline.
7+
58
## v2.0.1 - 26 September 2024
69
- Patch to consider all headers in from_dicts.
710

gleam.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "gsv"
2-
version = "2.0.1"
2+
version = "2.0.2"
33
gleam = ">= 0.32.0"
44
description = "A simple csv parser and generator written in gleam "
55

src/gsv/internal/ast.gleam

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ fn parse_p(
154154
[curr_line, ..previously_parsed_lines]
155155
->
156156
parse_p(remaining_tokens, InsideEscapedString, [
157-
["", ..curr_line],
157+
[""],
158+
curr_line,
158159
..previously_parsed_lines
159160
])
160161

test/gsv_test.gleam

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import gleam/dict
22
import gleam/int
3+
import gleam/io
34
import gleam/list
45
import gleam/result
56
import gleam/string
@@ -234,3 +235,15 @@ pub fn dicts_with_missing_values_test() {
234235
"colour,name,score,youtube\nPink,Lucy,100,\n,Isaac,99,@IsaacHarrisHolt",
235236
)
236237
}
238+
239+
pub fn quotes_test() {
240+
let stringy =
241+
"\"Date\",\"Type\",\"Price\",\"Ammount\"\n\"11/11/2024\",\"Apples\",\"7\",\"5\""
242+
243+
gsv.to_lists(stringy)
244+
|> should.be_ok
245+
|> should.equal([
246+
["Date", "Type", "Price", "Ammount"],
247+
["11/11/2024", "Apples", "7", "5"],
248+
])
249+
}

0 commit comments

Comments
 (0)