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