@bablr/boot 0.1.7 → 0.1.8
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/spamex.js
CHANGED
|
@@ -71,12 +71,12 @@ const grammar = class SpamexMiniparserGrammar {
|
|
|
71
71
|
p.eatProduction('TagType', { path: 'type' });
|
|
72
72
|
let sp = p.eatMatchTrivia(_);
|
|
73
73
|
|
|
74
|
-
if (sp && p.match(/['"/]/y)) {
|
|
74
|
+
if (sp && (p.match(/['"/]/y) || p.atExpression)) {
|
|
75
75
|
p.eatProduction('StringMatcher', { path: 'value' });
|
|
76
76
|
sp = p.eatMatchTrivia(_);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
if (sp && p.match(/\w+/y)) {
|
|
79
|
+
if (sp && (p.match(/\w+/y) || p.atExpression)) {
|
|
80
80
|
p.eatProduction('Attributes', { path: 'attributes[]' });
|
|
81
81
|
sp = p.eatMatchTrivia(_);
|
|
82
82
|
}
|
package/lib/languages/string.js
CHANGED
|
@@ -24,10 +24,6 @@ const escapables = new Map(
|
|
|
24
24
|
const cookEscape = (escape, span) => {
|
|
25
25
|
let hexMatch;
|
|
26
26
|
|
|
27
|
-
if (!span.type.startsWith('String')) {
|
|
28
|
-
throw new Error();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
27
|
if (!escape.startsWith('\\')) {
|
|
32
28
|
throw new Error('string escape must start with \\');
|
|
33
29
|
}
|
|
@@ -44,11 +40,11 @@ const cookEscape = (escape, span) => {
|
|
|
44
40
|
return String.fromCodePoint(parseInt(hexMatch[1], 16));
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
const litPattern = span === '
|
|
43
|
+
const litPattern = span === 'Single' ? /\\([\\nrt0'])/y : /\\([\\nrt0"])/y;
|
|
48
44
|
const litMatch = litPattern.exec(escape);
|
|
49
45
|
|
|
50
46
|
if (litMatch) {
|
|
51
|
-
return escapables.get(litMatch[1]);
|
|
47
|
+
return escapables.get(litMatch[1]) || litMatch[1];
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
throw new Error('unable to cook string escape');
|