@thi.ng/parse 2.0.7 → 2.1.2

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +213 -94
  2. package/README.md +1 -1
  3. package/package.json +240 -235
package/CHANGELOG.md CHANGED
@@ -1,147 +1,266 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [2.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@2.0.6...@thi.ng/parse@2.0.7) (2021-11-03)
7
-
8
- **Note:** Version bump only for package @thi.ng/parse
9
-
10
-
3
+ - **Last updated**: 2021-11-21T17:09:28Z
4
+ - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
11
5
 
6
+ All notable changes to this project will be documented in this file.
7
+ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
12
8
 
9
+ **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
+ and/or version bumps of transitive dependencies.
13
11
 
14
- # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@1.0.5...@thi.ng/parse@2.0.0) (2021-10-12)
15
-
16
-
17
- ### Build System
18
-
19
- * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
20
-
12
+ ## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@2.1.0) (2021-11-17)
21
13
 
22
- ### BREAKING CHANGES
14
+ #### 🚀 Features
23
15
 
24
- * discontinue CommonJS & UMD versions
16
+ - Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
17
+ Improving the overall build ergonomics
18
+ - introduced a tools workspaces
19
+ - imported it in all needed packages/examples
20
+ - inclusive project root
25
21
 
26
- - only ESM modules will be published from now on
27
- - CJS obsolete due to ESM support in recent versions of node:
28
- - i.e. launch NodeJS via:
29
- - `node --experimental-specifier-resolution=node --experimental-repl-await`
30
- - in the node REPL use `await import(...)` instead of `require()`
31
- - UMD obsolete due to widespread browser support for ESM
22
+ #### ♻️ Refactoring
32
23
 
