@bablr/language-en-spamex 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/grammar.js +16 -11
- package/package.json +9 -9
package/lib/grammar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { re, spam as m } from '@bablr/boot';
|
|
2
|
-
import {
|
|
2
|
+
import { eat, eatMatch, fail, match, defineAttribute } from '@bablr/helpers/grammar';
|
|
3
3
|
import Regex from '@bablr/language-en-regex-vm-pattern';
|
|
4
4
|
import { default as CSTML, eatMatchTrivia } from '@bablr/language-en-cstml';
|
|
5
5
|
import JSON from '@bablr/language-en-cstml-json';
|
|
@@ -99,7 +99,16 @@ export const grammar = class SpamexGrammar {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
*TreeNodeMatcher() {
|
|
102
|
-
if (yield
|
|
102
|
+
if (yield match(re`/['"/]/`)) {
|
|
103
|
+
do {
|
|
104
|
+
yield eat(m`children[]$: <_StringMatcher />`);
|
|
105
|
+
yield* eatMatchTrivia();
|
|
106
|
+
} while (yield match(re`/['"/]/`));
|
|
107
|
+
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (yield eatMatch(m`children[]$: <PropertyMatcher /[a-zA-Z.#@\g]/ />`)) {
|
|
103
112
|
return;
|
|
104
113
|
}
|
|
105
114
|
|
|
@@ -118,14 +127,6 @@ export const grammar = class SpamexGrammar {
|
|
|
118
127
|
}
|
|
119
128
|
|
|
120
129
|
*TreeNodeMatcherOpen() {
|
|
121
|
-
if (yield match(re`/['"/]/`)) {
|
|
122
|
-
yield eat(m`flags*: :CSTML: <NodeFlags />`, o({ token: true }));
|
|
123
|
-
yield eat(m`literalValue*: <_StringMatcher />`);
|
|
124
|
-
|
|
125
|
-
yield defineAttribute('selfClosing', true);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
130
|
yield eat(m`openToken*: <* '<' />`);
|
|
130
131
|
yield eat(m`flags*: :CSTML: <NodeFlags />`);
|
|
131
132
|
let type = yield eatMatch(m`type*: <* /__?/ />`);
|
|
@@ -138,7 +139,11 @@ export const grammar = class SpamexGrammar {
|
|
|
138
139
|
|
|
139
140
|
let sp = yield* eatMatchTrivia();
|
|
140
141
|
|
|
141
|
-
if (
|
|
142
|
+
if (
|
|
143
|
+
sp &&
|
|
144
|
+
!(yield match('/>')) &&
|
|
145
|
+
(yield eatMatch(m`literalValue$: <_StringMatcher /['"/]/ />`))
|
|
146
|
+
) {
|
|
142
147
|
sp = yield* eatMatchTrivia();
|
|
143
148
|
}
|
|
144
149
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/language-en-spamex",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "A BABLR language for SPAM Expressions",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.0.0"
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"test": "mocha"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@bablr/agast-helpers": "0.10.
|
|
22
|
-
"@bablr/agast-vm-helpers": "0.10.
|
|
23
|
-
"@bablr/boot": "0.11.
|
|
24
|
-
"@bablr/helpers": "0.25.
|
|
25
|
-
"@bablr/language-en-blank-space": "0.10.
|
|
26
|
-
"@bablr/language-en-cstml": "0.12.
|
|
27
|
-
"@bablr/language-en-cstml-json": "0.5.
|
|
28
|
-
"@bablr/language-en-regex-vm-pattern": "0.12.
|
|
21
|
+
"@bablr/agast-helpers": "0.10.2",
|
|
22
|
+
"@bablr/agast-vm-helpers": "0.10.2",
|
|
23
|
+
"@bablr/boot": "0.11.1",
|
|
24
|
+
"@bablr/helpers": "0.25.1",
|
|
25
|
+
"@bablr/language-en-blank-space": "0.10.1",
|
|
26
|
+
"@bablr/language-en-cstml": "0.12.1",
|
|
27
|
+
"@bablr/language-en-cstml-json": "0.5.1",
|
|
28
|
+
"@bablr/language-en-regex-vm-pattern": "0.12.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#c97bfa4b3663f8378e9b3e42bb5a41e685406cf9",
|