Skip to content

Commit

Permalink
bugfix: ignore whitespace in string
Browse files Browse the repository at this point in the history
  • Loading branch information
mistlog committed Mar 14, 2021
1 parent 1d3c5d2 commit 267d176
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/parser/basic/string.tsx
Expand Up @@ -19,9 +19,11 @@ export function String() {

return (
<pattern action={action}>
<_ /><text>"</text><_ />
<_ />
<text>"</text>
<SCharSequence label="chars" />
<_ /><text>"</text><_ />
<text>"</text>
<_ />
</pattern>
)
}
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/generator.test.ts.snap
Expand Up @@ -164,7 +164,7 @@ exports[`ts-type TypeArrowFunctionExpression: with params 1`] = `"T extends stri
exports[`ts-type UnionType 1`] = `"(\\"0\\" | \\"1\\")"`;
exports[`ts-type UnionType: special char 1`] = `"(\\"\\" | \\"\\\\n\\" | \\"\\\\t\\")"`;
exports[`ts-type UnionType: special char 1`] = `"(\\" \\" | \\"\\\\n\\" | \\"\\\\t\\")"`;
exports[`type file TypeFile 1`] = `
"type temp = string;
Expand Down
2 changes: 1 addition & 1 deletion test/assets/ast/UnionType-SpecialChar.json
Expand Up @@ -3,7 +3,7 @@
"types": [
{
"kind": "StringTypeLiteral",
"value": ""
"value": " "
},
{
"kind": "StringTypeLiteral",
Expand Down
2 changes: 1 addition & 1 deletion test/assets/ts-type/UnionType-SpecialChar
@@ -1 +1 @@
("" | "\n" | "\t")
(" " | "\n" | "\t")
2 changes: 1 addition & 1 deletion test/parser/__snapshots__/expression.test.tsx.snap
Expand Up @@ -70,7 +70,7 @@ Object {
"types": Array [
Object {
"kind": "StringTypeLiteral",
"value": "",
"value": " ",
},
Object {
"kind": "StringTypeLiteral",
Expand Down

0 comments on commit 267d176

Please sign in to comment.