@bablr/boot 0.11.1 → 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.
@@ -102,10 +102,12 @@ export const grammar = class CSTMLMiniparserGrammar {
102
102
 
103
103
  TreeNode(p, props) {
104
104
  if (p.match(/['"]/y)) {
105
+ p.eatProduction('OpenNodeTag', { path: 'openTag' });
105
106
  do {
106
107
  p.eatProduction('LiteralTag', { path: 'children[]' });
107
108
  p.eatMatchTrivia(_);
108
109
  } while (p.match(/['"]/y));
110
+ p.eatProduction('CloseNodeTag', { path: 'closeTag' }, { empty: true });
109
111
  return;
110
112
  }
111
113
 
@@ -113,7 +115,7 @@ export const grammar = class CSTMLMiniparserGrammar {
113
115
 
114
116
  p.eatMatchTrivia(_);
115
117
 
116
- if (open.value.attributes.selfClosing) {
118
+ if (!open.value.attributes.selfClosing) {
117
119
  let token = !!get(['flags', 'token'], open);
118
120
 
119
121
  while (p.atExpression || !(p.match(/<\/[^/]/y) || p.done)) {
@@ -199,6 +201,11 @@ export const grammar = class CSTMLMiniparserGrammar {
199
201
  }
200
202
 
201
203
  OpenNodeTag(p) {
204
+ if (p.match(/['"]/y)) {
205
+ p.eatProduction('NodeFlags', { path: 'flags' }, { token: true });
206
+ return { attrs: { selfClosing: false } };
207
+ }
208
+
202
209
  p.eat('<', PN, { path: 'openToken' });
203
210
 
204
211
  if (!p.atExpression) {
@@ -239,14 +246,16 @@ export const grammar = class CSTMLMiniparserGrammar {
239
246
  let sc = p.eatMatch('/', PN, { path: 'selfClosingToken' });
240
247
  p.eat('>', PN, { path: 'closeToken' });
241
248
 
242
- const selfClosing = !sc && (p.path.depth > 0 || p.span.type !== 'Bare');
249
+ const selfClosing = !!sc;
243
250
 
244
251
  return { attrs: { selfClosing } };
245
252
  }
246
253
 
247
- CloseNodeTag(p) {
248
- p.eat('</', PN, { path: 'openToken' });
249
- 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
+ }
250
259
  }
251
260
 
252
261
  Expression(p) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bablr/boot",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Compile-time tools for bootstrapping BABLR VM",
5
5
  "engines": {
6
6
  "node": ">=12.0.0"