clarity-pattern-parser 9.2.3 → 9.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.js +2 -3
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +2 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/grammar/Grammar.test.ts +11 -0
- package/src/grammar/patterns/body.ts +2 -3
- package/src/grammar/patterns.test.ts +1 -1
package/package.json
CHANGED
|
@@ -499,4 +499,15 @@ describe("Grammar", () => {
|
|
|
499
499
|
|
|
500
500
|
expect(arePatternsEqual(patterns["complex-expression"], expected)).toBeTruthy();
|
|
501
501
|
});
|
|
502
|
+
|
|
503
|
+
test("Grammar With Spaces", ()=>{
|
|
504
|
+
const expression = `
|
|
505
|
+
john = "John"
|
|
506
|
+
|
|
507
|
+
jane = "Jane"
|
|
508
|
+
`;
|
|
509
|
+
const patterns = Grammar.parseString(expression);
|
|
510
|
+
expect(patterns.john).not.toBeNull();
|
|
511
|
+
expect(patterns.jane).not.toBeNull();
|
|
512
|
+
});
|
|
502
513
|
});
|
|
@@ -8,15 +8,14 @@ import { Optional } from "../../patterns/Optional";
|
|
|
8
8
|
|
|
9
9
|
const bodyLineContent = new Options("body-line-content", [
|
|
10
10
|
comment,
|
|
11
|
-
statement
|
|
12
|
-
lineSpaces
|
|
11
|
+
statement
|
|
13
12
|
]);
|
|
14
13
|
|
|
15
14
|
const optionalLineSpaces = new Optional("optional-line-spaces", lineSpaces);
|
|
16
15
|
|
|
17
16
|
const bodyLine = new Sequence("body-line", [
|
|
18
17
|
optionalLineSpaces,
|
|
19
|
-
bodyLineContent,
|
|
18
|
+
new Optional("optional-body-line-content", bodyLineContent),
|
|
20
19
|
optionalLineSpaces,
|
|
21
20
|
]);
|
|
22
21
|
|