@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.
- package/lib/languages/cstml.js +14 -5
- package/package.json +1 -1
package/lib/languages/cstml.js
CHANGED
|
@@ -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 =
|
|
249
|
+
const selfClosing = !!sc;
|
|
243
250
|
|
|
244
251
|
return { attrs: { selfClosing } };
|
|
245
252
|
}
|
|
246
253
|
|
|
247
|
-
CloseNodeTag(p) {
|
|
248
|
-
|
|
249
|
-
|
|
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) {
|