@bablr/language-en-bablr-cli-verbose-output 0.3.1 → 0.4.0
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 +38 -30
- package/lib/grammar.macro.js +37 -29
- package/package.json +9 -9
package/lib/grammar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* @macrome
|
|
2
2
|
* @generatedby @bablr/macrome-generator-bablr
|
|
3
|
-
* @generatedfrom ./grammar.macro.js#
|
|
3
|
+
* @generatedfrom ./grammar.macro.js#66005fe6a15c059e10daae8ef150ca24fc3194e2
|
|
4
4
|
* This file is autogenerated. Please do not edit it directly.
|
|
5
5
|
* When editing run `npx macrome watch` then change the file this is generated from.
|
|
6
6
|
*/
|
|
@@ -22,7 +22,7 @@ export const dependencies = {
|
|
|
22
22
|
export const canonicalURL = 'https://bablr.org/languages/core/en/bablr-cli-verbose-output';
|
|
23
23
|
export function* eatMatchTrivia() {
|
|
24
24
|
if (yield i`match(/[ \t\n]/)`) {
|
|
25
|
-
return yield i`eat(<#*Space:Space
|
|
25
|
+
return yield i`eat(<#*Space:Space />)`;
|
|
26
26
|
}
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
@@ -34,57 +34,65 @@ export const grammar = class VerboseOutputGrammar {
|
|
|
34
34
|
_initProto(this);
|
|
35
35
|
}
|
|
36
36
|
*[(_EnterProductionLineDecs = [CoveredBy('Line'), Node], _LeaveProductionLineDecs = [CoveredBy('Line'), Node], _EmitLineDecs = [CoveredBy('Line'), Node], _ExecCSTMLInstructionLineDecs = [CoveredBy('Line'), Node], _ExecSpamexInstructionLineDecs = [CoveredBy('Line'), Node], _OutputLineDecs = [CoveredBy('Line'), Node], _PunctuatorDecs = [Node, InjectFrom(productions)], _AnyDecs = InjectFrom(productions), "Output")]() {
|
|
37
|
-
while ((yield i`match(/./)`) && (yield i`eat(<Line
|
|
37
|
+
while ((yield i`match(/./)`) && (yield i`eat(<Line /> 'lines[]')`));
|
|
38
38
|
}
|
|
39
39
|
*Line() {
|
|
40
|
-
yield i`eat(<Any
|
|
41
|
-
<ExecSpamexInstructionLine '>>>'
|
|
42
|
-
<ExecCSTMLInstructionLine ' >>>'
|
|
43
|
-
<EmitLine '<<<'
|
|
44
|
-
<EnterProductionLine '-->'
|
|
45
|
-
<LeaveProductionLine /[x<]
|
|
46
|
-
<OutputLine
|
|
40
|
+
yield i`eat(<Any /> null [
|
|
41
|
+
<ExecSpamexInstructionLine '>>>' />
|
|
42
|
+
<ExecCSTMLInstructionLine ' >>>' />
|
|
43
|
+
<EmitLine '<<<' />
|
|
44
|
+
<EnterProductionLine '-->' />
|
|
45
|
+
<LeaveProductionLine /[x<]--/ />
|
|
46
|
+
<OutputLine />
|
|
47
47
|
])`;
|
|
48
48
|
}
|
|
49
49
|
*ProductionName() {
|
|
50
|
-
yield i`eatMatch(<~*Punctuator '['
|
|
51
|
-
yield i`eat(<*Identifier
|
|
52
|
-
yield i`eatMatch(<~*Punctuator ']'
|
|
50
|
+
yield i`eatMatch(<~*Punctuator '[' /> 'openBrace')`;
|
|
51
|
+
yield i`eat(<*Identifier /> 'productionName')`;
|
|
52
|
+
yield i`eatMatch(<~*Punctuator ']' /> 'closeBrace')`;
|
|
53
53
|
}
|
|
54
54
|
*EnterProductionLine() {
|
|
55
|
-
yield i`eat(<~*Punctuator '-->'
|
|
55
|
+
yield i`eat(<~*Punctuator '-->' /> 'sigilToken')`;
|
|
56
56
|
yield* eatMatchTrivia();
|
|
57
|
-
yield i`eat(<ProductionName
|
|
58
|
-
yield i`eat(<~*Punctuator '\n'
|
|
57
|
+
yield i`eat(<ProductionName />)`;
|
|
58
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
59
59
|
}
|
|
60
60
|
*LeaveProductionLine() {
|
|
61
|
-
yield i`eat(<~*Punctuator /[<x]
|
|
61
|
+
yield i`eat(<~*Punctuator /[<x]--/ /> 'sigilToken')`;
|
|
62
62
|
yield* eatMatchTrivia();
|
|
63
|
-
yield i`eat(<ProductionName
|
|
64
|
-
yield i`eat(<~*Punctuator '\n'
|
|
63
|
+
yield i`eat(<ProductionName />)`;
|
|
64
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
65
65
|
}
|
|
66
66
|
*EmitLine() {
|
|
67
|
-
yield i`eat(<~*Punctuator '<<<'
|
|
67
|
+
yield i`eat(<~*Punctuator '<<<' /> 'sigilToken')`;
|
|
68
68
|
yield* eatMatchTrivia();
|
|
69
|
-
yield i`eat(<CSTML:Token
|
|
70
|
-
yield i`eat(<~*Punctuator '\n'
|
|
69
|
+
yield i`eat(<CSTML:Token /> 'expression')`;
|
|
70
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
71
71
|
}
|
|
72
72
|
*ExecCSTMLInstructionLine() {
|
|
73
|
-
yield i`eat(<~*Punctuator ' >>>'
|
|
73
|
+
yield i`eat(<~*Punctuator ' >>>' /> 'sigilToken')`;
|
|
74
74
|
yield* eatMatchTrivia();
|
|
75
|
-
yield i`eat(<CSTMLInstruction:Call
|
|
76
|
-
yield i`eat(<~*Punctuator '\n'
|
|
75
|
+
yield i`eat(<CSTMLInstruction:Call /> 'instruction')`;
|
|
76
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
77
77
|
}
|
|
78
78
|
*ExecSpamexInstructionLine() {
|
|
79
|
-
yield i`eat(<~*Punctuator '>>>'
|
|
79
|
+
yield i`eat(<~*Punctuator '>>>' /> 'sigilToken')`;
|
|
80
80
|
yield* eatMatchTrivia();
|
|
81
|
-
yield i`eat(<SpamexInstruction:Call
|
|
82
|
-
yield i`eat(<~*Punctuator '\n'
|
|
81
|
+
yield i`eat(<SpamexInstruction:Call /> 'instruction')`;
|
|
82
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
83
83
|
}
|
|
84
84
|
*OutputLine() {
|
|
85
85
|
yield* eatMatchTrivia();
|
|
86
|
-
yield i`eat(<CSTML:
|
|
87
|
-
yield i`
|
|
86
|
+
yield i`eat(<CSTML:Tag /> 'expressions[]')`;
|
|
87
|
+
if (yield i`match(/[ \t]/)`) {
|
|
88
|
+
yield i`eat(<#*Space:Space />)`;
|
|
89
|
+
}
|
|
90
|
+
while (yield i`eatMatch(<CSTML:Tag /> 'expressions[]')`) {
|
|
91
|
+
if (yield i`match(/[ \t]/)`) {
|
|
92
|
+
yield i`eat(<#*Space:Space />)`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
88
96
|
}
|
|
89
97
|
*Identifier() {
|
|
90
98
|
yield i`eat(/[a-zA-Z]+/)`;
|
package/lib/grammar.macro.js
CHANGED
|
@@ -12,7 +12,7 @@ export const canonicalURL = 'https://bablr.org/languages/core/en/bablr-cli-verbo
|
|
|
12
12
|
|
|
13
13
|
export function* eatMatchTrivia() {
|
|
14
14
|
if (yield i`match(/[ \t\n]/)`) {
|
|
15
|
-
return yield i`eat(<#*Space:Space
|
|
15
|
+
return yield i`eat(<#*Space:Space />)`;
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
@@ -20,78 +20,86 @@ export function* eatMatchTrivia() {
|
|
|
20
20
|
export const grammar = class VerboseOutputGrammar {
|
|
21
21
|
@Node
|
|
22
22
|
*Output() {
|
|
23
|
-
while ((yield i`match(/./)`) && (yield i`eat(<Line
|
|
23
|
+
while ((yield i`match(/./)`) && (yield i`eat(<Line /> 'lines[]')`));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
*Line() {
|
|
27
|
-
yield i`eat(<Any
|
|
28
|
-
<ExecSpamexInstructionLine '>>>'
|
|
29
|
-
<ExecCSTMLInstructionLine ' >>>'
|
|
30
|
-
<EmitLine '<<<'
|
|
31
|
-
<EnterProductionLine '-->'
|
|
32
|
-
<LeaveProductionLine /[x<]
|
|
33
|
-
<OutputLine
|
|
27
|
+
yield i`eat(<Any /> null [
|
|
28
|
+
<ExecSpamexInstructionLine '>>>' />
|
|
29
|
+
<ExecCSTMLInstructionLine ' >>>' />
|
|
30
|
+
<EmitLine '<<<' />
|
|
31
|
+
<EnterProductionLine '-->' />
|
|
32
|
+
<LeaveProductionLine /[x<]--/ />
|
|
33
|
+
<OutputLine />
|
|
34
34
|
])`;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
@Node
|
|
38
38
|
*ProductionName() {
|
|
39
|
-
yield i`eatMatch(<~*Punctuator '['
|
|
40
|
-
yield i`eat(<*Identifier
|
|
41
|
-
yield i`eatMatch(<~*Punctuator ']'
|
|
39
|
+
yield i`eatMatch(<~*Punctuator '[' /> 'openBrace')`;
|
|
40
|
+
yield i`eat(<*Identifier /> 'productionName')`;
|
|
41
|
+
yield i`eatMatch(<~*Punctuator ']' /> 'closeBrace')`;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
@CoveredBy('Line')
|
|
45
45
|
@Node
|
|
46
46
|
*EnterProductionLine() {
|
|
47
|
-
yield i`eat(<~*Punctuator '-->'
|
|
47
|
+
yield i`eat(<~*Punctuator '-->' /> 'sigilToken')`;
|
|
48
48
|
yield* eatMatchTrivia();
|
|
49
|
-
yield i`eat(<ProductionName
|
|
50
|
-
yield i`eat(<~*Punctuator '\n'
|
|
49
|
+
yield i`eat(<ProductionName />)`;
|
|
50
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
@CoveredBy('Line')
|
|
54
54
|
@Node
|
|
55
55
|
*LeaveProductionLine() {
|
|
56
|
-
yield i`eat(<~*Punctuator /[<x]
|
|
56
|
+
yield i`eat(<~*Punctuator /[<x]--/ /> 'sigilToken')`;
|
|
57
57
|
yield* eatMatchTrivia();
|
|
58
|
-
yield i`eat(<ProductionName
|
|
59
|
-
yield i`eat(<~*Punctuator '\n'
|
|
58
|
+
yield i`eat(<ProductionName />)`;
|
|
59
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
@CoveredBy('Line')
|
|
63
63
|
@Node
|
|
64
64
|
*EmitLine() {
|
|
65
|
-
yield i`eat(<~*Punctuator '<<<'
|
|
65
|
+
yield i`eat(<~*Punctuator '<<<' /> 'sigilToken')`;
|
|
66
66
|
yield* eatMatchTrivia();
|
|
67
|
-
yield i`eat(<CSTML:Token
|
|
68
|
-
yield i`eat(<~*Punctuator '\n'
|
|
67
|
+
yield i`eat(<CSTML:Token /> 'expression')`;
|
|
68
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
@CoveredBy('Line')
|
|
72
72
|
@Node
|
|
73
73
|
*ExecCSTMLInstructionLine() {
|
|
74
|
-
yield i`eat(<~*Punctuator ' >>>'
|
|
74
|
+
yield i`eat(<~*Punctuator ' >>>' /> 'sigilToken')`;
|
|
75
75
|
yield* eatMatchTrivia();
|
|
76
|
-
yield i`eat(<CSTMLInstruction:Call
|
|
77
|
-
yield i`eat(<~*Punctuator '\n'
|
|
76
|
+
yield i`eat(<CSTMLInstruction:Call /> 'instruction')`;
|
|
77
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
@CoveredBy('Line')
|
|
81
81
|
@Node
|
|
82
82
|
*ExecSpamexInstructionLine() {
|
|
83
|
-
yield i`eat(<~*Punctuator '>>>'
|
|
83
|
+
yield i`eat(<~*Punctuator '>>>' /> 'sigilToken')`;
|
|
84
84
|
yield* eatMatchTrivia();
|
|
85
|
-
yield i`eat(<SpamexInstruction:Call
|
|
86
|
-
yield i`eat(<~*Punctuator '\n'
|
|
85
|
+
yield i`eat(<SpamexInstruction:Call /> 'instruction')`;
|
|
86
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
@CoveredBy('Line')
|
|
90
90
|
@Node
|
|
91
91
|
*OutputLine() {
|
|
92
92
|
yield* eatMatchTrivia();
|
|
93
|
-
yield i`eat(<CSTML:
|
|
94
|
-
yield i`
|
|
93
|
+
yield i`eat(<CSTML:Tag /> 'expressions[]')`;
|
|
94
|
+
if (yield i`match(/[ \t]/)`) {
|
|
95
|
+
yield i`eat(<#*Space:Space />)`;
|
|
96
|
+
}
|
|
97
|
+
while (yield i`eatMatch(<CSTML:Tag /> 'expressions[]')`) {
|
|
98
|
+
if (yield i`match(/[ \t]/)`) {
|
|
99
|
+
yield i`eat(<#*Space:Space />)`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
yield i`eat(<~*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
@Node
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/language-en-bablr-cli-verbose-output",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A BABLR language for BABLR CLI verbose output",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.0.0"
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@babel/runtime": "^7.23.2",
|
|
24
|
-
"@bablr/agast-helpers": "0.
|
|
25
|
-
"@bablr/agast-vm-helpers": "0.
|
|
26
|
-
"@bablr/helpers": "0.
|
|
27
|
-
"@bablr/language-en-bablr-vm-instruction": "0.
|
|
28
|
-
"@bablr/language-en-blank-space": "0.
|
|
29
|
-
"@bablr/language-en-cstml": "0.
|
|
24
|
+
"@bablr/agast-helpers": "0.4.0",
|
|
25
|
+
"@bablr/agast-vm-helpers": "0.4.0",
|
|
26
|
+
"@bablr/helpers": "0.19.0",
|
|
27
|
+
"@bablr/language-en-bablr-vm-instruction": "0.5.0",
|
|
28
|
+
"@bablr/language-en-blank-space": "0.4.0",
|
|
29
|
+
"@bablr/language-en-cstml": "0.5.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@bablr/boot": "0.
|
|
32
|
+
"@bablr/boot": "0.5.0",
|
|
33
33
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",
|
|
34
34
|
"@bablr/macrome": "0.1.3",
|
|
35
|
-
"@bablr/macrome-generator-bablr": "0.3.
|
|
35
|
+
"@bablr/macrome-generator-bablr": "0.3.2",
|
|
36
36
|
"enhanced-resolve": "^5.12.0",
|
|
37
37
|
"eslint": "^8.47.0",
|
|
38
38
|
"eslint-import-resolver-enhanced-resolve": "^1.0.5",
|