@bablr/language-en-bablr-vm-instruction 0.7.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 CHANGED
@@ -1,13 +1,13 @@
1
1
  /* @macrome
2
2
  * @generatedby @bablr/macrome-generator-bablr
3
- * @generatedfrom ./grammar.macro.js#fc9c56fc5e4782984cf9353141e7dacf01e266f2
3
+ * @generatedfrom ./grammar.macro.js#cf3533cf59feb7085579a8647a86abe6ae60d72f
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, _StringDecs, _PunctuatorDecs, _KeywordDecs, _AnyDecs;
9
9
  import { re, spam as m } from '@bablr/boot';
10
- import { extendLanguage, o, eat, match } from '@bablr/helpers/grammar';
10
+ import { extendLanguage, o, eat, match, eatMatch } from '@bablr/helpers/grammar';
11
11
  import { CoveredBy, Node, InjectFrom } from '@bablr/helpers/decorators';
12
12
  import * as Space from '@bablr/language-en-blank-space';
13
13
  import * as CSTML from '@bablr/language-en-cstml';
@@ -30,8 +30,8 @@ const IJSON = extendLanguage(JSON, {
30
30
  },
31
31
  grammar: class IJSON extends JSON.grammar {
32
32
  *Expression(props) {
33
- if (yield match(re`/(m|re|t)['"\u0060]/`)) {
34
- yield eat(m`<Instruction:Expression />`);
33
+ if (yield match(re`/(m|re|t|i)['"\u0060]/`)) {
34
+ yield eat(m`<__Instruction:Expression />`);
35
35
  } else {
36
36
  yield* super.Expression(props);
37
37
  }
@@ -48,7 +48,7 @@ export const dependencies = {
48
48
  };
49
49
  export const grammar = class BABLRVMInstructionGrammar {
50
50
  static {
51
- [_initProto] = _applyDecs(this, [[Node, 2, "Call"], [Node, 2, "SpamexString"], [Node, 2, "CSTMLString"], [Node, 2, "RegexString"], [_StringDecs, 2, "String"], [Node, 2, "Identifier"], [_PunctuatorDecs, 2, "Punctuator"], [_KeywordDecs, 2, "Keyword"], [_AnyDecs, 2, "Any"]], []).e;
51
+ [_initProto] = _applyDecs(this, [[Node, 2, "Call"], [Node, 2, "SpamexString"], [Node, 2, "CSTMLString"], [Node, 2, "RegexString"], [Node, 2, "InstructionString"], [_StringDecs, 2, "String"], [Node, 2, "Identifier"], [_PunctuatorDecs, 2, "Punctuator"], [_KeywordDecs, 2, "Keyword"], [_AnyDecs, 2, "Any"]], []).e;
52
52
  }
53
53
  constructor() {
54
54
  _initProto(this);
@@ -60,14 +60,16 @@ export const grammar = class BABLRVMInstructionGrammar {
60
60
  let sp = yield* eatMatchTrivia();
61
61
  let first = true;
62
62
  while ((first || sp) && (yield match(re`/./s`))) {
63
- yield eat(m`values[]$: <Expression />`);
64
- sp = yield* eatMatchTrivia();
63
+ yield eat(m`values[]$: <__Expression />`);
64
+ yield* eatMatchTrivia();
65
+ sp = yield eatMatch(m`separatorTokens[]: <*Punctuator ',' />`);
66
+ yield* eatMatchTrivia();
65
67
  first = false;
66
68
  }
67
69
  yield eat(m`closeToken: <*Punctuator ')' { balancer: true } />`);
68
70
  }
69
71
  *Expression() {
70
- yield eat(m`<Any />`, [m`<IJSON:Array '[' />`, m`<IJSON:Object '{' />`, m`<*JSON:Boolean /true|false/ />`, m`<*JSON:Null 'null' />`, m`<JSON:Number /[\d]|[+-]?Infinity/ />`, m`<SpamexString /m["'\u0060]/ />`, m`<CSTMLString /t["'\u0060]/ />`, m`<RegexString /re["'\u0060]/ />`, m`<JSON:String /["']/ />`]);
72
+ yield eat(m`<_Any />`, [m`<IJSON:Array '[' />`, m`<IJSON:Object '{' />`, m`<JSON:Boolean /true|false/ />`, m`<JSON:Null 'null' />`, m`<JSON:Number /[\d]|[+-]?Infinity/ />`, m`<SpamexString /m["'\u0060]/ />`, m`<CSTMLString /t["'\u0060]/ />`, m`<RegexString /re["'\u0060]/ />`, m`<InstructionString /i["'\u0060]/ />`, m`<JSON:String /["']/ />`]);
71
73
  }
72
74
  *SpamexString({
73
75
  ctx
@@ -75,7 +77,7 @@ export const grammar = class BABLRVMInstructionGrammar {
75
77
  yield eat(m`sigilToken: <*Keyword 'm' />`);
76
78
  let quot = buildString(ctx.sourceTextFor(yield match(re`/['"\u0060]/`)));
77
79
  yield eat(m`openToken: <*Punctuator ${quot} { balanced: ${quot} } />`);
78
- yield eat(m`content: <Spamex:Matcher />`);
80
+ yield eat(m`content: <__Spamex:Matcher />`);
79
81
  yield eat(m`closeToken: <*Punctuator ${quot} { balancer: true } />`);
80
82
  }
81
83
  *CSTMLString({
@@ -84,7 +86,7 @@ export const grammar = class BABLRVMInstructionGrammar {
84
86
  yield eat(m`sigilToken: <*Keyword 't' />`);
85
87
  let quot = buildString(ctx.sourceTextFor(yield match(re`/['"\u0060]/`)));
86
88
  yield eat(m`openToken: <*Punctuator ${quot} { balanced: ${quot} } />`);
87
- yield eat(m`content: <CSTML:Tag />`);
89
+ yield eat(m`content: <__CSTML:Tag />`);
88
90
  yield eat(m`closeToken: <*Punctuator ${quot} { balancer: true } />`);
89
91
  }
90
92
  *RegexString({
@@ -96,10 +98,17 @@ export const grammar = class BABLRVMInstructionGrammar {
96
98
  yield eat(m`content: <Regex:Pattern />`);
97
99
  yield eat(m`closeToken: <*Punctuator ${quot} { balancer: true } />`);
98
100
  }
101
+ *InstructionString({
102
+ ctx
103
+ }) {
104
+ yield eat(m`sigilToken: <*Keyword 'i' />`);
105
+ let quot = buildString(ctx.sourceTextFor(yield match(re`/['"\u0060]/`)));
106
+ yield eat(m`openToken: <*Punctuator ${quot} { balanced: ${quot} } />`);
107
+ yield eat(m`content: <Call />`);
108
+ yield eat(m`closeToken: <*Punctuator ${quot} { balancer: true } />`);
109
+ }
99
110
  *String() {
100
- yield eat(m`<IJSON:String />`, null, o({
101
- suppressNode: true
102
- }));
111
+ yield eat(m`<_IJSON:String />`);
103
112
  }
104
113
  *Identifier() {
105
114
  yield eat(re`/[a-zA-Z]+/`);
@@ -1,5 +1,5 @@
1
1
  import { re, spam as m } from '@bablr/boot';
2
- import { extendLanguage, o, eat, match } from '@bablr/helpers/grammar';
2
+ import { extendLanguage, o, eat, match, eatMatch } from '@bablr/helpers/grammar';
3
3
  import { CoveredBy, Node, InjectFrom } from '@bablr/helpers/decorators';
4
4
  import * as Space from '@bablr/language-en-blank-space';
5
5
  import * as CSTML from '@bablr/language-en-cstml';
@@ -25,8 +25,8 @@ const IJSON = extendLanguage(JSON, {
25
25
  },
26
26
  grammar: class IJSON extends JSON.grammar {
27
27
  *Expression(props) {
28
- if (yield match(re`/(m|re|t)['"\u0060]/`)) {
29
- yield eat(m`<Instruction:Expression />`);
28
+ if (yield match(re`/(m|re|t|i)['"\u0060]/`)) {
29
+ yield eat(m`<__Instruction:Expression />`);
30
30
  } else {
31
31
  yield* super.Expression(props);
32
32
  }
@@ -46,23 +46,26 @@ export const grammar = class BABLRVMInstructionGrammar {
46
46
  let sp = yield* eatMatchTrivia();
47
47
  let first = true;
48
48
  while ((first || sp) && (yield match(re`/./s`))) {
49
- yield eat(m`values[]$: <Expression />`);
50
- sp = yield* eatMatchTrivia();
49
+ yield eat(m`values[]$: <__Expression />`);
50
+ yield* eatMatchTrivia();
51
+ sp = yield eatMatch(m`separatorTokens[]: <*Punctuator ',' />`);
52
+ yield* eatMatchTrivia();
51
53
  first = false;
52
54
  }
53
55
  yield eat(m`closeToken: <*Punctuator ')' { balancer: true } />`);
54
56
  }
55
57
 
56
58
  *Expression() {
57
- yield eat(m`<Any />`, [
59
+ yield eat(m`<_Any />`, [
58
60
  m`<IJSON:Array '[' />`,
59
61
  m`<IJSON:Object '{' />`,
60
- m`<*JSON:Boolean /true|false/ />`,
61
- m`<*JSON:Null 'null' />`,
62
+ m`<JSON:Boolean /true|false/ />`,
63
+ m`<JSON:Null 'null' />`,
62
64
  m`<JSON:Number /[\d]|[+-]?Infinity/ />`,
63
65
  m`<SpamexString /m["'\u0060]/ />`,
64
66
  m`<CSTMLString /t["'\u0060]/ />`,
65
67
  m`<RegexString /re["'\u0060]/ />`,
68
+ m`<InstructionString /i["'\u0060]/ />`,
66
69
  m`<JSON:String /["']/ />`,
67
70
  ]);
68
71
  }
@@ -72,7 +75,7 @@ export const grammar = class BABLRVMInstructionGrammar {
72
75
  yield eat(m`sigilToken: <*Keyword 'm' />`);
73
76
  let quot = buildString(ctx.sourceTextFor(yield match(re`/['"\u0060]/`)));
74
77
  yield eat(m`openToken: <*Punctuator ${quot} { balanced: ${quot} } />`);
75
- yield eat(m`content: <Spamex:Matcher />`);
78
+ yield eat(m`content: <__Spamex:Matcher />`);
76
79
  yield eat(m`closeToken: <*Punctuator ${quot} { balancer: true } />`);
77
80
  }
78
81
 
@@ -81,7 +84,7 @@ export const grammar = class BABLRVMInstructionGrammar {
81
84
  yield eat(m`sigilToken: <*Keyword 't' />`);
82
85
  let quot = buildString(ctx.sourceTextFor(yield match(re`/['"\u0060]/`)));
83
86
  yield eat(m`openToken: <*Punctuator ${quot} { balanced: ${quot} } />`);
84
- yield eat(m`content: <CSTML:Tag />`);
87
+ yield eat(m`content: <__CSTML:Tag />`);
85
88
  yield eat(m`closeToken: <*Punctuator ${quot} { balancer: true } />`);
86
89
  }
87
90
 
@@ -94,11 +97,20 @@ export const grammar = class BABLRVMInstructionGrammar {
94
97
  yield eat(m`closeToken: <*Punctuator ${quot} { balancer: true } />`);
95
98
  }
96
99
 
100
+ @Node
101
+ *InstructionString({ ctx }) {
102
+ yield eat(m`sigilToken: <*Keyword 'i' />`);
103
+ let quot = buildString(ctx.sourceTextFor(yield match(re`/['"\u0060]/`)));
104
+ yield eat(m`openToken: <*Punctuator ${quot} { balanced: ${quot} } />`);
105
+ yield eat(m`content: <Call />`);
106
+ yield eat(m`closeToken: <*Punctuator ${quot} { balancer: true } />`);
107
+ }
108
+
97
109
  @CoveredBy('IJSONExpression')
98
110
  @CoveredBy('Expression')
99
111
  @Node
100
112
  *String() {
101
- yield eat(m`<IJSON:String />`, null, o({ suppressNode: true }));
113
+ yield eat(m`<_IJSON:String />`);
102
114
  }
103
115
 
104
116
  @Node
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bablr/language-en-bablr-vm-instruction",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "A BABLR language for BABLR VM instructions",
5
5
  "engines": {
6
6
  "node": ">=12.0.0"
@@ -23,17 +23,17 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@babel/runtime": "^7.23.2",
26
- "@bablr/agast-helpers": "0.6.0",
27
- "@bablr/agast-vm-helpers": "0.6.0",
28
- "@bablr/helpers": "0.21.1",
29
- "@bablr/language-en-blank-space": "0.6.0",
30
- "@bablr/language-en-cstml": "0.8.0",
31
- "@bablr/language-en-regex-vm-pattern": "0.8.0",
32
- "@bablr/language-en-spamex": "0.7.0",
33
- "@bablr/language-en-cstml-json": "0.1.0"
26
+ "@bablr/agast-helpers": "0.7.1",
27
+ "@bablr/agast-vm-helpers": "0.7.1",
28
+ "@bablr/boot": "0.8.1",
29
+ "@bablr/helpers": "0.22.1",
30
+ "@bablr/language-en-blank-space": "0.7.0",
31
+ "@bablr/language-en-cstml": "0.9.0",
32
+ "@bablr/language-en-regex-vm-pattern": "0.9.0",
33
+ "@bablr/language-en-spamex": "0.8.0",
34
+ "@bablr/language-en-cstml-json": "0.2.0"
34
35
  },
35
36
  "devDependencies": {
36
- "@bablr/boot": "^0.7.0",
37
37
  "@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",
38
38
  "@bablr/macrome": "^0.1.3",
39
39
  "@bablr/macrome-generator-bablr": "^0.3.2",