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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarity-pattern-parser",
3
- "version": "9.2.3",
3
+ "version": "9.2.4",
4
4
  "description": "Parsing Library for Typescript and Javascript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -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
 
@@ -28,7 +28,7 @@ describe("Patterns String Template Literal", ()=>{
28
28
  debugger;
29
29
  const result = body.exec(`
30
30
  <div>
31
- <span></span>
31
+ <div></div>
32
32
  <div></div>
33
33
  </div>
34
34
  `, true);