@thi.ng/parse 2.6.19 → 2.6.21
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/CHANGELOG.md +1 -1
- package/README.md +13 -13
- package/combinators/lookahead.d.ts +2 -2
- package/package.json +8 -8
- package/prims/skip.d.ts +1 -1
- package/xform/print.d.ts +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -460,24 +460,24 @@ const ctx = defContext(`
|
|
|
460
460
|
|
|
461
461
|
// parse & print AST
|
|
462
462
|
print(lang!.rules.expr)(ctx);
|
|
463
|
-
// expr:
|
|
464
|
-
// list:
|
|
465
|
-
// expr:
|
|
463
|
+
// expr: undefined
|
|
464
|
+
// list: undefined
|
|
465
|
+
// expr: undefined
|
|
466
466
|
// sym: "def"
|
|
467
467
|
// sym: "hello"
|
|
468
|
-
// list:
|
|
469
|
-
// expr:
|
|
468
|
+
// list: undefined
|
|
469
|
+
// expr: undefined
|
|
470
470
|
// sym: "x"
|
|
471
|
-
// list:
|
|
472
|
-
// expr:
|
|
471
|
+
// list: undefined
|
|
472
|
+
// expr: undefined
|
|
473
473
|
// sym: "str"
|
|
474
474
|
// string: "hello, "
|
|
475
475
|
// sym: "x"
|
|
476
|
-
// list:
|
|
477
|
-
// expr:
|
|
476
|
+
// list: undefined
|
|
477
|
+
// expr: undefined
|
|
478
478
|
// sym: "print"
|
|
479
|
-
// list:
|
|
480
|
-
// expr:
|
|
479
|
+
// list: undefined
|
|
480
|
+
// expr: undefined
|
|
481
481
|
// sym: "hello"
|
|
482
482
|
// real: 42
|
|
483
483
|
|
|
@@ -487,8 +487,8 @@ print(lang!.rules.expr)(ctx);
|
|
|
487
487
|
// the two top-level s-expressions...
|
|
488
488
|
console.log(ctx.children);
|
|
489
489
|
// [
|
|
490
|
-
// { id: 'list', state: null, children: [ [Object] ], result:
|
|
491
|
-
// { id: 'list', state: null, children: [ [Object] ], result:
|
|
490
|
+
// ParseScope { id: 'list', state: null, children: [ [Object] ], result: undefined, ... },
|
|
491
|
+
// ParseScope { id: 'list', state: null, children: [ [Object] ], result: undefined, ... }
|
|
492
492
|
// ]
|
|
493
493
|
```
|
|
494
494
|
|
|
@@ -43,7 +43,7 @@ import type { Parser } from "../api.js";
|
|
|
43
43
|
* // "ababaa"
|
|
44
44
|
*
|
|
45
45
|
* console.log(ctx.state);
|
|
46
|
-
* // { p: 6, l: 1, c: 7, done: false
|
|
46
|
+
* // { p: 6, l: 1, c: 7, done: false }
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
@@ -62,7 +62,7 @@ import type { Parser } from "../api.js";
|
|
|
62
62
|
* // "ababaaabba"
|
|
63
63
|
*
|
|
64
64
|
* console.log(ctx.state);
|
|
65
|
-
* // { p: 10, l: 1, c: 11, done: false
|
|
65
|
+
* // { p: 10, l: 1, c: 11, done: false }
|
|
66
66
|
* ```
|
|
67
67
|
*
|
|
68
68
|
* @param parser -
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/parse",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.21",
|
|
4
4
|
"description": "Purely functional parser combinators & AST generation for generic inputs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.11.
|
|
43
|
-
"@thi.ng/checks": "^3.7.
|
|
44
|
-
"@thi.ng/defmulti": "^3.0.
|
|
45
|
-
"@thi.ng/errors": "^2.5.
|
|
46
|
-
"@thi.ng/strings": "^3.9.
|
|
42
|
+
"@thi.ng/api": "^8.11.32",
|
|
43
|
+
"@thi.ng/checks": "^3.7.12",
|
|
44
|
+
"@thi.ng/defmulti": "^3.0.72",
|
|
45
|
+
"@thi.ng/errors": "^2.5.38",
|
|
46
|
+
"@thi.ng/strings": "^3.9.18"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"esbuild": "^0.25.
|
|
49
|
+
"esbuild": "^0.25.8",
|
|
50
50
|
"typedoc": "^0.28.7",
|
|
51
51
|
"typescript": "^5.8.3"
|
|
52
52
|
},
|
|
@@ -246,5 +246,5 @@
|
|
|
246
246
|
],
|
|
247
247
|
"year": 2020
|
|
248
248
|
},
|
|
249
|
-
"gitHead": "
|
|
249
|
+
"gitHead": "11747c482773d3da03c8b7848b25a56251ccd759\n"
|
|
250
250
|
}
|
package/prims/skip.d.ts
CHANGED
package/xform/print.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ export declare const xfPrint: (fn?: Fn<string, void>) => ScopeTransform<any>;
|
|
|
22
22
|
* import { ALPHA, defContext, lit, oneOrMore, print, seq } from "@thi.ng/parse";
|
|
23
23
|
*
|
|
24
24
|
* print(seq([lit("["), oneOrMore(ALPHA), lit("]")]))(defContext("[abc]"));
|
|
25
|
-
* // seq:
|
|
25
|
+
* // seq: undefined
|
|
26
26
|
* // lit: "["
|
|
27
|
-
* // repeat1:
|
|
27
|
+
* // repeat1: undefined
|
|
28
28
|
* // oneOf: "a"
|
|
29
29
|
* // oneOf: "b"
|
|
30
30
|
* // oneOf: "c"
|