Skip to content

Commit 8fb48ce

Browse files
committed
Merge branch 'master' of github.com:kodowa/eve-native
2 parents bb6583c + cf9a49b commit 8fb48ce

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ node_modules/
77
build/
88
dist/
99
.vscode/tasks.json
10+
examples/test.eve

src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ parser!(number(state) -> Node<'a> {
7171

7272
whitespace_parser!(escaped_quote(state) -> Node<'a> {
7373
tag!(state, "\\");
74-
let escaped = alt_tag!(state, ["\"" "n" "t"]);
74+
let escaped = alt_tag!(state, ["\"" "\\" "n" "t"]);
7575
let ch = match escaped {
7676
"n" => "\n",
7777
"t" => "\t",
@@ -94,7 +94,7 @@ whitespace_parser!(string_bracket(state) -> Node<'a> {
9494
});
9595

9696
whitespace_parser!(string_chars(state) -> Node<'a> {
97-
let chars = any_except!(state, "\"{");
97+
let chars = any_except!(state, "\\\"{");
9898
result!(state, Node::RawString(chars))
9999
});
100100

tests/base.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,38 @@ test!(base_join_nested_record, {
251251
end
252252
});
253253

254+
//--------------------------------------------------------------------
255+
// Strings
256+
//--------------------------------------------------------------------
257+
258+
test!(base_string, {
259+
search
260+
baz = "Hello"
261+
bind
262+
[#foo baz]
263+
end
264+
265+
search
266+
[#foo baz: "Hello"]
267+
bind
268+
[#success]
269+
end
270+
});
271+
272+
test!(base_string_escape_chars, {
273+
search
274+
baz = "Hello \\ \n \"World\" "
275+
bind
276+
[#foo baz]
277+
end
278+
279+
search
280+
[#foo baz: "Hello \\ \n \"World\" "]
281+
bind
282+
[#success]
283+
end
284+
});
285+
254286
//--------------------------------------------------------------------
255287
// Interpolation
256288
//--------------------------------------------------------------------

0 commit comments

Comments
 (0)