@malloydata/malloy 0.0.12-dev221202180754 → 0.0.12-dev221204205211

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.
@@ -125,26 +125,27 @@ export declare class MalloyParser extends Parser {
125
125
  static readonly SEMI = 114;
126
126
  static readonly NOT_MATCH = 115;
127
127
  static readonly MATCH = 116;
128
- static readonly LITERAL_TIMESTAMP = 117;
129
- static readonly LITERAL_DAY = 118;
130
- static readonly LITERAL_QUARTER = 119;
131
- static readonly LITERAL_MONTH = 120;
132
- static readonly LITERAL_WEEK = 121;
133
- static readonly LITERAL_YEAR = 122;
134
- static readonly IDENTIFIER = 123;
135
- static readonly PERCENT_LITERAL = 124;
136
- static readonly INTEGER_LITERAL = 125;
137
- static readonly NUMERIC_LITERAL = 126;
138
- static readonly OBJECT_NAME_LITERAL = 127;
139
- static readonly BLOCK_COMMENT = 128;
140
- static readonly COMMENT_TO_EOL = 129;
141
- static readonly WHITE_SPACE = 130;
142
- static readonly SQL_BEGIN = 131;
143
- static readonly CLOSE_CODE = 132;
144
- static readonly UNWATED_CHARS_TRAILING_NUMBERS = 133;
145
- static readonly UNEXPECTED_CHAR = 134;
146
- static readonly OPEN_CODE = 135;
147
- static readonly SQL_END = 136;
128
+ static readonly PERCENT = 117;
129
+ static readonly LITERAL_TIMESTAMP = 118;
130
+ static readonly LITERAL_DAY = 119;
131
+ static readonly LITERAL_QUARTER = 120;
132
+ static readonly LITERAL_MONTH = 121;
133
+ static readonly LITERAL_WEEK = 122;
134
+ static readonly LITERAL_YEAR = 123;
135
+ static readonly IDENTIFIER = 124;
136
+ static readonly PERCENT_LITERAL = 125;
137
+ static readonly INTEGER_LITERAL = 126;
138
+ static readonly NUMERIC_LITERAL = 127;
139
+ static readonly OBJECT_NAME_LITERAL = 128;
140
+ static readonly BLOCK_COMMENT = 129;
141
+ static readonly COMMENT_TO_EOL = 130;
142
+ static readonly WHITE_SPACE = 131;
143
+ static readonly SQL_BEGIN = 132;
144
+ static readonly CLOSE_CODE = 133;
145
+ static readonly UNWATED_CHARS_TRAILING_NUMBERS = 134;
146
+ static readonly UNEXPECTED_CHAR = 135;
147
+ static readonly OPEN_CODE = 136;
148
+ static readonly SQL_END = 137;
148
149
  static readonly RULE_malloyDocument = 0;
149
150
  static readonly RULE_malloyStatement = 1;
150
151
  static readonly RULE_defineExploreStatement = 2;
@@ -1567,6 +1568,7 @@ export declare class ExprMulDivContext extends FieldExprContext {
1567
1568
  fieldExpr(i: number): FieldExprContext;
1568
1569
  STAR(): TerminalNode | undefined;
1569
1570
  SLASH(): TerminalNode | undefined;
1571
+ PERCENT(): TerminalNode | undefined;
1570
1572
  constructor(ctx: FieldExprContext);
1571
1573
  enterRule(listener: MalloyParserListener): void;
1572
1574
  exitRule(listener: MalloyParserListener): void;
@@ -4185,7 +4185,7 @@ class MalloyParser extends Parser_1.Parser {
4185
4185
  }
4186
4186
  this.state = 818;
4187
4187
  _la = this._input.LA(1);
4188
- if (!(_la === MalloyParser.STAR || _la === MalloyParser.SLASH)) {
4188
+ if (!(((((_la - 110)) & ~0x1F) === 0 && ((1 << (_la - 110)) & ((1 << (MalloyParser.STAR - 110)) | (1 << (MalloyParser.SLASH - 110)) | (1 << (MalloyParser.PERCENT - 110)))) !== 0))) {
4189
4189
  this._errHandler.recoverInline(this);
4190
4190
  }
4191
4191
  else {
@@ -5468,26 +5468,27 @@ MalloyParser.BAR = 113;
5468
5468
  MalloyParser.SEMI = 114;
5469
5469
  MalloyParser.NOT_MATCH = 115;
5470
5470
  MalloyParser.MATCH = 116;
5471
- MalloyParser.LITERAL_TIMESTAMP = 117;
5472
- MalloyParser.LITERAL_DAY = 118;
5473
- MalloyParser.LITERAL_QUARTER = 119;
5474
- MalloyParser.LITERAL_MONTH = 120;
5475
- MalloyParser.LITERAL_WEEK = 121;
5476
- MalloyParser.LITERAL_YEAR = 122;
5477
- MalloyParser.IDENTIFIER = 123;
5478
- MalloyParser.PERCENT_LITERAL = 124;
5479
- MalloyParser.INTEGER_LITERAL = 125;
5480
- MalloyParser.NUMERIC_LITERAL = 126;
5481
- MalloyParser.OBJECT_NAME_LITERAL = 127;
5482
- MalloyParser.BLOCK_COMMENT = 128;
5483
- MalloyParser.COMMENT_TO_EOL = 129;
5484
- MalloyParser.WHITE_SPACE = 130;
5485
- MalloyParser.SQL_BEGIN = 131;
5486
- MalloyParser.CLOSE_CODE = 132;
5487
- MalloyParser.UNWATED_CHARS_TRAILING_NUMBERS = 133;
5488
- MalloyParser.UNEXPECTED_CHAR = 134;
5489
- MalloyParser.OPEN_CODE = 135;
5490
- MalloyParser.SQL_END = 136;
5471
+ MalloyParser.PERCENT = 117;
5472
+ MalloyParser.LITERAL_TIMESTAMP = 118;
5473
+ MalloyParser.LITERAL_DAY = 119;
5474
+ MalloyParser.LITERAL_QUARTER = 120;
5475
+ MalloyParser.LITERAL_MONTH = 121;
5476
+ MalloyParser.LITERAL_WEEK = 122;
5477
+ MalloyParser.LITERAL_YEAR = 123;
5478
+ MalloyParser.IDENTIFIER = 124;
5479
+ MalloyParser.PERCENT_LITERAL = 125;
5480
+ MalloyParser.INTEGER_LITERAL = 126;
5481
+ MalloyParser.NUMERIC_LITERAL = 127;
5482
+ MalloyParser.OBJECT_NAME_LITERAL = 128;
5483
+ MalloyParser.BLOCK_COMMENT = 129;
5484
+ MalloyParser.COMMENT_TO_EOL = 130;
5485
+ MalloyParser.WHITE_SPACE = 131;
5486
+ MalloyParser.SQL_BEGIN = 132;
5487
+ MalloyParser.CLOSE_CODE = 133;
5488
+ MalloyParser.UNWATED_CHARS_TRAILING_NUMBERS = 134;
5489
+ MalloyParser.UNEXPECTED_CHAR = 135;
5490
+ MalloyParser.OPEN_CODE = 136;
5491
+ MalloyParser.SQL_END = 137;
5491
5492
  MalloyParser.RULE_malloyDocument = 0;
5492
5493
  MalloyParser.RULE_malloyStatement = 1;
5493
5494
  MalloyParser.RULE_defineExploreStatement = 2;
@@ -5633,9 +5634,9 @@ MalloyParser._LITERAL_NAMES = [
5633
5634
  undefined, undefined, undefined, undefined, undefined, "'&'", "'->'",
5634
5635
  "'=>'", "'('", "')'", "'['", "']'", "'{'", "'}'", "'::'", "':'", "','",
5635
5636
  "'.'", "'<'", "'>'", "'='", "'!='", "'<='", "'>='", "'+'", "'-'", "'*'",
5636
- "'**'", "'/'", "'|'", "';'", "'!~'", "'~'", undefined, undefined, undefined,
5637
+ "'**'", "'/'", "'|'", "';'", "'!~'", "'~'", "'%'", undefined, undefined,
5637
5638
  undefined, undefined, undefined, undefined, undefined, undefined, undefined,
5638
- undefined, undefined, undefined, undefined, "'\"\"\"'", "'}%'",
5639
+ undefined, undefined, undefined, undefined, undefined, "'\"\"\"'", "'}%'",
5639
5640
  ];
5640
5641
  MalloyParser._SYMBOLIC_NAMES = [
5641
5642
  undefined, "JSON_STRING", "ACCEPT", "AGGREGATE", "CONNECTION", "DECLARE",
@@ -5652,7 +5653,7 @@ MalloyParser._SYMBOLIC_NAMES = [
5652
5653
  "AMPER", "ARROW", "FAT_ARROW", "OPAREN", "CPAREN", "OBRACK", "CBRACK",
5653
5654
  "OCURLY", "CCURLY", "DOUBLECOLON", "COLON", "COMMA", "DOT", "LT", "GT",
5654
5655
  "EQ", "NE", "LTE", "GTE", "PLUS", "MINUS", "STAR", "STARSTAR", "SLASH",
5655
- "BAR", "SEMI", "NOT_MATCH", "MATCH", "LITERAL_TIMESTAMP", "LITERAL_DAY",
5656
+ "BAR", "SEMI", "NOT_MATCH", "MATCH", "PERCENT", "LITERAL_TIMESTAMP", "LITERAL_DAY",
5656
5657
  "LITERAL_QUARTER", "LITERAL_MONTH", "LITERAL_WEEK", "LITERAL_YEAR", "IDENTIFIER",
5657
5658
  "PERCENT_LITERAL", "INTEGER_LITERAL", "NUMERIC_LITERAL", "OBJECT_NAME_LITERAL",
5658
5659
  "BLOCK_COMMENT", "COMMENT_TO_EOL", "WHITE_SPACE", "SQL_BEGIN", "CLOSE_CODE",
@@ -5660,7 +5661,7 @@ MalloyParser._SYMBOLIC_NAMES = [
5660
5661
  ];
5661
5662
  MalloyParser.VOCABULARY = new VocabularyImpl_1.VocabularyImpl(MalloyParser._LITERAL_NAMES, MalloyParser._SYMBOLIC_NAMES, []);
5662
5663
  MalloyParser._serializedATNSegments = 2;
5663
- MalloyParser._serializedATNSegment0 = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\x8A\u03E6\x04" +
5664
+ MalloyParser._serializedATNSegment0 = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\x8B\u03E6\x04" +
5664
5665
  "\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04" +
5665
5666
  "\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r" +
5666
5667
  "\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12" +
@@ -5756,15 +5757,15 @@ MalloyParser._serializedATNSegment0 = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\
5756
5757
  "\x02\xA8\x02\xAA\x02\xAC\x02\xAE\x02\xB0\x02\xB2\x02\xB4\x02\xB6\x02\xB8" +
5757
5758
  "\x02\xBA\x02\xBC\x02\xBE\x02\xC0\x02\xC2\x02\xC4\x02\xC6\x02\xC8\x02\xCA" +
5758
5759
  "\x02\xCC\x02\xCE\x02\xD0\x02\x02\x14\x04\x02\n\n\x1B\x1B\x04\x02\x04\x04" +
5759
- "\t\t\x04\x02##--\x05\x0222QQ~\x7F\x06\x02$$**<=KK\x07\x02%%++CCJJOO\x04" +
5760
- "\x02hmuv\x03\x02\x7F\x80\x04\x0222QQ\x04\x02}}\x81\x81\b\x02,,77>?HIS" +
5761
- "SVV\x04\x02 11\x04\x02pprr\x03\x02no\x04\x02!!EE\x04\x02[[ss\x04\x02" +
5762
- "GGee\x03\x02pq\x02\u0427\x02\xD6\x03\x02\x02\x02\x04\xDF\x03\x02\x02\x02" +
5763
- "\x06\xE1\x03\x02\x02\x02\b\xE4\x03\x02\x02\x02\n\xEA\x03\x02\x02\x02\f" +
5764
- "\xEC\x03\x02\x02\x02\x0E\xEE\x03\x02\x02\x02\x10\xF6\x03\x02\x02\x02\x12" +
5765
- "\u0102\x03\x02\x02\x02\x14\u0104\x03\x02\x02\x02\x16\u010D\x03\x02\x02" +
5766
- "\x02\x18\u0111\x03\x02\x02\x02\x1A\u0114\x03\x02\x02\x02\x1C\u0116\x03" +
5767
- "\x02\x02\x02\x1E\u0123\x03\x02\x02\x02 \u0127\x03\x02\x02\x02\"\u013B" +
5760
+ "\t\t\x04\x02##--\x05\x0222QQ\x7F\x80\x06\x02$$**<=KK\x07\x02%%++CCJJO" +
5761
+ "O\x04\x02hmuv\x03\x02\x80\x81\x04\x0222QQ\x04\x02~~\x82\x82\b\x02,,77" +
5762
+ ">?HISSVV\x04\x02 11\x05\x02pprrww\x03\x02no\x04\x02!!EE\x04\x02[[ss\x04" +
5763
+ "\x02GGee\x03\x02pq\x02\u0427\x02\xD6\x03\x02\x02\x02\x04\xDF\x03\x02\x02" +
5764
+ "\x02\x06\xE1\x03\x02\x02\x02\b\xE4\x03\x02\x02\x02\n\xEA\x03\x02\x02\x02" +
5765
+ "\f\xEC\x03\x02\x02\x02\x0E\xEE\x03\x02\x02\x02\x10\xF6\x03\x02\x02\x02" +
5766
+ "\x12\u0102\x03\x02\x02\x02\x14\u0104\x03\x02\x02\x02\x16\u010D\x03\x02" +
5767
+ "\x02\x02\x18\u0111\x03\x02\x02\x02\x1A\u0114\x03\x02\x02\x02\x1C\u0116" +
5768
+ "\x03\x02\x02\x02\x1E\u0123\x03\x02\x02\x02 \u0127\x03\x02\x02\x02\"\u013B" +
5768
5769
  "\x03\x02\x02\x02$\u013D\x03\x02\x02\x02&\u014C\x03\x02\x02\x02(\u014E" +
5769
5770
  "\x03\x02\x02\x02*\u0151\x03\x02\x02\x02,\u0160\x03\x02\x02\x02.\u0162" +
5770
5771
  "\x03\x02\x02\x020\u0167\x03\x02\x02\x022\u0169\x03\x02\x02\x024\u016B" +
@@ -5815,11 +5816,11 @@ MalloyParser._serializedATNSegment0 = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\
5815
5816
  "\x07c\x02\x02\xFD\x11\x03\x02\x02\x02\xFE\xFF\x07\x06\x02\x02\xFF\u0103" +
5816
5817
  "\x05\xD0i\x02\u0100\u0101\x07\x1A\x02\x02\u0101\u0103\x05\x14\v\x02\u0102" +
5817
5818
  "\xFE\x03\x02\x02\x02\u0102\u0100\x03\x02\x02\x02\u0103\x13\x03\x02\x02" +
5818
- "\x02\u0104\u0108\x07\x85\x02\x02\u0105\u0107\x05\x16\f\x02\u0106\u0105" +
5819
+ "\x02\u0104\u0108\x07\x86\x02\x02\u0105\u0107\x05\x16\f\x02\u0106\u0105" +
5819
5820
  "\x03\x02\x02\x02\u0107\u010A\x03\x02\x02\x02\u0108\u0106\x03\x02\x02\x02" +
5820
5821
  "\u0108\u0109\x03\x02\x02\x02\u0109\u010B\x03\x02\x02\x02\u010A\u0108\x03" +
5821
- "\x02\x02\x02\u010B\u010C\x07\x8A\x02\x02\u010C\x15\x03\x02\x02\x02\u010D" +
5822
- "\u010E\x07\x89\x02\x02\u010E\u010F\x05\"\x12\x02\u010F\u0110\x07\x86\x02" +
5822
+ "\x02\x02\x02\u010B\u010C\x07\x8B\x02\x02\u010C\x15\x03\x02\x02\x02\u010D" +
5823
+ "\u010E\x07\x8A\x02\x02\u010E\u010F\x05\"\x12\x02\u010F\u0110\x07\x87\x02" +
5823
5824
  "\x02\u0110\x17\x03\x02\x02\x02\u0111\u0112\x078\x02\x02\u0112\u0113\x05" +
5824
5825
  "\x1A\x0E\x02\u0113\x19\x03\x02\x02\x02\u0114\u0115\x07\x03\x02\x02\u0115" +
5825
5826
  "\x1B\x03\x02\x02\x02\u0116\u011D\x05\x1E\x10\x02\u0117\u0119\x07f\x02" +
@@ -5909,13 +5910,12 @@ MalloyParser._serializedATNSegment0 = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\
5909
5910
  "\x03\x02\x02\x02\u01D2\u01D3\x03\x02\x02\x02\u01D3\u01D4\x03\x02\x02\x02" +
5910
5911
  "\u01D4\u01D6\x05R*\x02\u01D5\u01D2\x03\x02\x02\x02\u01D6\u01D9\x03\x02" +
5911
5912
  "\x02\x02\u01D7\u01D5\x03\x02\x02\x02\u01D7\u01D8\x03\x02\x02\x02\u01D8" +
5912
- "\u01DB\x03\x02\x02\x02\u01D9\u01D7\x03\x02\x02\x02\u01DA\u01DC\x07f\x02" +
5913
- "\x02\u01DB";
5914
- MalloyParser._serializedATNSegment1 = "\u01DA\x03\x02\x02\x02\u01DB\u01DC\x03\x02\x02\x02\u01DCK\x03\x02\x02" +
5915
- "\x02\u01DD\u01DE\x05N(\x02\u01DE\u01DF\x079\x02\x02\u01DF\u01E0\x05\xAA" +
5916
- "V\x02\u01E0M\x03\x02\x02\x02\u01E1\u01E2\x05\xA4S\x02\u01E2O\x03\x02\x02" +
5917
- "\x02\u01E3\u01E4\x05\xA4S\x02\u01E4Q\x03\x02\x02\x02\u01E5\u01E6\x05L" +
5918
- "\'\x02\u01E6S\x03\x02\x02\x02\u01E7\u01E8\x07\x07\x02\x02\u01E8\u01EF" +
5913
+ "\u01DB\x03\x02\x02\x02\u01D9\u01D7\x03\x02\x02\x02\u01DA\u01DC\x07f\x02";
5914
+ MalloyParser._serializedATNSegment1 = "\x02\u01DB\u01DA\x03\x02\x02\x02\u01DB\u01DC\x03\x02\x02\x02\u01DCK\x03" +
5915
+ "\x02\x02\x02\u01DD\u01DE\x05N(\x02\u01DE\u01DF\x079\x02\x02\u01DF\u01E0" +
5916
+ "\x05\xAAV\x02\u01E0M\x03\x02\x02\x02\u01E1\u01E2\x05\xA4S\x02\u01E2O\x03" +
5917
+ "\x02\x02\x02\u01E3\u01E4\x05\xA4S\x02\u01E4Q\x03\x02\x02\x02\u01E5\u01E6" +
5918
+ "\x05L\'\x02\u01E6S\x03\x02\x02\x02\u01E7\u01E8\x07\x07\x02\x02\u01E8\u01EF" +
5919
5919
  "\x05L\'\x02\u01E9\u01EB\x07f\x02\x02\u01EA\u01E9\x03\x02\x02\x02\u01EA" +
5920
5920
  "\u01EB\x03\x02\x02\x02\u01EB\u01EC\x03\x02\x02\x02\u01EC\u01EE\x05L\'" +
5921
5921
  "\x02\u01ED\u01EA\x03\x02\x02\x02\u01EE\u01F1\x03\x02\x02\x02\u01EF\u01ED" +
@@ -6001,14 +6001,14 @@ MalloyParser._serializedATNSegment1 = "\u01DA\x03\x02\x02\x02\u01DB\u01DC\x03\x0
6001
6001
  "\x03\x02\x02\x02\u029E\u029F\x03\x02\x02\x02\u029F\u02A2\x03\x02\x02\x02" +
6002
6002
  "\u02A0\u029E\x03\x02\x02\x02\u02A1\u02A3\x07f\x02\x02\u02A2\u02A1\x03" +
6003
6003
  "\x02\x02\x02\u02A2\u02A3\x03\x02\x02\x02\u02A3\x85\x03\x02\x02\x02\u02A4" +
6004
- "\u02A7\x07\x7F\x02\x02\u02A5\u02A7\x05\xBE`\x02\u02A6\u02A4\x03\x02\x02" +
6004
+ "\u02A7\x07\x80\x02\x02\u02A5\u02A7\x05\xBE`\x02\u02A6\u02A4\x03\x02\x02" +
6005
6005
  "\x02\u02A6\u02A5\x03\x02\x02\x02\u02A7\u02A9\x03\x02\x02\x02\u02A8\u02AA" +
6006
6006
  "\t\x04\x02\x02\u02A9\u02A8\x03\x02\x02\x02\u02A9\u02AA\x03\x02\x02\x02" +
6007
6007
  "\u02AA\x87\x03\x02\x02\x02\u02AB\u02AC\x07\x11\x02\x02\u02AC\u02AD\x07" +
6008
- "\x7F\x02\x02\u02AD\x89\x03\x02\x02\x02\u02AE\u02AF\x07&\x02\x02\u02AF" +
6008
+ "\x80\x02\x02\u02AD\x89\x03\x02\x02\x02\u02AE\u02AF\x07&\x02\x02\u02AF" +
6009
6009
  "\u02B3\x05\xBE`\x02\u02B0\u02B1\x07&\x02\x02\u02B1\u02B3\x05\xAAV\x02" +
6010
6010
  "\u02B2\u02AE\x03\x02\x02\x02\u02B2\u02B0\x03\x02\x02\x02\u02B3\x8B\x03" +
6011
- "\x02\x02\x02\u02B4\u02B5\x07\x1E\x02\x02\u02B5\u02B7\x07\x7F\x02\x02\u02B6" +
6011
+ "\x02\x02\x02\u02B4\u02B5\x07\x1E\x02\x02\u02B5\u02B7\x07\x80\x02\x02\u02B6" +
6012
6012
  "\u02B8\x05\x8AF\x02\u02B7\u02B6\x03\x02\x02\x02\u02B7\u02B8\x03\x02\x02" +
6013
6013
  "\x02\u02B8\x8D\x03\x02\x02\x02\u02B9\u02BC\x05\xBA^\x02\u02BA\u02BB\x07" +
6014
6014
  "g\x02\x02\u02BB\u02BD\x07p\x02\x02\u02BC\u02BA\x03\x02\x02\x02\u02BC\u02BD" +
@@ -6031,8 +6031,8 @@ MalloyParser._serializedATNSegment1 = "\u01DA\x03\x02\x02\x02\u01DB\u01DC\x03\x0
6031
6031
  "\x03\x02\x02\x02\u02E3\u02DD\x03\x02\x02\x02\u02E3\u02DE\x03\x02\x02\x02" +
6032
6032
  "\u02E3\u02DF\x03\x02\x02\x02\u02E3\u02E0\x03\x02\x02\x02\u02E3\u02E1\x03" +
6033
6033
  "\x02\x02\x02\u02E3\u02E2\x03\x02\x02\x02\u02E4\x9F\x03\x02\x02\x02\u02E5" +
6034
- "\u02EC\x07w\x02\x02\u02E6\u02EC\x07x\x02\x02\u02E7\u02EC\x07{\x02\x02" +
6035
- "\u02E8\u02EC\x07z\x02\x02\u02E9\u02EC\x07y\x02\x02\u02EA\u02EC\x07|\x02" +
6034
+ "\u02EC\x07x\x02\x02\u02E6\u02EC\x07y\x02\x02\u02E7\u02EC\x07|\x02\x02" +
6035
+ "\u02E8\u02EC\x07{\x02\x02\u02E9\u02EC\x07z\x02\x02\u02EA\u02EC\x07}\x02" +
6036
6036
  "\x02\u02EB\u02E5\x03\x02\x02\x02\u02EB\u02E6\x03\x02\x02\x02\u02EB\u02E7" +
6037
6037
  "\x03\x02\x02\x02\u02EB\u02E8\x03\x02\x02\x02\u02EB\u02E9\x03\x02\x02\x02" +
6038
6038
  "\u02EB\u02EA\x03\x02\x02\x02\u02EC\xA1\x03\x02\x02\x02\u02ED\u02EE\x07" +
@@ -6126,7 +6126,7 @@ MalloyParser._serializedATNSegment1 = "\u01DA\x03\x02\x02\x02\u01DB\u01DC\x03\x0
6126
6126
  "\x02\x02\x02\u03AC\u03AD\x05\xA4S\x02\u03AD\xBF\x03\x02\x02\x02\u03AE" +
6127
6127
  "\u03AF\x05\xAAV\x02\u03AF\u03B0\x07\x02\x02\x03\u03B0\xC1\x03\x02\x02" +
6128
6128
  "\x02\u03B1\u03B2\x05\xC4c\x02\u03B2\xC3\x03\x02\x02\x02\u03B3\u03BC\x07" +
6129
- "\x03\x02\x02\u03B4\u03BC\x07\x7F\x02\x02\u03B5\u03BC\x07\x80\x02\x02\u03B6" +
6129
+ "\x03\x02\x02\u03B4\u03BC\x07\x80\x02\x02\u03B5\u03BC\x07\x81\x02\x02\u03B6" +
6130
6130
  "\u03BC\x05\xC6d\x02\u03B7\u03BC\x05\xCAf\x02\u03B8\u03BC\x07Q\x02\x02" +
6131
6131
  "\u03B9\u03BC\x072\x02\x02\u03BA\u03BC\x07B\x02\x02\u03BB\u03B3\x03\x02" +
6132
6132
  "\x02\x02\u03BB\u03B4\x03\x02\x02\x02\u03BB\u03B5\x03\x02\x02\x02\u03BB" +
@@ -10564,6 +10564,7 @@ class ExprMulDivContext extends FieldExprContext {
10564
10564
  }
10565
10565
  STAR() { return this.tryGetToken(MalloyParser.STAR, 0); }
10566
10566
  SLASH() { return this.tryGetToken(MalloyParser.SLASH, 0); }
10567
+ PERCENT() { return this.tryGetToken(MalloyParser.PERCENT, 0); }
10567
10568
  constructor(ctx) {
10568
10569
  super(ctx.parent, ctx.invokingState);
10569
10570
  this.copyFrom(ctx);
@@ -49,6 +49,18 @@ const document_highlight_walker_1 = require("./parse-tree-walkers/document-highl
49
49
  const document_completion_walker_1 = require("./parse-tree-walkers/document-completion-walker");
50
50
  const document_help_context_walker_1 = require("./parse-tree-walkers/document-help-context-walker");
51
51
  const reference_list_1 = require("./reference-list");
52
+ /**
53
+ * This ignores a -> popMode when the mode stack is empty, which is a hack,
54
+ * but it let's us parse }%
55
+ */
56
+ class HandlesOverpoppingLexer extends MalloyLexer_1.MalloyLexer {
57
+ popMode() {
58
+ if (this._modeStack.isEmpty) {
59
+ return this._mode;
60
+ }
61
+ return super.popMode();
62
+ }
63
+ }
52
64
  class MalloyParserErrorHandler {
53
65
  constructor(translator, messages) {
54
66
  this.translator = translator;
@@ -105,7 +117,16 @@ class ParseStep {
105
117
  }
106
118
  const source = srcEnt.value == "" ? "\n" : srcEnt.value;
107
119
  this.sourceInfo = this.getSourceInfo(source);
108
- const parse = this.runParser(source, that);
120
+ let parse;
121
+ try {
122
+ parse = this.runParser(source, that);
123
+ }
124
+ catch (parseException) {
125
+ that.root.logger.log({
126
+ message: `Malloy internal parser exception [${parseException.message}]`,
127
+ });
128
+ parse = undefined;
129
+ }
109
130
  if (that.root.logger.hasErrors()) {
110
131
  this.response = {
111
132
  parse,
@@ -154,7 +175,7 @@ class ParseStep {
154
175
  }
155
176
  runParser(source, that) {
156
177
  const inputStream = antlr4ts_1.CharStreams.fromString(source);
157
- const lexer = new MalloyLexer_1.MalloyLexer(inputStream);
178
+ const lexer = new HandlesOverpoppingLexer(inputStream);
158
179
  const tokenStream = new antlr4ts_1.CommonTokenStream(lexer);
159
180
  const malloyParser = new MalloyParser_1.MalloyParser(tokenStream);
160
181
  malloyParser.removeErrorListeners();
@@ -741,7 +741,8 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
741
741
  return new ast.ExprAddSub(lhs, op, rhs);
742
742
  }
743
743
  visitExprMulDiv(pcx) {
744
- return new ast.ExprMulDiv(this.getFieldExpr(pcx.fieldExpr(0)), pcx.STAR() ? "*" : "/", this.getFieldExpr(pcx.fieldExpr(1)));
744
+ const op = pcx.STAR() ? "*" : pcx.SLASH() ? "/" : "%";
745
+ return new ast.ExprMulDiv(this.getFieldExpr(pcx.fieldExpr(0)), op, this.getFieldExpr(pcx.fieldExpr(1)));
745
746
  }
746
747
  visitExprCompare(pcx) {
747
748
  const op = pcx.compareOp().text;
@@ -933,6 +933,7 @@ describe("expressions", () => {
933
933
  test("addition", exprOK("42 + 7"));
934
934
  test("subtraction", exprOK("42 - 7"));
935
935
  test("multiplication", exprOK("42 * 7"));
936
+ test("mod", exprOK("42 % 7"));
936
937
  test("division", exprOK("42 / 7"));
937
938
  test("unary negation", exprOK("- ai"));
938
939
  test("equal", exprOK("42 = 7"));
@@ -1260,6 +1261,9 @@ describe("error handling", () => {
1260
1261
  }
1261
1262
  }
1262
1263
  `));
1264
+ test("popping out of embedding when not embedded", () => {
1265
+ expect("}%").compileToFailWith("extraneous input '}%' expecting {<EOF>, EXPLORE, QUERY, SOURCE, SQL, IMPORT, ';'}");
1266
+ });
1263
1267
  });
1264
1268
  function getSelectOneStruct(sqlBlock) {
1265
1269
  const selectThis = sqlBlock.select[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.12-dev221202180754",
3
+ "version": "0.0.12-dev221204205211",
4
4
  "license": "GPL-2.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",