@bablr/language-en-bablr-cli-verbose-output 0.5.0 → 0.7.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 +37 -49
- package/lib/grammar.macro.js +40 -47
- package/package.json +8 -8
package/lib/grammar.js
CHANGED
|
@@ -1,97 +1,85 @@
|
|
|
1
1
|
/* @macrome
|
|
2
2
|
* @generatedby @bablr/macrome-generator-bablr
|
|
3
|
-
* @generatedfrom ./grammar.macro.js#
|
|
3
|
+
* @generatedfrom ./grammar.macro.js#22e783cd5e11fa22faf49534cc46e510563f833d
|
|
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
|
*/
|
|
7
7
|
import _applyDecs from "@babel/runtime/helpers/applyDecs2305";
|
|
8
|
-
let _initProto, _EnterProductionLineDecs, _LeaveProductionLineDecs, _EmitLineDecs,
|
|
9
|
-
import { i } from '@bablr/boot';
|
|
10
|
-
import { CoveredBy, Node, InjectFrom } from '@bablr/helpers/decorators';
|
|
8
|
+
let _initProto, _EnterProductionLineDecs, _LeaveProductionLineDecs, _EmitLineDecs, _ExecInstructionLineDecs, _OutputLineDecs, _PunctuatorDecs, _AnyDecs;
|
|
9
|
+
import { i, re, spam as m } from '@bablr/boot';
|
|
10
|
+
import { CoveredBy, Node, InjectFrom, Literal } from '@bablr/helpers/decorators';
|
|
11
|
+
import { o, eat, eatMatch, match } from '@bablr/helpers/grammar';
|
|
11
12
|
import * as productions from '@bablr/helpers/productions';
|
|
12
13
|
import * as CSTML from '@bablr/language-en-cstml';
|
|
13
|
-
import * as
|
|
14
|
-
import * as SpamexInstruction from '@bablr/language-en-bablr-vm-instruction/spamex';
|
|
14
|
+
import * as Instruction from '@bablr/language-en-bablr-vm-instruction';
|
|
15
15
|
import * as Space from '@bablr/language-en-blank-space';
|
|
16
16
|
export const dependencies = {
|
|
17
17
|
Space,
|
|
18
18
|
CSTML,
|
|
19
|
-
|
|
20
|
-
SpamexInstruction
|
|
19
|
+
Instruction
|
|
21
20
|
};
|
|
22
21
|
export const canonicalURL = 'https://bablr.org/languages/core/en/bablr-cli-verbose-output';
|
|
23
22
|
export function* eatMatchTrivia() {
|
|
24
|
-
if (yield
|
|
25
|
-
return yield
|
|
23
|
+
if (yield match(re`/[ \t\n]/`)) {
|
|
24
|
+
return yield eat(m`#: <*Space:Space />`);
|
|
26
25
|
}
|
|
27
26
|
return null;
|
|
28
27
|
}
|
|
29
28
|
export const grammar = class VerboseOutputGrammar {
|
|
30
29
|
static {
|
|
31
|
-
[_initProto] = _applyDecs(this, [[Node, 2, "Output"], [Node, 2, "ProductionName"], [_EnterProductionLineDecs, 2, "EnterProductionLine"], [_LeaveProductionLineDecs, 2, "LeaveProductionLine"], [_EmitLineDecs, 2, "EmitLine"], [
|
|
30
|
+
[_initProto] = _applyDecs(this, [[Node, 2, "Output"], [Node, 2, "ProductionName"], [_EnterProductionLineDecs, 2, "EnterProductionLine"], [_LeaveProductionLineDecs, 2, "LeaveProductionLine"], [_EmitLineDecs, 2, "EmitLine"], [_ExecInstructionLineDecs, 2, "ExecInstructionLine"], [_OutputLineDecs, 2, "OutputLine"], [Node, 2, "Identifier"], [_PunctuatorDecs, 2, "Punctuator"], [_AnyDecs, 2, "Any"]], []).e;
|
|
32
31
|
}
|
|
33
32
|
constructor() {
|
|
34
33
|
_initProto(this);
|
|
35
34
|
}
|
|
36
|
-
*[(_EnterProductionLineDecs = [CoveredBy('Line'), Node], _LeaveProductionLineDecs = [CoveredBy('Line'), Node], _EmitLineDecs = [CoveredBy('Line'), Node],
|
|
37
|
-
while ((yield
|
|
35
|
+
*[(_EnterProductionLineDecs = [CoveredBy('Line'), Node], _LeaveProductionLineDecs = [CoveredBy('Line'), Node], _EmitLineDecs = [CoveredBy('Line'), Node], _ExecInstructionLineDecs = [CoveredBy('Line'), Node], _OutputLineDecs = [CoveredBy('Line'), Node], _PunctuatorDecs = [Literal, Node, InjectFrom(productions)], _AnyDecs = InjectFrom(productions), "Output")]() {
|
|
36
|
+
while ((yield match(re`/./`)) && (yield eat(m`lines[]: <__Line />`)));
|
|
38
37
|
}
|
|
39
38
|
*Line() {
|
|
40
|
-
yield
|
|
41
|
-
<ExecSpamexInstructionLine '>>>' />
|
|
42
|
-
<ExecCSTMLInstructionLine ' >>>' />
|
|
43
|
-
<EmitLine '<<<' />
|
|
44
|
-
<EnterProductionLine '-->' />
|
|
45
|
-
<LeaveProductionLine /[x<]--/ />
|
|
46
|
-
<OutputLine />
|
|
47
|
-
])`;
|
|
39
|
+
yield eat(m`<_Any />`, [m`<ExecInstructionLine /( )?\>\>\>/ />`, m`<EmitLine '<<<' />`, m`<EnterProductionLine '-->' />`, m`<LeaveProductionLine /[x<]--/ />`, m`<OutputLine />`]);
|
|
48
40
|
}
|
|
49
41
|
*ProductionName() {
|
|
50
|
-
yield
|
|
51
|
-
yield
|
|
52
|
-
yield
|
|
42
|
+
yield eatMatch(m`openBrace: <*Punctuator '[' />`);
|
|
43
|
+
yield eat(m`productionName: <*Identifier />`);
|
|
44
|
+
yield eatMatch(m`closeBrace: <*Punctuator ']' />`);
|
|
53
45
|
}
|
|
54
46
|
*EnterProductionLine() {
|
|
55
|
-
yield
|
|
47
|
+
yield eat(m`sigilToken: <*Punctuator '-->' />`);
|
|
56
48
|
yield* eatMatchTrivia();
|
|
57
|
-
yield
|
|
58
|
-
yield
|
|
49
|
+
yield eat(m`name: <ProductionName />`);
|
|
50
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
59
51
|
}
|
|
60
52
|
*LeaveProductionLine() {
|
|
61
|
-
yield
|
|
53
|
+
yield eat(m`sigilToken: <*Punctuator /[<x]--/ />`);
|
|
62
54
|
yield* eatMatchTrivia();
|
|
63
|
-
yield
|
|
64
|
-
yield
|
|
55
|
+
yield eat(m`name: <ProductionName />`);
|
|
56
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
65
57
|
}
|
|
66
58
|
*EmitLine() {
|
|
67
|
-
yield
|
|
59
|
+
yield eat(m`sigilToken: <*Punctuator '<<<' />`);
|
|
68
60
|
yield* eatMatchTrivia();
|
|
69
|
-
yield
|
|
70
|
-
yield
|
|
61
|
+
yield eat(m`expression: <__CSTML:Tag />`);
|
|
62
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
71
63
|
}
|
|
72
|
-
*
|
|
73
|
-
yield
|
|
64
|
+
*ExecInstructionLine() {
|
|
65
|
+
yield eatMatch(m`#: <*Space:Space /[ \t]+/ />`);
|
|
66
|
+
yield eat(m`sigilToken: <*Punctuator '>>>' />`);
|
|
74
67
|
yield* eatMatchTrivia();
|
|
75
|
-
yield
|
|
76
|
-
yield
|
|
77
|
-
}
|
|
78
|
-
*ExecSpamexInstructionLine() {
|
|
79
|
-
yield i`eat(<*Punctuator '>>>' /> 'sigilToken')`;
|
|
80
|
-
yield* eatMatchTrivia();
|
|
81
|
-
yield i`eat(<SpamexInstruction:Call /> 'instruction')`;
|
|
82
|
-
yield i`eat(<*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
68
|
+
yield eat(m`instruction: <Instruction:Call />`);
|
|
69
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
83
70
|
}
|
|
84
71
|
*OutputLine() {
|
|
85
72
|
yield* eatMatchTrivia();
|
|
86
|
-
yield i`eat(<
|
|
87
|
-
yield
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
// yield i`eat(m'expressions[]: <__CSTML:Tag />')`;
|
|
74
|
+
yield eat(m`expressions[]: <__CSTML:Tag />`);
|
|
75
|
+
yield eatMatch(m`#: <*Space:Space /[ \t]/ />`);
|
|
76
|
+
while (yield eatMatch(m`expressions[]: <__CSTML:Tag />`)) {
|
|
77
|
+
yield eatMatch(m`#: <*Space:Space /[ \t]/ />`);
|
|
90
78
|
}
|
|
91
|
-
yield
|
|
79
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
92
80
|
}
|
|
93
81
|
*Identifier() {
|
|
94
|
-
yield
|
|
82
|
+
yield eat(re`/[a-zA-Z]+/`);
|
|
95
83
|
}
|
|
96
84
|
*Punctuator() {}
|
|
97
85
|
*Any() {}
|
package/lib/grammar.macro.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { i } from '@bablr/boot';
|
|
2
|
-
import { CoveredBy, Node, InjectFrom } from '@bablr/helpers/decorators';
|
|
1
|
+
import { i, re, spam as m } from '@bablr/boot';
|
|
2
|
+
import { CoveredBy, Node, InjectFrom, Literal } from '@bablr/helpers/decorators';
|
|
3
|
+
import { o, eat, eatMatch, match } from '@bablr/helpers/grammar';
|
|
3
4
|
import * as productions from '@bablr/helpers/productions';
|
|
4
5
|
import * as CSTML from '@bablr/language-en-cstml';
|
|
5
|
-
import * as
|
|
6
|
-
import * as SpamexInstruction from '@bablr/language-en-bablr-vm-instruction/spamex';
|
|
6
|
+
import * as Instruction from '@bablr/language-en-bablr-vm-instruction';
|
|
7
7
|
import * as Space from '@bablr/language-en-blank-space';
|
|
8
8
|
|
|
9
|
-
export const dependencies = { Space, CSTML,
|
|
9
|
+
export const dependencies = { Space, CSTML, Instruction };
|
|
10
10
|
|
|
11
11
|
export const canonicalURL = 'https://bablr.org/languages/core/en/bablr-cli-verbose-output';
|
|
12
12
|
|
|
13
13
|
export function* eatMatchTrivia() {
|
|
14
|
-
if (yield
|
|
15
|
-
return yield
|
|
14
|
+
if (yield match(re`/[ \t\n]/`)) {
|
|
15
|
+
return yield eat(m`#: <*Space:Space />`);
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
@@ -20,91 +20,84 @@ export function* eatMatchTrivia() {
|
|
|
20
20
|
export const grammar = class VerboseOutputGrammar {
|
|
21
21
|
@Node
|
|
22
22
|
*Output() {
|
|
23
|
-
while ((yield
|
|
23
|
+
while ((yield match(re`/./`)) && (yield eat(m`lines[]: <__Line />`)));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
*Line() {
|
|
27
|
-
yield
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
])`;
|
|
27
|
+
yield eat(m`<_Any />`, [
|
|
28
|
+
m`<ExecInstructionLine /( )?\>\>\>/ />`,
|
|
29
|
+
m`<EmitLine '<<<' />`,
|
|
30
|
+
m`<EnterProductionLine '-->' />`,
|
|
31
|
+
m`<LeaveProductionLine /[x<]--/ />`,
|
|
32
|
+
m`<OutputLine />`,
|
|
33
|
+
]);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
@Node
|
|
38
37
|
*ProductionName() {
|
|
39
|
-
yield
|
|
40
|
-
yield
|
|
41
|
-
yield
|
|
38
|
+
yield eatMatch(m`openBrace: <*Punctuator '[' />`);
|
|
39
|
+
yield eat(m`productionName: <*Identifier />`);
|
|
40
|
+
yield eatMatch(m`closeBrace: <*Punctuator ']' />`);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
@CoveredBy('Line')
|
|
45
44
|
@Node
|
|
46
45
|
*EnterProductionLine() {
|
|
47
|
-
yield
|
|
46
|
+
yield eat(m`sigilToken: <*Punctuator '-->' />`);
|
|
48
47
|
yield* eatMatchTrivia();
|
|
49
|
-
yield
|
|
50
|
-
yield
|
|
48
|
+
yield eat(m`name: <ProductionName />`);
|
|
49
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
@CoveredBy('Line')
|
|
54
53
|
@Node
|
|
55
54
|
*LeaveProductionLine() {
|
|
56
|
-
yield
|
|
55
|
+
yield eat(m`sigilToken: <*Punctuator /[<x]--/ />`);
|
|
57
56
|
yield* eatMatchTrivia();
|
|
58
|
-
yield
|
|
59
|
-
yield
|
|
57
|
+
yield eat(m`name: <ProductionName />`);
|
|
58
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
@CoveredBy('Line')
|
|
63
62
|
@Node
|
|
64
63
|
*EmitLine() {
|
|
65
|
-
yield
|
|
64
|
+
yield eat(m`sigilToken: <*Punctuator '<<<' />`);
|
|
66
65
|
yield* eatMatchTrivia();
|
|
67
|
-
yield
|
|
68
|
-
yield
|
|
66
|
+
yield eat(m`expression: <__CSTML:Tag />`);
|
|
67
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
@CoveredBy('Line')
|
|
72
71
|
@Node
|
|
73
|
-
*
|
|
74
|
-
yield
|
|
72
|
+
*ExecInstructionLine() {
|
|
73
|
+
yield eatMatch(m`#: <*Space:Space /[ \t]+/ />`);
|
|
74
|
+
yield eat(m`sigilToken: <*Punctuator '>>>' />`);
|
|
75
75
|
yield* eatMatchTrivia();
|
|
76
|
-
yield
|
|
77
|
-
yield
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@CoveredBy('Line')
|
|
81
|
-
@Node
|
|
82
|
-
*ExecSpamexInstructionLine() {
|
|
83
|
-
yield i`eat(<*Punctuator '>>>' /> 'sigilToken')`;
|
|
84
|
-
yield* eatMatchTrivia();
|
|
85
|
-
yield i`eat(<SpamexInstruction:Call /> 'instruction')`;
|
|
86
|
-
yield i`eat(<*Punctuator '\n' /> 'lineTerminatorToken')`;
|
|
76
|
+
yield eat(m`instruction: <Instruction:Call />`);
|
|
77
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
87
78
|
}
|
|
88
79
|
|
|
89
80
|
@CoveredBy('Line')
|
|
90
81
|
@Node
|
|
91
82
|
*OutputLine() {
|
|
92
83
|
yield* eatMatchTrivia();
|
|
93
|
-
yield i`eat(<
|
|
84
|
+
// yield i`eat(m'expressions[]: <__CSTML:Tag />')`;
|
|
85
|
+
yield eat(m`expressions[]: <__CSTML:Tag />`);
|
|
94
86
|
|
|
95
|
-
yield
|
|
87
|
+
yield eatMatch(m`#: <*Space:Space /[ \t]/ />`);
|
|
96
88
|
|
|
97
|
-
while (yield
|
|
98
|
-
yield
|
|
89
|
+
while (yield eatMatch(m`expressions[]: <__CSTML:Tag />`)) {
|
|
90
|
+
yield eatMatch(m`#: <*Space:Space /[ \t]/ />`);
|
|
99
91
|
}
|
|
100
|
-
yield
|
|
92
|
+
yield eat(m`lineTerminatorToken: <*Punctuator '\n' />`);
|
|
101
93
|
}
|
|
102
94
|
|
|
103
95
|
@Node
|
|
104
96
|
*Identifier() {
|
|
105
|
-
yield
|
|
97
|
+
yield eat(re`/[a-zA-Z]+/`);
|
|
106
98
|
}
|
|
107
99
|
|
|
100
|
+
@Literal
|
|
108
101
|
@Node
|
|
109
102
|
@InjectFrom(productions)
|
|
110
103
|
*Punctuator() {}
|
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.7.0",
|
|
4
4
|
"description": "A BABLR language for BABLR CLI verbose output",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.0.0"
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@babel/runtime": "^7.23.2",
|
|
24
|
-
"@bablr/agast-helpers": "
|
|
25
|
-
"@bablr/agast-vm-helpers": "
|
|
26
|
-
"@bablr/helpers": "
|
|
27
|
-
"@bablr/language-en-bablr-vm-instruction": "
|
|
28
|
-
"@bablr/language-en-blank-space": "
|
|
29
|
-
"@bablr/language-en-cstml": "
|
|
24
|
+
"@bablr/agast-helpers": "0.7.1",
|
|
25
|
+
"@bablr/agast-vm-helpers": "0.7.1",
|
|
26
|
+
"@bablr/helpers": "0.22.1",
|
|
27
|
+
"@bablr/language-en-bablr-vm-instruction": "0.8.0",
|
|
28
|
+
"@bablr/language-en-blank-space": "0.7.0",
|
|
29
|
+
"@bablr/language-en-cstml": "0.9.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@bablr/boot": "^0.
|
|
32
|
+
"@bablr/boot": "^0.8.1",
|
|
33
33
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",
|
|
34
34
|
"@bablr/macrome": "^0.1.3",
|
|
35
35
|
"@bablr/macrome-generator-bablr": "^0.3.2",
|