diff options
author | alandonovan <adonovan@google.com> | 2020-06-15 13:21:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 13:21:36 -0400 |
commit | 2319aeb99686f39c8515e43eb9192e0eedf60343 (patch) | |
tree | bb9cead9cd1b06e6bbe14f6dc6563b0c4dba326f /syntax/scan_test.go | |
parent | ac23acb182e187e6835e4c0cc42205fe37a05624 (diff) | |
download | starlark-go-2319aeb99686f39c8515e43eb9192e0eedf60343.tar.gz |
syntax: permit \" and \' escapes in both "..." and '...' literals (#279)
Clarify spec on this issue.
Fixes https://github.com/google/starlark-go/issues/278
Also, fix semantic merge conflict in testdata/json.star tests that
relied on "\u" being interpreted as "\\u", causing tests to fail.
Diffstat (limited to 'syntax/scan_test.go')
-rw-r--r-- | syntax/scan_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/syntax/scan_test.go b/syntax/scan_test.go index fecf26f..0f2d9f2 100644 --- a/syntax/scan_test.go +++ b/syntax/scan_test.go @@ -200,16 +200,16 @@ pass`, "pass newline pass EOF"}, // consecutive newlines are consolidated {`"\+"`, `foo.star:1:1: invalid escape sequence \+`}, {`"\w"`, `foo.star:1:1: invalid escape sequence \w`}, {`"\""`, `"\"" EOF`}, - {`"\'"`, `foo.star:1:1: invalid escape sequence \'`}, + {`"\'"`, `"'" EOF`}, {`'\w'`, `foo.star:1:1: invalid escape sequence \w`}, {`'\''`, `"'" EOF`}, - {`'\"'`, `foo.star:1:1: invalid escape sequence \"`}, + {`'\"'`, `"\"" EOF`}, {`"""\w"""`, `foo.star:1:1: invalid escape sequence \w`}, {`"""\""""`, `"\"" EOF`}, - {`"""\'"""`, `foo.star:1:1: invalid escape sequence \'`}, + {`"""\'"""`, `"'" EOF`}, {`'''\w'''`, `foo.star:1:1: invalid escape sequence \w`}, {`'''\''''`, `"'" EOF`}, - {`'''\"'''`, `foo.star:1:1: invalid escape sequence \"`}, // error + {`'''\"'''`, `"\"" EOF`}, {`r"\w"`, `"\\w" EOF`}, {`r"\""`, `"\\\"" EOF`}, {`r"\'"`, `"\\'" EOF`}, |