33
- Also:
34
- - normalize/restructure/reorg all package.json files
35
- - cleanup all build scripts, remove obsolete
36
- - switch from mocha to @thi.ng/testament for all tests
24
+ - testrunner to binary ([4ebbbb2](https://github.com/thi-ng/umbrella/commit/4ebbbb2))
25
+ this commit reverts (partly) changes made in:
26
+ ef346d7a8753590dc9094108a3d861a8dbd5dd2c
27
+ overall purpose is better testament ergonomics:
28
+ instead of having to pass NODE_OPTIONS with every invocation
29
+ having a binary to handle this for us.
37
30
 
31
+ ### [2.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@2.0.1) (2021-10-13)
38
32
 
33
+ #### ♻️ Refactoring
39
34
 
35
+ - update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
36
+ - update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
37
+ - add .js suffix for all relative imports
40
38
 
39
+ # [2.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@2.0.0) (2021-10-12)
41
40
 
41
+ #### 🛑 Breaking changes
42
42
 
43
- ## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@1.0.4...@thi.ng/parse@1.0.5) (2021-09-03)
43
+ - major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
44
+ - BREAKING CHANGE: discontinue CommonJS & UMD versions
45
+ - only ESM modules will be published from now on
46
+ - CJS obsolete due to ESM support in recent versions of node:
47
+ - i.e. launch NodeJS via:
48
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
49
+ - in the node REPL use `await import(...)` instead of `require()`
50
+ - UMD obsolete due to widespread browser support for ESM
51
+ Also:
52
+ - normalize/restructure/reorg all package.json files
53
+ - cleanup all build scripts, remove obsolete
54
+ - switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
44
55
 
45
- **Note:** Version bump only for package @thi.ng/parse
56
+ #### ♻️ Refactoring
46
57
 
47
- # [0.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.8.2...@thi.ng/parse@0.9.0) (2020-08-17)
58
+ - update defmulti impls ([0303769](https://github.com/thi-ng/umbrella/commit/0303769))
59
+ - update deps & imports in various pkgs ([e1cf29e](https://github.com/thi-ng/umbrella/commit/e1cf29e))
60
+ - largely related to recent updates/restructuring of these packages:
61
+ - api
62
+ - defmulti
63
+ - errors
64
+ - logger
65
+ - update imports ([138571a](https://github.com/thi-ng/umbrella/commit/138571a))
66
+ - update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
67
+ - update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
48
68
 
49
- ### Features
69
+ ### [0.9.7](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.9.7) (2020-12-07)
50
70
 
51
- - **parse:** add replace/xfReplace() xform ([7291181](https://github.com/thi-ng/umbrella/commit/7291181f6eb74751aa02dffbb95bb6787a5ef02f))
52
- - **parse:** enable replacement rule transforms ([ca22432](https://github.com/thi-ng/umbrella/commit/ca224328e55cb525cefd39dd53028a86a580fd7e))
71
+ #### ♻️ Refactoring
53
72
 
54
- # [0.8.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.7.2...@thi.ng/parse@0.8.0) (2020-07-19)
73
+ - update type-only imports ([85874bc](https://github.com/thi-ng/umbrella/commit/85874bc))
55
74
 
56
- ### Features
75
+ ### [0.9.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.9.4) (2020-09-22)
57
76
 
58
- - **parse:** add nest()/xfNest() transform ([af9c97b](https://github.com/thi-ng/umbrella/commit/af9c97b55cba15175bff917d0b2522be8c98517d))
59
- - **parse:** update grammar (xform rule refs) ([22188a4](https://github.com/thi-ng/umbrella/commit/22188a41d5db58fb9dae9cb01bd04ad8d1ac788e))
60
- - **parse:** update repeat grammar ([7aae9ac](https://github.com/thi-ng/umbrella/commit/7aae9ac02d23dd7e5a0643d3a418be67044465bd))
77
+ #### ♻️ Refactoring
61
78
 
62
- ## [0.7.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.7.1...@thi.ng/parse@0.7.2) (2020-07-18)
79
+ - update ESC parse preset ([ec94064](https://github.com/thi-ng/umbrella/commit/ec94064))
80
+ - re-use ESCAPES LUT from strings pkgs
63
81
 
64
- ### Bug Fixes
82
+ ### [0.9.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.9.3) (2020-09-13)
65
83
 
66
- - **parse:** export ContextOpts, move to api.ts ([2dfc445](https://github.com/thi-ng/umbrella/commit/2dfc445971dc788abcb6576ef4e6836dec6df33a))
84
+ #### ♻️ Refactoring
67
85
 
68
- ## [0.7.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.7.0...@thi.ng/parse@0.7.1) (2020-07-17)
86
+ - update imports ([b600b00](https://github.com/thi-ng/umbrella/commit/b600b00))
69
87
 
70
- ### Performance Improvements
88
+ ## [0.9.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.9.0) (2020-08-17)
71
89
 
72
- - **parse:** update grammar, use discarding parsers where possible ([d269a8a](https://github.com/thi-ng/umbrella/commit/d269a8a3f5b5ee47d60f86343a163c9903ce6923))
90
+ #### 🚀 Features
73
91
 
74
- # [0.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.6.2...@thi.ng/parse@0.7.0) (2020-07-08)
92
+ - enable replacement rule transforms ([ca22432](https://github.com/thi-ng/umbrella/commit/ca22432))
93
+ - allow strings as rule transform in grammar
94
+ - add replace/xfReplace() xform ([7291181](https://github.com/thi-ng/umbrella/commit/7291181))
75
95
 
76
- ### Features
96
+ ## [0.8.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.8.0) (2020-07-19)
77
97
 
78
- - **parse:** add lookahead() combinator, add tests ([ee35038](https://github.com/thi-ng/umbrella/commit/ee35038cdae0692cc369221eb7623ba7b973d2f1))
79
- - **parse:** lookahead w/ configurable capture ([542c066](https://github.com/thi-ng/umbrella/commit/542c0662b4901a6cfd32a99e5241dace0ddde807))
80
- - **parse:** turn xfPrint() into HOF xform ([d86fa53](https://github.com/thi-ng/umbrella/commit/d86fa535a530f0fe84e08e5969ca01c96ef75c23))
81
- - **parse:** update grammar DSL ([accacf9](https://github.com/thi-ng/umbrella/commit/accacf9fa73b09f6cb8454cd4d85f10bb0f55795))
82
- - **parse:** update lookahead ([51a8dc5](https://github.com/thi-ng/umbrella/commit/51a8dc55dd3b40fcfbffbcb5f3aeaea618441269))
83
- - **parse:** update/fix grammar DSL, add trim ([f82ba1f](https://github.com/thi-ng/umbrella/commit/f82ba1f9aeed03571e50953c6d41255a569d121f))
98
+ #### 🚀 Features
84
99
 
85
- # [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.5.8...@thi.ng/parse@0.6.0) (2020-06-28)
100
+ - update repeat grammar ([7aae9ac](https://github.com/thi-ng/umbrella/commit/7aae9ac))
101
+ - support specifying min repeat count only (max: infinity), e.g. `{3,}`
102
+ - update grammar (xform rule refs) ([22188a4](https://github.com/thi-ng/umbrella/commit/22188a4))
103
+ - allow other parse rules as rule xform (via `xfNest()`)
104
+ - add tests
105
+ - add nest()/xfNest() transform ([af9c97b](https://github.com/thi-ng/umbrella/commit/af9c97b))
86
106
 
87
- ### Features
107
+ ### [0.7.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.7.2) (2020-07-18)
88
108
 
89
- - **parse:** add `!` discard modifier to grammar ([456efdc](https://github.com/thi-ng/umbrella/commit/456efdcb6ded913b0f2b137ebe99634421d552c0))
90
- - **parse:** add count/xfCount transform ([056ae08](https://github.com/thi-ng/umbrella/commit/056ae084c08a826f09c65181c01426bbdff59e87))
109
+ #### 🩹 Bug fixes
91
110
 
92
- # [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.4.1...@thi.ng/parse@0.5.0) (2020-04-23)
111
+ - export ContextOpts, move to api.ts ([2dfc445](https://github.com/thi-ng/umbrella/commit/2dfc445))
93
112
 
94
- ### Features
113
+ ### [0.7.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.7.1) (2020-07-17)
95
114
 
96
- - **parse:** add built-ins, extract STRING, minor updates ([458f5b3](https://github.com/thi-ng/umbrella/commit/458f5b34a4fa1c58f55b23be8455e6bd7b7bb72d))
115
+ #### Performance improvements
97
116
 
98
- # [0.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.3.0...@thi.ng/parse@0.4.0) (2020-04-21)
117
+ - update grammar, use discarding parsers where possible ([d269a8a](https://github.com/thi-ng/umbrella/commit/d269a8a))
118
+ - update compile() impls w/ CompileFlags and use `D` versions if poss
119
+ - refactor/add compileRD(), compileRDL() helpers
120
+ - expose DNL preset rule in defGrammar()
121
+ - add alwaysD()
122
+ - add tests
99
123
 
100
- ### Bug Fixes
124
+ ## [0.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.7.0) (2020-07-08)
101
125
 
102
- - **parse:** update not() behavior, add passD() ([1d0f4c4](https://github.com/thi-ng/umbrella/commit/1d0f4c4baef5b1cfb207f606f4e3873a14c3afce))
126
+ #### 🚀 Features
103
127
 
104
- ### Features
128
+ - turn xfPrint() into HOF xform ([d86fa53](https://github.com/thi-ng/umbrella/commit/d86fa53))
129
+ - add opt support for custom print fns (other than console)
130
+ - update/fix grammar DSL, add trim ([f82ba1f](https://github.com/thi-ng/umbrella/commit/f82ba1f))
131
+ - update lookahead (cap, non-cap versions)
132
+ - add lookahead for alt terms
133
+ - update `compileLookahead()`
134
+ - add line comment support
135
+ - fix `{n}` repeat modifier handling
136
+ - add `trim()`/`xfTrim()` xforms
137
+ - lookahead w/ configurable capture ([542c066](https://github.com/thi-ng/umbrella/commit/542c066))
138
+ - update grammar DSL ([accacf9](https://github.com/thi-ng/umbrella/commit/accacf9))
139
+ - add `.` catch-all term
140
+ - add `(?=...)` suffix form for lookahead
141
+ - update TERM/TERM_BODY
142
+ - update lookahead ([51a8dc5](https://github.com/thi-ng/umbrella/commit/51a8dc5))
143
+ - add pass flag and only succeed if main parser passed at least once
144
+ - add lookahead() combinator, add tests ([ee35038](https://github.com/thi-ng/umbrella/commit/ee35038))
105
145
 
106
- - **parse:** update grammar DSL, hoist xforms ([861e7f3](https://github.com/thi-ng/umbrella/commit/861e7f32d98a9f693a9271d31235d1603700b36c))
146
+ ## [0.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.6.0) (2020-06-28)
107
147
 
108
- # [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.2.0...@thi.ng/parse@0.3.0) (2020-04-20)
148
+ #### 🚀 Features
109
149
 
110
- ### Features
150
+ - add count/xfCount transform ([056ae08](https://github.com/thi-ng/umbrella/commit/056ae08))
151
+ - add `!` discard modifier to grammar ([456efdc](https://github.com/thi-ng/umbrella/commit/456efdc))
111
152
 
112
- - **parse:** add discarding combinators, move discard ([e09a2c4](https://github.com/thi-ng/umbrella/commit/e09a2c40d1ad7272a5abc15c8b11e497f79eb0dd))
113
- - **parse:** add dynamic() & DynamicParser ([b914267](https://github.com/thi-ng/umbrella/commit/b914267b88325d5c94a028aee192268e75736181))
114
- - **parse:** add grammar default transforms, update/fix rules ([03ed965](https://github.com/thi-ng/umbrella/commit/03ed96592f1598767d5feeac1b49b8cc4b1d6285))
115
- - **parse:** add more whitespace presets ([1398e2b](https://github.com/thi-ng/umbrella/commit/1398e2b06a8eace8b61333c36db6e82d6e1478f3))
116
- - **parse:** add ParseContext.reset(), update addChild() ([d47c0a2](https://github.com/thi-ng/umbrella/commit/d47c0a220e4912a30c59a7fd3c81b8376d74d720))
117
- - **parse:** add skipWhile(), more discarded wrappers ([832c0b7](https://github.com/thi-ng/umbrella/commit/832c0b7e88d87b2da0e37f602e592ad7b548da09))
118
- - **parse:** add withID() xform, add doc strings ([e16426b](https://github.com/thi-ng/umbrella/commit/e16426b82f0dda94ab9aa92ba6e3af8d769f3fed))
119
- - **parse:** add/update combinators ([e4eab03](https://github.com/thi-ng/umbrella/commit/e4eab036243f4f646880b974624ae680e77cff7f))
120
- - **parse:** add/update/rename parser presets ([12f2499](https://github.com/thi-ng/umbrella/commit/12f2499253163a923c42e3be29ce2223a6648e11))
121
- - **parse:** add/update/rename parser primitives ([328103f](https://github.com/thi-ng/umbrella/commit/328103f55f4bb311470b8767a27d28a78d0dcb4b))
122
- - **parse:** initial checkin grammar compiler ([38e9c66](https://github.com/thi-ng/umbrella/commit/38e9c66c25c02db4d7fb79837645dfaf654e6788))
123
- - **parse:** update ESC & whitespace parsers ([069a6ef](https://github.com/thi-ng/umbrella/commit/069a6ef11c9423bdb2974b11823cc39743dfceec))
124
- - **parse:** update grammar parser & compiler ([822fcba](https://github.com/thi-ng/umbrella/commit/822fcba9a29a05bad98eecf2b341d07a3a90abeb))
153
+ ## [0.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.5.0) (2020-04-23)
125
154
 
126
- # [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.1.0...@thi.ng/parse@0.2.0) (2020-04-17)
155
+ #### 🚀 Features
127
156
 
128
- ### Features
157
+ - add built-ins, extract STRING, minor updates ([458f5b3](https://github.com/thi-ng/umbrella/commit/458f5b3))
158
+ - add anchors to built-in grammar rules
159
+ - extract STRING preset parser
160
+ - add doc strings
161
+ - add s-expr parser test
162
+ - update imports
163
+ - update readme
129
164
 
130
- - **parse:** add/rename/reorg parsers, xforms, ctx ([ee537f4](https://github.com/thi-ng/umbrella/commit/ee537f49c239de19326865687853e9b2814330bf))
165
+ ## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.4.0) (2020-04-21)
131
166
 
132
- ### Performance Improvements
167
+ #### 🚀 Features
133
168
 
134
- - **parse:** major speedup satisfy() (~1.6x faster) ([8ca5c7f](https://github.com/thi-ng/umbrella/commit/8ca5c7f184af3d03f06b03b9136a675fb9e63d64))
169
+ - update grammar DSL, hoist xforms ([861e7f3](https://github.com/thi-ng/umbrella/commit/861e7f3))
170
+ - allow esc sequences in grammar string literals
171
+ - expose various preset parser for re-use in grammar DSL
172
+ - rename xfHoist => hoistResult
173
+ - add new xfHoist to hoist entire child node
174
+ - add doc strings
135
175
 
136
- # 0.1.0 (2020-04-16)
176
+ #### 🩹 Bug fixes
137
177
 
138
- ### Features
178
+ - update not() behavior, add passD() ([1d0f4c4](https://github.com/thi-ng/umbrella/commit/1d0f4c4))
179
+
180
+ #### ♻️ Refactoring
139
181
 
140
- - **parse:** add ArrayReader, update pkg info ([3bec0db](https://github.com/thi-ng/umbrella/commit/3bec0dbf759d9742adefb936e58359f95da58fc8))
141
- - **parse:** add collect/xfCollect, update xfPrint ([43f3368](https://github.com/thi-ng/umbrella/commit/43f33687431f9ea8269c1eba0342d0589f7ac4dc))
142
- - **parse:** add ctx getters, add presets, update maybe ([02597bf](https://github.com/thi-ng/umbrella/commit/02597bf825df3e467cf2d090c69198d85f1767f2))
143
- - **parse:** import as new package ([151e50c](https://github.com/thi-ng/umbrella/commit/151e50cc1e2bfaf8d70a6bb82907eec483dd8316))
144
- - **parse:** make retained state info optional ([a89ee87](https://github.com/thi-ng/umbrella/commit/a89ee871a098582c909fcf8558ed979d04942250))
145
- - **parse:** update defContext, add basic array test ([cd7363d](https://github.com/thi-ng/umbrella/commit/cd7363d7f93e0db00797a9ec30bd44b399396860))
146
- - **parse:** update ParseContext, repeat & lift ([bef1d4f](https://github.com/thi-ng/umbrella/commit/bef1d4f628320d1aac9cf6d924749d4f15864d07))
147
- - **parse:** update repeat ops, reader, initial state ([c5cfabe](https://github.com/thi-ng/umbrella/commit/c5cfabeaf5ab6e124d5fc2455fd3f5ede96248cd))
182
+ - update wrap() combinator ([a3dae6e](https://github.com/thi-ng/umbrella/commit/a3dae6e))
183
+
184
+ ## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.3.0) (2020-04-20)
185
+
186
+ #### 🚀 Features
187
+
188
+ - add grammar default transforms, update/fix rules ([03ed965](https://github.com/thi-ng/umbrella/commit/03ed965))
189
+ - update ESC & whitespace parsers ([069a6ef](https://github.com/thi-ng/umbrella/commit/069a6ef))
190
+ - add discarding combinators, move discard ([e09a2c4](https://github.com/thi-ng/umbrella/commit/e09a2c4))
191
+ - add repeatD, oneOrMoreD, zeroOrMoreD
192
+ - update grammar parser & compiler ([822fcba](https://github.com/thi-ng/umbrella/commit/822fcba))
193
+ - add GrammarOpts
194
+ - update rules to enable repetition of all terms
195
+ - add string term
196
+ - make debug output optional
197
+ - add/update/rename parser presets ([12f2499](https://github.com/thi-ng/umbrella/commit/12f2499))
198
+ - add withID() xform, add doc strings ([e16426b](https://github.com/thi-ng/umbrella/commit/e16426b))
199
+ - add/update combinators ([e4eab03](https://github.com/thi-ng/umbrella/commit/e4eab03))
200
+ - add startsWith, endsWith, entireLine, entirely
201
+ - add wrap()
202
+ - rename dalt/dseq => altD/seqD
203
+ - add/update/rename parser primitives ([328103f](https://github.com/thi-ng/umbrella/commit/328103f))
204
+ - add LitParser type to annotate single-char parsers
205
+ - add satisfyD()
206
+ - add stringOf() for predicated strings
207
+ - add wordBoundary anchor
208
+ - add/update/rename discarding parser prims:
209
+ - litD(), stringD(), noneOfD(), oneOfD(), rangeD()
210
+ - export predicate versions:
211
+ - litP(), noneOfP(), oneOfP(), rangeP()
212
+ - update skipWhile() behavior
213
+ - add ParseContext.reset(), update addChild() ([d47c0a2](https://github.com/thi-ng/umbrella/commit/d47c0a2))
214
+ - initial checkin grammar compiler ([38e9c66](https://github.com/thi-ng/umbrella/commit/38e9c66))
215
+ - add dynamic() & DynamicParser ([b914267](https://github.com/thi-ng/umbrella/commit/b914267))
216
+ - add more whitespace presets ([1398e2b](https://github.com/thi-ng/umbrella/commit/1398e2b))
217
+ - add skipWhile(), more discarded wrappers ([832c0b7](https://github.com/thi-ng/umbrella/commit/832c0b7))
218
+ - add skipWhile()
219
+ - add dalt(), dseq() wrappers
220
+ - add NL, DNL presets
221
+ - add ParseContext .state setter
222
+
223
+ #### ♻️ Refactoring
224
+
225
+ - update grammar & pkg re-exports ([3ba8973](https://github.com/thi-ng/umbrella/commit/3ba8973))
226
+
227
+ ## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.2.0) (2020-04-17)
228
+
229
+ #### 🚀 Features
230
+
231
+ - add/rename/reorg parsers, xforms, ctx ([ee537f4](https://github.com/thi-ng/umbrella/commit/ee537f4))
232
+ - add dlit(), dstring()
233
+ - add fail()
234
+ - rename lift() => pass(), Lift<T> => PassValue<T>
235
+ - rename merge()/xfMerge() => join()/xfJoin()
236
+ - add hoist()/xfHoist()
237
+ - migrate xform syntax sugars to /xform
238
+ - add indent() util for ParseContext & print()
239
+
240
+ #### ⏱ Performance improvements
241
+
242
+ - major speedup satisfy() (~1.6x faster) ([8ca5c7f](https://github.com/thi-ng/umbrella/commit/8ca5c7f))
243
+ - update ParseContext.addChild() to optionally progress reader
244
+ - update call sites in satisfy(), lift(), repeat()
245
+
246
+ ## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/parse@0.1.0) (2020-04-16)
247
+
248
+ #### 🚀 Features
249
+
250
+ - update defContext, add basic array test ([cd7363d](https://github.com/thi-ng/umbrella/commit/cd7363d))
251
+ - make retained state info optional ([a89ee87](https://github.com/thi-ng/umbrella/commit/a89ee87))
252
+ - add ArrayReader, update pkg info ([3bec0db](https://github.com/thi-ng/umbrella/commit/3bec0db))
253
+ - add ctx getters, add presets, update maybe ([02597bf](https://github.com/thi-ng/umbrella/commit/02597bf))
254
+ - update ParseContext, repeat & lift ([bef1d4f](https://github.com/thi-ng/umbrella/commit/bef1d4f))
255
+ - add context debug option / tracing
256
+ - add .addChild()
257
+ - update repeat zero-match handling
258
+ - simplify lift()
259
+ - add collect/xfCollect, update xfPrint ([43f3368](https://github.com/thi-ng/umbrella/commit/43f3368))
260
+ - update repeat ops, reader, initial state ([c5cfabe](https://github.com/thi-ng/umbrella/commit/c5cfabe))
261
+ - import as new package ([151e50c](https://github.com/thi-ng/umbrella/commit/151e50c))
262
+
263
+ #### ♻️ Refactoring
264
+
265
+ - split presets into sep files ([43f62c5](https://github.com/thi-ng/umbrella/commit/43f62c5))
266
+ - update context, rename ops, remove arrays dep ([a913c96](https://github.com/thi-ng/umbrella/commit/a913c96))
package/README.md CHANGED
@@ -90,7 +90,7 @@ node --experimental-repl-await
90
90
  > const parse = await import("@thi.ng/parse");
91
91
  ```
92
92
 
93
- Package sizes (gzipped, pre-treeshake): ESM: 5.28 KB
93
+ Package sizes (gzipped, pre-treeshake): ESM: 5.41 KB
94
94
 
95
95
  ## Dependencies
96
96
 
package/package.json CHANGED
@@ -1,237 +1,242 @@
1
1
  {
2
- "name": "@thi.ng/parse",
3
- "version": "2.0.7",
4
- "description": "Purely functional parser combinators & AST generation for generic inputs",
5
- "type": "module",
6
- "module": "./index.js",
7
- "typings": "./index.d.ts",
8
- "sideEffects": false,
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/thi-ng/umbrella.git"
12
- },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/parse#readme",
14
- "funding": [
15
- {
16
- "type": "github",
17
- "url": "https://github.com/sponsors/postspectacular"
18
- },
19
- {
20
- "type": "patreon",
21
- "url": "https://patreon.com/thing_umbrella"
22
- }
23
- ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
25
- "license": "Apache-2.0",
26
- "scripts": {
27
- "build": "yarn clean && tsc --declaration",
28
- "clean": "rimraf *.js *.d.ts *.map doc combinators presets prims readers xform",
29
- "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
- "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
31
- "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
- "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
- "pub": "yarn build && yarn publish --access public",
34
- "test": "testament test"
35
- },
36
- "dependencies": {
37
- "@thi.ng/api": "^8.1.0",
38
- "@thi.ng/checks": "^3.0.6",
39
- "@thi.ng/defmulti": "^2.0.7",
40
- "@thi.ng/errors": "^2.0.6",
41
- "@thi.ng/strings": "^3.1.3"
42
- },
43
- "devDependencies": {
44
- "@thi.ng/testament": "^0.1.6"
45
- },
46
- "keywords": [
47
- "ast",
48
- "combinator",
49
- "compiler",
50
- "composition",
51
- "datastructure",
52
- "dsl",
53
- "functional",
54
- "grammar",
55
- "parser",
56
- "peg",
57
- "recursive",
58
- "regexp",
59
- "tree",
60
- "typescript"
61
- ],
62
- "publishConfig": {
63
- "access": "public"
64
- },
65
- "engines": {
66
- "node": ">=12.7"
67
- },
68
- "files": [
69
- "*.js",
70
- "*.d.ts",
71
- "combinators",
72
- "presets",
73
- "prims",
74
- "readers",
75
- "xform"
2
+ "name": "@thi.ng/parse",
3
+ "version": "2.1.2",
4
+ "description": "Purely functional parser combinators & AST generation for generic inputs",
5
+ "type": "module",
6
+ "module": "./index.js",
7
+ "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/thi-ng/umbrella.git"
12
+ },
13
+ "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/parse#readme",
14
+ "funding": [
15
+ {
16
+ "type": "github",
17
+ "url": "https://github.com/sponsors/postspectacular"
18
+ },
19
+ {
20
+ "type": "patreon",
21
+ "url": "https://patreon.com/thing_umbrella"
22
+ }
23
+ ],
24
+ "author": "Karsten Schmidt <k+npm@thi.ng>",
25
+ "license": "Apache-2.0",
26
+ "scripts": {
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf '*.js' '*.d.ts' '*.map' doc combinators presets prims readers xform",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
+ "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
+ "doc:readme": "yarn doc:stats && tools:readme",
32
+ "doc:stats": "tools:module-stats",
33
+ "pub": "yarn npm publish --access public",
34
+ "test": "testament test"
35
+ },
36
+ "dependencies": {
37
+ "@thi.ng/api": "^8.3.2",
38
+ "@thi.ng/checks": "^3.1.2",
39
+ "@thi.ng/defmulti": "^2.1.2",
40
+ "@thi.ng/errors": "^2.1.2",
41
+ "@thi.ng/strings": "^3.2.2"
42
+ },
43
+ "devDependencies": {
44
+ "@microsoft/api-extractor": "^7.18.19",
45
+ "@thi.ng/testament": "^0.2.2",
46
+ "rimraf": "^3.0.2",
47
+ "tools": "^0.0.1",
48
+ "typedoc": "^0.22.9",
49
+ "typescript": "^4.5.2"
50
+ },
51
+ "keywords": [
52
+ "ast",
53
+ "combinator",
54
+ "compiler",
55
+ "composition",
56
+ "datastructure",
57
+ "dsl",
58
+ "functional",
59
+ "grammar",
60
+ "parser",
61
+ "peg",
62
+ "recursive",
63
+ "regexp",
64
+ "tree",
65
+ "typescript"
66
+ ],
67
+ "publishConfig": {
68
+ "access": "public"
69
+ },
70
+ "engines": {
71
+ "node": ">=12.7"
72
+ },
73
+ "files": [
74
+ "*.js",
75
+ "*.d.ts",
76
+ "combinators",
77
+ "presets",
78
+ "prims",
79
+ "readers",
80
+ "xform"
81
+ ],
82
+ "exports": {
83
+ ".": {
84
+ "import": "./index.js"
85
+ },
86
+ "./api": {
87
+ "import": "./api.js"
88
+ },
89
+ "./combinators/alt": {
90
+ "import": "./combinators/alt.js"
91
+ },
92
+ "./combinators/boundary": {
93
+ "import": "./combinators/boundary.js"
94
+ },
95
+ "./combinators/check": {
96
+ "import": "./combinators/check.js"
97
+ },
98
+ "./combinators/dynamic": {
99
+ "import": "./combinators/dynamic.js"
100
+ },
101
+ "./combinators/expect": {
102
+ "import": "./combinators/expect.js"
103
+ },
104
+ "./combinators/lookahead": {
105
+ "import": "./combinators/lookahead.js"
106
+ },
107
+ "./combinators/maybe": {
108
+ "import": "./combinators/maybe.js"
109
+ },
110
+ "./combinators/not": {
111
+ "import": "./combinators/not.js"
112
+ },
113
+ "./combinators/repeat": {
114
+ "import": "./combinators/repeat.js"
115
+ },
116
+ "./combinators/seq": {
117
+ "import": "./combinators/seq.js"
118
+ },
119
+ "./combinators/wrap": {
120
+ "import": "./combinators/wrap.js"
121
+ },
122
+ "./combinators/xform": {
123
+ "import": "./combinators/xform.js"
124
+ },
125
+ "./context": {
126
+ "import": "./context.js"
127
+ },
128
+ "./error": {
129
+ "import": "./error.js"
130
+ },
131
+ "./grammar": {
132
+ "import": "./grammar.js"
133
+ },
134
+ "./presets/alpha": {
135
+ "import": "./presets/alpha.js"
136
+ },
137
+ "./presets/bits": {
138
+ "import": "./presets/bits.js"
139
+ },
140
+ "./presets/digits": {
141
+ "import": "./presets/digits.js"
142
+ },
143
+ "./presets/escape": {
144
+ "import": "./presets/escape.js"
145
+ },
146
+ "./presets/hex": {
147
+ "import": "./presets/hex.js"
148
+ },
149
+ "./presets/numbers": {
150
+ "import": "./presets/numbers.js"
151
+ },
152
+ "./presets/string": {
153
+ "import": "./presets/string.js"
154
+ },
155
+ "./presets/whitespace": {
156
+ "import": "./presets/whitespace.js"
157
+ },
158
+ "./prims/always": {
159
+ "import": "./prims/always.js"
160
+ },
161
+ "./prims/anchor": {
162
+ "import": "./prims/anchor.js"
163
+ },
164
+ "./prims/fail": {
165
+ "import": "./prims/fail.js"
166
+ },
167
+ "./prims/lit": {
168
+ "import": "./prims/lit.js"
169
+ },
170
+ "./prims/none-of": {
171
+ "import": "./prims/none-of.js"
172
+ },
173
+ "./prims/one-of": {
174
+ "import": "./prims/one-of.js"
175
+ },
176
+ "./prims/pass": {
177
+ "import": "./prims/pass.js"
178
+ },
179
+ "./prims/range": {
180
+ "import": "./prims/range.js"
181
+ },
182
+ "./prims/satisfy": {
183
+ "import": "./prims/satisfy.js"
184
+ },
185
+ "./prims/skip": {
186
+ "import": "./prims/skip.js"
187
+ },
188
+ "./prims/string": {
189
+ "import": "./prims/string.js"
190
+ },
191
+ "./readers/array-reader": {
192
+ "import": "./readers/array-reader.js"
193
+ },
194
+ "./readers/string-reader": {
195
+ "import": "./readers/string-reader.js"
196
+ },
197
+ "./xform/collect": {
198
+ "import": "./xform/collect.js"
199
+ },
200
+ "./xform/comp": {
201
+ "import": "./xform/comp.js"
202
+ },
203
+ "./xform/count": {
204
+ "import": "./xform/count.js"
205
+ },
206
+ "./xform/discard": {
207
+ "import": "./xform/discard.js"
208
+ },
209
+ "./xform/hoist": {
210
+ "import": "./xform/hoist.js"
211
+ },
212
+ "./xform/join": {
213
+ "import": "./xform/join.js"
214
+ },
215
+ "./xform/nest": {
216
+ "import": "./xform/nest.js"
217
+ },
218
+ "./xform/number": {
219
+ "import": "./xform/number.js"
220
+ },
221
+ "./xform/print": {
222
+ "import": "./xform/print.js"
223
+ },
224
+ "./xform/replace": {
225
+ "import": "./xform/replace.js"
226
+ },
227
+ "./xform/trim": {
228
+ "import": "./xform/trim.js"
229
+ },
230
+ "./xform/with-id": {
231
+ "import": "./xform/with-id.js"
232
+ }
233
+ },
234
+ "thi.ng": {
235
+ "related": [
236
+ "fsm",
237
+ "transducers-fsm"
76
238
  ],
77
- "exports": {
78
- ".": {
79
- "import": "./index.js"
80
- },
81
- "./api": {
82
- "import": "./api.js"
83
- },
84
- "./combinators/alt": {
85
- "import": "./combinators/alt.js"
86
- },
87
- "./combinators/boundary": {
88
- "import": "./combinators/boundary.js"
89
- },
90
- "./combinators/check": {
91
- "import": "./combinators/check.js"
92
- },
93
- "./combinators/dynamic": {
94
- "import": "./combinators/dynamic.js"
95
- },
96
- "./combinators/expect": {
97
- "import": "./combinators/expect.js"
98
- },
99
- "./combinators/lookahead": {
100
- "import": "./combinators/lookahead.js"
101
- },
102
- "./combinators/maybe": {
103
- "import": "./combinators/maybe.js"
104
- },
105
- "./combinators/not": {
106
- "import": "./combinators/not.js"
107
- },
108
- "./combinators/repeat": {
109
- "import": "./combinators/repeat.js"
110
- },
111
- "./combinators/seq": {
112
- "import": "./combinators/seq.js"
113
- },
114
- "./combinators/wrap": {
115
- "import": "./combinators/wrap.js"
116
- },
117
- "./combinators/xform": {
118
- "import": "./combinators/xform.js"
119
- },
120
- "./context": {
121
- "import": "./context.js"
122
- },
123
- "./error": {
124
- "import": "./error.js"
125
- },
126
- "./grammar": {
127
- "import": "./grammar.js"
128
- },
129
- "./presets/alpha": {
130
- "import": "./presets/alpha.js"
131
- },
132
- "./presets/bits": {
133
- "import": "./presets/bits.js"
134
- },
135
- "./presets/digits": {
136
- "import": "./presets/digits.js"
137
- },
138
- "./presets/escape": {
139
- "import": "./presets/escape.js"
140
- },
141
- "./presets/hex": {
142
- "import": "./presets/hex.js"
143
- },
144
- "./presets/numbers": {
145
- "import": "./presets/numbers.js"
146
- },
147
- "./presets/string": {
148
- "import": "./presets/string.js"
149
- },
150
- "./presets/whitespace": {
151
- "import": "./presets/whitespace.js"
152
- },
153
- "./prims/always": {
154
- "import": "./prims/always.js"
155
- },
156
- "./prims/anchor": {
157
- "import": "./prims/anchor.js"
158
- },
159
- "./prims/fail": {
160
- "import": "./prims/fail.js"
161
- },
162
- "./prims/lit": {
163
- "import": "./prims/lit.js"
164
- },
165
- "./prims/none-of": {
166
- "import": "./prims/none-of.js"
167
- },
168
- "./prims/one-of": {
169
- "import": "./prims/one-of.js"
170
- },
171
- "./prims/pass": {
172
- "import": "./prims/pass.js"
173
- },
174
- "./prims/range": {
175
- "import": "./prims/range.js"
176
- },
177
- "./prims/satisfy": {
178
- "import": "./prims/satisfy.js"
179
- },
180
- "./prims/skip": {
181
- "import": "./prims/skip.js"
182
- },
183
- "./prims/string": {
184
- "import": "./prims/string.js"
185
- },
186
- "./readers/array-reader": {
187
- "import": "./readers/array-reader.js"
188
- },
189
- "./readers/string-reader": {
190
- "import": "./readers/string-reader.js"
191
- },
192
- "./xform/collect": {
193
- "import": "./xform/collect.js"
194
- },
195
- "./xform/comp": {
196
- "import": "./xform/comp.js"
197
- },
198
- "./xform/count": {
199
- "import": "./xform/count.js"
200
- },
201
- "./xform/discard": {
202
- "import": "./xform/discard.js"
203
- },
204
- "./xform/hoist": {
205
- "import": "./xform/hoist.js"
206
- },
207
- "./xform/join": {
208
- "import": "./xform/join.js"
209
- },
210
- "./xform/nest": {
211
- "import": "./xform/nest.js"
212
- },
213
- "./xform/number": {
214
- "import": "./xform/number.js"
215
- },
216
- "./xform/print": {
217
- "import": "./xform/print.js"
218
- },
219
- "./xform/replace": {
220
- "import": "./xform/replace.js"
221
- },
222
- "./xform/trim": {
223
- "import": "./xform/trim.js"
224
- },
225
- "./xform/with-id": {
226
- "import": "./xform/with-id.js"
227
- }
228
- },
229
- "thi.ng": {
230
- "related": [
231
- "fsm",
232
- "transducers-fsm"
233
- ],
234
- "year": 2020
235
- },
236
- "gitHead": "852cd2450617c86d15d18477dc634f17f04202eb"
237
- }
239
+ "year": 2020
240
+ },
241
+ "gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
242
+ }