@bablr/boot 0.11.0 → 0.11.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.
@@ -101,11 +101,21 @@ export const grammar = class CSTMLMiniparserGrammar {
101
101
  }
102
102
 
103
103
  TreeNode(p, props) {
104
+ if (p.match(/['"]/y)) {
105
+ p.eatProduction('OpenNodeTag', { path: 'openTag' });
106
+ do {
107
+ p.eatProduction('LiteralTag', { path: 'children[]' });
108
+ p.eatMatchTrivia(_);
109
+ } while (p.match(/['"]/y));
110
+ p.eatProduction('CloseNodeTag', { path: 'closeTag' }, { empty: true });
111
+ return;
112
+ }
113
+
104
114
  let open = p.eatProduction('OpenNodeTag', { path: 'openTag', noInterpolate: true }, props);
105
115
 
106
116
  p.eatMatchTrivia(_);
107
117
 
108
- if (open.value.attributes.selfClosing) {
118
+ if (!open.value.attributes.selfClosing) {
109
119
  let token = !!get(['flags', 'token'], open);
110
120
 
111
121
  while (p.atExpression || !(p.match(/<\/[^/]/y) || p.done)) {
@@ -193,8 +203,7 @@ export const grammar = class CSTMLMiniparserGrammar {
193
203
  OpenNodeTag(p) {
194
204
  if (p.match(/['"]/y)) {
195
205
  p.eatProduction('NodeFlags', { path: 'flags' }, { token: true });
196
- p.eatProduction('JSON:String', { path: 'literalValue' });
197
- return;
206
+ return { attrs: { selfClosing: false } };
198
207
  }
199
208
 
200
209
  p.eat('<', PN, { path: 'openToken' });
@@ -237,14 +246,16 @@ export const grammar = class CSTMLMiniparserGrammar {
237
246
  let sc = p.eatMatch('/', PN, { path: 'selfClosingToken' });
238
247
  p.eat('>', PN, { path: 'closeToken' });
239
248
 
240
- const selfClosing = !sc && (p.path.depth > 0 || p.span.type !== 'Bare');
249
+ const selfClosing = !!sc;
241
250
 
242
251
  return { attrs: { selfClosing } };
243
252
  }
244
253
 
245
- CloseNodeTag(p) {
246
- p.eat('</', PN, { path: 'openToken' });
247
- p.eat('>', PN, { path: 'closeToken' });
254
+ CloseNodeTag(p, props) {
255
+ if (!props.empty) {
256
+ p.eat('</', PN, { path: 'openToken' });
257
+ p.eat('>', PN, { path: 'closeToken' });
258
+ }
248
259
  }
249
260
 
250
261
  Expression(p) {
@@ -123,6 +123,15 @@ export const grammar = class SpamexMiniparserGrammar {
123
123
  }
124
124
 
125
125
  TreeNodeMatcher(p) {
126
+ if (p.match(/['"/]/y)) {
127
+ do {
128
+ p.eatProduction('StringMatcher', { path: 'children[]' });
129
+ p.eatMatchTrivia(_);
130
+ } while (p.match(/['"/]/y));
131
+
132
+ return;
133
+ }
134
+
126
135
  if (p.match(/[a-zA-Z.#@]/y) || p.atExpression) {
127
136
  p.eatProduction('PropertyMatcher', { path: 'children[]', noInterpolate: true });
128
137
  return;
@@ -148,13 +157,6 @@ export const grammar = class SpamexMiniparserGrammar {
148
157
  }
149
158
 
150
159
  TreeNodeMatcherOpen(p) {
151
- if (p.match(/['"/]/y)) {
152
- p.eatProduction('CSTML:NodeFlags', { path: 'flags', token: true });
153
- p.eatProduction('StringMatcher', { path: 'literalValue' });
154
-
155
- return { attrs: { selfClosing: true } };
156
- }
157
-
158
160
  p.eat('<', PN, { path: 'openToken' });
159
161
 
160
162
  if (!p.atExpression) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bablr/boot",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Compile-time tools for bootstrapping BABLR VM",
5
5
  "engines": {
6
6
  "node": ">=12.0.0"
@@ -20,8 +20,8 @@
20
20
  ],
21
21
  "sideEffects": false,
22
22
  "dependencies": {
23
- "@bablr/agast-helpers": "0.10.0",
24
- "@bablr/agast-vm-helpers": "0.10.0",
23
+ "@bablr/agast-helpers": "0.10.2",
24
+ "@bablr/agast-vm-helpers": "0.10.2",
25
25
  "@iter-tools/imm-stack": "1.2.0",
26
26
  "escape-string-regexp": "5.0.0",
27
27
  "iter-tools-es": "^7.0.2"