@malloydata/malloy 0.0.70 → 0.0.71-dev230811214318
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/dist/index.d.ts +1 -1
- package/dist/lang/lib/Malloy/MalloyLexer.d.ts +2 -2
- package/dist/lang/lib/Malloy/MalloyLexer.js +1001 -1003
- package/dist/lang/lib/Malloy/MalloyParser.d.ts +2 -2
- package/dist/lang/lib/Malloy/MalloyParser.js +129 -129
- package/dist/lang/lib/Malloy/MalloyTagLexer.d.ts +5 -4
- package/dist/lang/lib/Malloy/MalloyTagLexer.js +269 -246
- package/dist/lang/lib/Malloy/MalloyTagParser.d.ts +6 -29
- package/dist/lang/lib/Malloy/MalloyTagParser.js +16 -155
- package/dist/malloy.js +8 -2
- package/dist/tags.d.ts +4 -4
- package/dist/tags.js +9 -5
- package/package.json +1 -1
- package/dist/lang/lib/Malloy/MalloyTagListener.d.ts +0 -158
- package/dist/lang/lib/Malloy/MalloyTagListener.js +0 -4
|
@@ -5,7 +5,6 @@ import { ParserRuleContext } from "antlr4ts/ParserRuleContext";
|
|
|
5
5
|
import { TerminalNode } from "antlr4ts/tree/TerminalNode";
|
|
6
6
|
import { TokenStream } from "antlr4ts/TokenStream";
|
|
7
7
|
import { Vocabulary } from "antlr4ts/Vocabulary";
|
|
8
|
-
import { MalloyTagListener } from "./MalloyTagListener";
|
|
9
8
|
import { MalloyTagVisitor } from "./MalloyTagVisitor";
|
|
10
9
|
export declare class MalloyTagParser extends Parser {
|
|
11
10
|
static readonly DOTTY = 1;
|
|
@@ -21,10 +20,11 @@ export declare class MalloyTagParser extends Parser {
|
|
|
21
20
|
static readonly AR_END = 11;
|
|
22
21
|
static readonly SQ_STRING = 12;
|
|
23
22
|
static readonly DQ_STRING = 13;
|
|
24
|
-
static readonly
|
|
25
|
-
static readonly
|
|
26
|
-
static readonly
|
|
27
|
-
static readonly
|
|
23
|
+
static readonly NUMERIC_LITERAL = 14;
|
|
24
|
+
static readonly BARE_STRING = 15;
|
|
25
|
+
static readonly COMMENT = 16;
|
|
26
|
+
static readonly WHITE_SPACE = 17;
|
|
27
|
+
static readonly UNEXPECTED_CHAR = 18;
|
|
28
28
|
static readonly RULE_tagLine = 0;
|
|
29
29
|
static readonly RULE_tagSpec = 1;
|
|
30
30
|
static readonly RULE_string = 2;
|
|
@@ -63,8 +63,6 @@ export declare class TagLineContext extends ParserRuleContext {
|
|
|
63
63
|
tagSpec(i: number): TagSpecContext;
|
|
64
64
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
65
65
|
get ruleIndex(): number;
|
|
66
|
-
enterRule(listener: MalloyTagListener): void;
|
|
67
|
-
exitRule(listener: MalloyTagListener): void;
|
|
68
66
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
69
67
|
}
|
|
70
68
|
export declare class TagSpecContext extends ParserRuleContext {
|
|
@@ -78,8 +76,6 @@ export declare class TagEqContext extends TagSpecContext {
|
|
|
78
76
|
eqValue(): EqValueContext;
|
|
79
77
|
properties(): PropertiesContext | undefined;
|
|
80
78
|
constructor(ctx: TagSpecContext);
|
|
81
|
-
enterRule(listener: MalloyTagListener): void;
|
|
82
|
-
exitRule(listener: MalloyTagListener): void;
|
|
83
79
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
84
80
|
}
|
|
85
81
|
export declare class TagReplacePropertiesContext extends TagSpecContext {
|
|
@@ -88,34 +84,27 @@ export declare class TagReplacePropertiesContext extends TagSpecContext {
|
|
|
88
84
|
properties(): PropertiesContext;
|
|
89
85
|
DOTTY(): TerminalNode | undefined;
|
|
90
86
|
constructor(ctx: TagSpecContext);
|
|
91
|
-
enterRule(listener: MalloyTagListener): void;
|
|
92
|
-
exitRule(listener: MalloyTagListener): void;
|
|
93
87
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
94
88
|
}
|
|
95
89
|
export declare class TagUpdatePropertiesContext extends TagSpecContext {
|
|
96
90
|
propName(): PropNameContext;
|
|
97
91
|
properties(): PropertiesContext;
|
|
98
92
|
constructor(ctx: TagSpecContext);
|
|
99
|
-
enterRule(listener: MalloyTagListener): void;
|
|
100
|
-
exitRule(listener: MalloyTagListener): void;
|
|
101
93
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
102
94
|
}
|
|
103
95
|
export declare class TagDefContext extends TagSpecContext {
|
|
104
96
|
propName(): PropNameContext;
|
|
105
97
|
MINUS(): TerminalNode | undefined;
|
|
106
98
|
constructor(ctx: TagSpecContext);
|
|
107
|
-
enterRule(listener: MalloyTagListener): void;
|
|
108
|
-
exitRule(listener: MalloyTagListener): void;
|
|
109
99
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
110
100
|
}
|
|
111
101
|
export declare class StringContext extends ParserRuleContext {
|
|
112
102
|
SQ_STRING(): TerminalNode | undefined;
|
|
103
|
+
NUMERIC_LITERAL(): TerminalNode | undefined;
|
|
113
104
|
DQ_STRING(): TerminalNode | undefined;
|
|
114
105
|
BARE_STRING(): TerminalNode | undefined;
|
|
115
106
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
116
107
|
get ruleIndex(): number;
|
|
117
|
-
enterRule(listener: MalloyTagListener): void;
|
|
118
|
-
exitRule(listener: MalloyTagListener): void;
|
|
119
108
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
120
109
|
}
|
|
121
110
|
export declare class PropNameContext extends ParserRuleContext {
|
|
@@ -125,8 +114,6 @@ export declare class PropNameContext extends ParserRuleContext {
|
|
|
125
114
|
DOT(i: number): TerminalNode;
|
|
126
115
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
127
116
|
get ruleIndex(): number;
|
|
128
|
-
enterRule(listener: MalloyTagListener): void;
|
|
129
|
-
exitRule(listener: MalloyTagListener): void;
|
|
130
117
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
131
118
|
}
|
|
132
119
|
export declare class EqValueContext extends ParserRuleContext {
|
|
@@ -135,8 +122,6 @@ export declare class EqValueContext extends ParserRuleContext {
|
|
|
135
122
|
reference(): ReferenceContext | undefined;
|
|
136
123
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
137
124
|
get ruleIndex(): number;
|
|
138
|
-
enterRule(listener: MalloyTagListener): void;
|
|
139
|
-
exitRule(listener: MalloyTagListener): void;
|
|
140
125
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
141
126
|
}
|
|
142
127
|
export declare class ArrayElementContext extends ParserRuleContext {
|
|
@@ -146,8 +131,6 @@ export declare class ArrayElementContext extends ParserRuleContext {
|
|
|
146
131
|
reference(): ReferenceContext | undefined;
|
|
147
132
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
148
133
|
get ruleIndex(): number;
|
|
149
|
-
enterRule(listener: MalloyTagListener): void;
|
|
150
|
-
exitRule(listener: MalloyTagListener): void;
|
|
151
134
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
152
135
|
}
|
|
153
136
|
export declare class ReferenceContext extends ParserRuleContext {
|
|
@@ -156,8 +139,6 @@ export declare class ReferenceContext extends ParserRuleContext {
|
|
|
156
139
|
RF_END(): TerminalNode;
|
|
157
140
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
158
141
|
get ruleIndex(): number;
|
|
159
|
-
enterRule(listener: MalloyTagListener): void;
|
|
160
|
-
exitRule(listener: MalloyTagListener): void;
|
|
161
142
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
162
143
|
}
|
|
163
144
|
export declare class ArrayValueContext extends ParserRuleContext {
|
|
@@ -169,8 +150,6 @@ export declare class ArrayValueContext extends ParserRuleContext {
|
|
|
169
150
|
COMMA(i: number): TerminalNode;
|
|
170
151
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
171
152
|
get ruleIndex(): number;
|
|
172
|
-
enterRule(listener: MalloyTagListener): void;
|
|
173
|
-
exitRule(listener: MalloyTagListener): void;
|
|
174
153
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
175
154
|
}
|
|
176
155
|
export declare class PropertiesContext extends ParserRuleContext {
|
|
@@ -181,7 +160,5 @@ export declare class PropertiesContext extends ParserRuleContext {
|
|
|
181
160
|
tagSpec(i: number): TagSpecContext;
|
|
182
161
|
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
183
162
|
get ruleIndex(): number;
|
|
184
|
-
enterRule(listener: MalloyTagListener): void;
|
|
185
|
-
exitRule(listener: MalloyTagListener): void;
|
|
186
163
|
accept<Result>(visitor: MalloyTagVisitor<Result>): Result;
|
|
187
164
|
}
|
|
@@ -67,7 +67,7 @@ class MalloyTagParser extends Parser_1.Parser {
|
|
|
67
67
|
this.state = 21;
|
|
68
68
|
this._errHandler.sync(this);
|
|
69
69
|
_la = this._input.LA(1);
|
|
70
|
-
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.MINUS) | (1 << MalloyTagParser.SQ_STRING) | (1 << MalloyTagParser.DQ_STRING) | (1 << MalloyTagParser.BARE_STRING))) !== 0)) {
|
|
70
|
+
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.MINUS) | (1 << MalloyTagParser.SQ_STRING) | (1 << MalloyTagParser.DQ_STRING) | (1 << MalloyTagParser.NUMERIC_LITERAL) | (1 << MalloyTagParser.BARE_STRING))) !== 0)) {
|
|
71
71
|
{
|
|
72
72
|
{
|
|
73
73
|
this.state = 18;
|
|
@@ -202,7 +202,7 @@ class MalloyTagParser extends Parser_1.Parser {
|
|
|
202
202
|
{
|
|
203
203
|
this.state = 48;
|
|
204
204
|
_la = this._input.LA(1);
|
|
205
|
-
if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.SQ_STRING) | (1 << MalloyTagParser.DQ_STRING) | (1 << MalloyTagParser.BARE_STRING))) !== 0))) {
|
|
205
|
+
if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.SQ_STRING) | (1 << MalloyTagParser.DQ_STRING) | (1 << MalloyTagParser.NUMERIC_LITERAL) | (1 << MalloyTagParser.BARE_STRING))) !== 0))) {
|
|
206
206
|
this._errHandler.recoverInline(this);
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
@@ -282,6 +282,7 @@ class MalloyTagParser extends Parser_1.Parser {
|
|
|
282
282
|
switch (this._input.LA(1)) {
|
|
283
283
|
case MalloyTagParser.SQ_STRING:
|
|
284
284
|
case MalloyTagParser.DQ_STRING:
|
|
285
|
+
case MalloyTagParser.NUMERIC_LITERAL:
|
|
285
286
|
case MalloyTagParser.BARE_STRING:
|
|
286
287
|
this.enterOuterAlt(_localctx, 1);
|
|
287
288
|
{
|
|
@@ -333,6 +334,7 @@ class MalloyTagParser extends Parser_1.Parser {
|
|
|
333
334
|
switch (this._input.LA(1)) {
|
|
334
335
|
case MalloyTagParser.SQ_STRING:
|
|
335
336
|
case MalloyTagParser.DQ_STRING:
|
|
337
|
+
case MalloyTagParser.NUMERIC_LITERAL:
|
|
336
338
|
case MalloyTagParser.BARE_STRING:
|
|
337
339
|
this.enterOuterAlt(_localctx, 1);
|
|
338
340
|
{
|
|
@@ -501,13 +503,14 @@ class MalloyTagParser extends Parser_1.Parser {
|
|
|
501
503
|
case MalloyTagParser.PR_END:
|
|
502
504
|
case MalloyTagParser.SQ_STRING:
|
|
503
505
|
case MalloyTagParser.DQ_STRING:
|
|
506
|
+
case MalloyTagParser.NUMERIC_LITERAL:
|
|
504
507
|
case MalloyTagParser.BARE_STRING:
|
|
505
508
|
{
|
|
506
509
|
{
|
|
507
510
|
this.state = 95;
|
|
508
511
|
this._errHandler.sync(this);
|
|
509
512
|
_la = this._input.LA(1);
|
|
510
|
-
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.MINUS) | (1 << MalloyTagParser.SQ_STRING) | (1 << MalloyTagParser.DQ_STRING) | (1 << MalloyTagParser.BARE_STRING))) !== 0)) {
|
|
513
|
+
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.MINUS) | (1 << MalloyTagParser.SQ_STRING) | (1 << MalloyTagParser.DQ_STRING) | (1 << MalloyTagParser.NUMERIC_LITERAL) | (1 << MalloyTagParser.BARE_STRING))) !== 0)) {
|
|
511
514
|
{
|
|
512
515
|
{
|
|
513
516
|
this.state = 92;
|
|
@@ -564,10 +567,11 @@ MalloyTagParser.COMMA = 10;
|
|
|
564
567
|
MalloyTagParser.AR_END = 11;
|
|
565
568
|
MalloyTagParser.SQ_STRING = 12;
|
|
566
569
|
MalloyTagParser.DQ_STRING = 13;
|
|
567
|
-
MalloyTagParser.
|
|
568
|
-
MalloyTagParser.
|
|
569
|
-
MalloyTagParser.
|
|
570
|
-
MalloyTagParser.
|
|
570
|
+
MalloyTagParser.NUMERIC_LITERAL = 14;
|
|
571
|
+
MalloyTagParser.BARE_STRING = 15;
|
|
572
|
+
MalloyTagParser.COMMENT = 16;
|
|
573
|
+
MalloyTagParser.WHITE_SPACE = 17;
|
|
574
|
+
MalloyTagParser.UNEXPECTED_CHAR = 18;
|
|
571
575
|
MalloyTagParser.RULE_tagLine = 0;
|
|
572
576
|
MalloyTagParser.RULE_tagSpec = 1;
|
|
573
577
|
MalloyTagParser.RULE_string = 2;
|
|
@@ -588,11 +592,11 @@ MalloyTagParser._LITERAL_NAMES = [
|
|
|
588
592
|
];
|
|
589
593
|
MalloyTagParser._SYMBOLIC_NAMES = [
|
|
590
594
|
undefined, "DOTTY", "DOT", "MINUS", "EQ", "RF_BEG", "RF_END", "PR_BEG",
|
|
591
|
-
"PR_END", "AR_BEG", "COMMA", "AR_END", "SQ_STRING", "DQ_STRING", "
|
|
592
|
-
"COMMENT", "WHITE_SPACE", "UNEXPECTED_CHAR",
|
|
595
|
+
"PR_END", "AR_BEG", "COMMA", "AR_END", "SQ_STRING", "DQ_STRING", "NUMERIC_LITERAL",
|
|
596
|
+
"BARE_STRING", "COMMENT", "WHITE_SPACE", "UNEXPECTED_CHAR",
|
|
593
597
|
];
|
|
594
598
|
MalloyTagParser.VOCABULARY = new VocabularyImpl_1.VocabularyImpl(MalloyTagParser._LITERAL_NAMES, MalloyTagParser._SYMBOLIC_NAMES, []);
|
|
595
|
-
MalloyTagParser._serializedATN = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\
|
|
599
|
+
MalloyTagParser._serializedATN = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\x14i\x04\x02" +
|
|
596
600
|
"\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" +
|
|
597
601
|
"\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x03\x02\x07\x02\x16\n\x02\f\x02\x0E" +
|
|
598
602
|
"\x02\x19\v\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x05\x03" +
|
|
@@ -604,7 +608,7 @@ MalloyTagParser._serializedATN = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B
|
|
|
604
608
|
"\t\x03\t\x03\t\x07\tS\n\t\f\t\x0E\tV\v\t\x03\t\x05\tY\n\t\x03\t\x03\t" +
|
|
605
609
|
"\x03\n\x03\n\x03\n\x07\n`\n\n\f\n\x0E\nc\v\n\x05\ne\n\n\x03\n\x03\n\x03" +
|
|
606
610
|
"\n\x02\x02\x02\v\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E\x02\x10" +
|
|
607
|
-
"\x02\x12\x02\x02\x03\x03\x02\x0E\
|
|
611
|
+
"\x02\x12\x02\x02\x03\x03\x02\x0E\x11\x02q\x02\x17\x03\x02\x02\x02\x04" +
|
|
608
612
|
"0\x03\x02\x02\x02\x062\x03\x02\x02\x02\b4\x03\x02\x02\x02\n?\x03\x02\x02" +
|
|
609
613
|
"\x02\fH\x03\x02\x02\x02\x0EJ\x03\x02\x02\x02\x10N\x03\x02\x02\x02\x12" +
|
|
610
614
|
"\\\x03\x02\x02\x02\x14\x16\x05\x04\x03\x02\x15\x14\x03\x02\x02\x02\x16" +
|
|
@@ -651,18 +655,6 @@ class TagLineContext extends ParserRuleContext_1.ParserRuleContext {
|
|
|
651
655
|
// @Override
|
|
652
656
|
get ruleIndex() { return MalloyTagParser.RULE_tagLine; }
|
|
653
657
|
// @Override
|
|
654
|
-
enterRule(listener) {
|
|
655
|
-
if (listener.enterTagLine) {
|
|
656
|
-
listener.enterTagLine(this);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
// @Override
|
|
660
|
-
exitRule(listener) {
|
|
661
|
-
if (listener.exitTagLine) {
|
|
662
|
-
listener.exitTagLine(this);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
// @Override
|
|
666
658
|
accept(visitor) {
|
|
667
659
|
if (visitor.visitTagLine) {
|
|
668
660
|
return visitor.visitTagLine(this);
|
|
@@ -700,18 +692,6 @@ class TagEqContext extends TagSpecContext {
|
|
|
700
692
|
this.copyFrom(ctx);
|
|
701
693
|
}
|
|
702
694
|
// @Override
|
|
703
|
-
enterRule(listener) {
|
|
704
|
-
if (listener.enterTagEq) {
|
|
705
|
-
listener.enterTagEq(this);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
// @Override
|
|
709
|
-
exitRule(listener) {
|
|
710
|
-
if (listener.exitTagEq) {
|
|
711
|
-
listener.exitTagEq(this);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
// @Override
|
|
715
695
|
accept(visitor) {
|
|
716
696
|
if (visitor.visitTagEq) {
|
|
717
697
|
return visitor.visitTagEq(this);
|
|
@@ -736,18 +716,6 @@ class TagReplacePropertiesContext extends TagSpecContext {
|
|
|
736
716
|
this.copyFrom(ctx);
|
|
737
717
|
}
|
|
738
718
|
// @Override
|
|
739
|
-
enterRule(listener) {
|
|
740
|
-
if (listener.enterTagReplaceProperties) {
|
|
741
|
-
listener.enterTagReplaceProperties(this);
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
// @Override
|
|
745
|
-
exitRule(listener) {
|
|
746
|
-
if (listener.exitTagReplaceProperties) {
|
|
747
|
-
listener.exitTagReplaceProperties(this);
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
// @Override
|
|
751
719
|
accept(visitor) {
|
|
752
720
|
if (visitor.visitTagReplaceProperties) {
|
|
753
721
|
return visitor.visitTagReplaceProperties(this);
|
|
@@ -770,18 +738,6 @@ class TagUpdatePropertiesContext extends TagSpecContext {
|
|
|
770
738
|
this.copyFrom(ctx);
|
|
771
739
|
}
|
|
772
740
|
// @Override
|
|
773
|
-
enterRule(listener) {
|
|
774
|
-
if (listener.enterTagUpdateProperties) {
|
|
775
|
-
listener.enterTagUpdateProperties(this);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
// @Override
|
|
779
|
-
exitRule(listener) {
|
|
780
|
-
if (listener.exitTagUpdateProperties) {
|
|
781
|
-
listener.exitTagUpdateProperties(this);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
// @Override
|
|
785
741
|
accept(visitor) {
|
|
786
742
|
if (visitor.visitTagUpdateProperties) {
|
|
787
743
|
return visitor.visitTagUpdateProperties(this);
|
|
@@ -802,18 +758,6 @@ class TagDefContext extends TagSpecContext {
|
|
|
802
758
|
this.copyFrom(ctx);
|
|
803
759
|
}
|
|
804
760
|
// @Override
|
|
805
|
-
enterRule(listener) {
|
|
806
|
-
if (listener.enterTagDef) {
|
|
807
|
-
listener.enterTagDef(this);
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
// @Override
|
|
811
|
-
exitRule(listener) {
|
|
812
|
-
if (listener.exitTagDef) {
|
|
813
|
-
listener.exitTagDef(this);
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
// @Override
|
|
817
761
|
accept(visitor) {
|
|
818
762
|
if (visitor.visitTagDef) {
|
|
819
763
|
return visitor.visitTagDef(this);
|
|
@@ -826,6 +770,7 @@ class TagDefContext extends TagSpecContext {
|
|
|
826
770
|
exports.TagDefContext = TagDefContext;
|
|
827
771
|
class StringContext extends ParserRuleContext_1.ParserRuleContext {
|
|
828
772
|
SQ_STRING() { return this.tryGetToken(MalloyTagParser.SQ_STRING, 0); }
|
|
773
|
+
NUMERIC_LITERAL() { return this.tryGetToken(MalloyTagParser.NUMERIC_LITERAL, 0); }
|
|
829
774
|
DQ_STRING() { return this.tryGetToken(MalloyTagParser.DQ_STRING, 0); }
|
|
830
775
|
BARE_STRING() { return this.tryGetToken(MalloyTagParser.BARE_STRING, 0); }
|
|
831
776
|
constructor(parent, invokingState) {
|
|
@@ -834,18 +779,6 @@ class StringContext extends ParserRuleContext_1.ParserRuleContext {
|
|
|
834
779
|
// @Override
|
|
835
780
|
get ruleIndex() { return MalloyTagParser.RULE_string; }
|
|
836
781
|
// @Override
|
|
837
|
-
enterRule(listener) {
|
|
838
|
-
if (listener.enterString) {
|
|
839
|
-
listener.enterString(this);
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
// @Override
|
|
843
|
-
exitRule(listener) {
|
|
844
|
-
if (listener.exitString) {
|
|
845
|
-
listener.exitString(this);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
// @Override
|
|
849
782
|
accept(visitor) {
|
|
850
783
|
if (visitor.visitString) {
|
|
851
784
|
return visitor.visitString(this);
|
|
@@ -879,18 +812,6 @@ class PropNameContext extends ParserRuleContext_1.ParserRuleContext {
|
|
|
879
812
|
// @Override
|
|
880
813
|
get ruleIndex() { return MalloyTagParser.RULE_propName; }
|
|
881
814
|
// @Override
|
|
882
|
-
enterRule(listener) {
|
|
883
|
-
if (listener.enterPropName) {
|
|
884
|
-
listener.enterPropName(this);
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
// @Override
|
|
888
|
-
exitRule(listener) {
|
|
889
|
-
if (listener.exitPropName) {
|
|
890
|
-
listener.exitPropName(this);
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
// @Override
|
|
894
815
|
accept(visitor) {
|
|
895
816
|
if (visitor.visitPropName) {
|
|
896
817
|
return visitor.visitPropName(this);
|
|
@@ -917,18 +838,6 @@ class EqValueContext extends ParserRuleContext_1.ParserRuleContext {
|
|
|
917
838
|
// @Override
|
|
918
839
|
get ruleIndex() { return MalloyTagParser.RULE_eqValue; }
|
|
919
840
|
// @Override
|
|
920
|
-
enterRule(listener) {
|
|
921
|
-
if (listener.enterEqValue) {
|
|
922
|
-
listener.enterEqValue(this);
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
// @Override
|
|
926
|
-
exitRule(listener) {
|
|
927
|
-
if (listener.exitEqValue) {
|
|
928
|
-
listener.exitEqValue(this);
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
// @Override
|
|
932
841
|
accept(visitor) {
|
|
933
842
|
if (visitor.visitEqValue) {
|
|
934
843
|
return visitor.visitEqValue(this);
|
|
@@ -958,18 +867,6 @@ class ArrayElementContext extends ParserRuleContext_1.ParserRuleContext {
|
|
|
958
867
|
// @Override
|
|
959
868
|
get ruleIndex() { return MalloyTagParser.RULE_arrayElement; }
|
|
960
869
|
// @Override
|
|
961
|
-
enterRule(listener) {
|
|
962
|
-
if (listener.enterArrayElement) {
|
|
963
|
-
listener.enterArrayElement(this);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
// @Override
|
|
967
|
-
exitRule(listener) {
|
|
968
|
-
if (listener.exitArrayElement) {
|
|
969
|
-
listener.exitArrayElement(this);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
// @Override
|
|
973
870
|
accept(visitor) {
|
|
974
871
|
if (visitor.visitArrayElement) {
|
|
975
872
|
return visitor.visitArrayElement(this);
|
|
@@ -992,18 +889,6 @@ class ReferenceContext extends ParserRuleContext_1.ParserRuleContext {
|
|
|
992
889
|
// @Override
|
|
993
890
|
get ruleIndex() { return MalloyTagParser.RULE_reference; }
|
|
994
891
|
// @Override
|
|
995
|
-
enterRule(listener) {
|
|
996
|
-
if (listener.enterReference) {
|
|
997
|
-
listener.enterReference(this);
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
// @Override
|
|
1001
|
-
exitRule(listener) {
|
|
1002
|
-
if (listener.exitReference) {
|
|
1003
|
-
listener.exitReference(this);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
// @Override
|
|
1007
892
|
accept(visitor) {
|
|
1008
893
|
if (visitor.visitReference) {
|
|
1009
894
|
return visitor.visitReference(this);
|
|
@@ -1039,18 +924,6 @@ class ArrayValueContext extends ParserRuleContext_1.ParserRuleContext {
|
|
|
1039
924
|
// @Override
|
|
1040
925
|
get ruleIndex() { return MalloyTagParser.RULE_arrayValue; }
|
|
1041
926
|
// @Override
|
|
1042
|
-
enterRule(listener) {
|
|
1043
|
-
if (listener.enterArrayValue) {
|
|
1044
|
-
listener.enterArrayValue(this);
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
// @Override
|
|
1048
|
-
exitRule(listener) {
|
|
1049
|
-
if (listener.exitArrayValue) {
|
|
1050
|
-
listener.exitArrayValue(this);
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
// @Override
|
|
1054
927
|
accept(visitor) {
|
|
1055
928
|
if (visitor.visitArrayValue) {
|
|
1056
929
|
return visitor.visitArrayValue(this);
|
|
@@ -1079,18 +952,6 @@ class PropertiesContext extends ParserRuleContext_1.ParserRuleContext {
|
|
|
1079
952
|
// @Override
|
|
1080
953
|
get ruleIndex() { return MalloyTagParser.RULE_properties; }
|
|
1081
954
|
// @Override
|
|
1082
|
-
enterRule(listener) {
|
|
1083
|
-
if (listener.enterProperties) {
|
|
1084
|
-
listener.enterProperties(this);
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
// @Override
|
|
1088
|
-
exitRule(listener) {
|
|
1089
|
-
if (listener.exitProperties) {
|
|
1090
|
-
listener.exitProperties(this);
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
// @Override
|
|
1094
955
|
accept(visitor) {
|
|
1095
956
|
if (visitor.visitProperties) {
|
|
1096
957
|
return visitor.visitProperties(this);
|
package/dist/malloy.js
CHANGED
|
@@ -469,7 +469,10 @@ class PreparedQuery {
|
|
|
469
469
|
return new tags_1.Tags(this._query.annotation);
|
|
470
470
|
}
|
|
471
471
|
tagParse(spec) {
|
|
472
|
-
|
|
472
|
+
if (spec === undefined) {
|
|
473
|
+
const modelScope = tags_1.Tag.annotationToTag(this._modelDef.annotation);
|
|
474
|
+
spec = { scopes: [modelScope.tag] };
|
|
475
|
+
}
|
|
473
476
|
return tags_1.Tag.annotationToTag(this._query.annotation, spec);
|
|
474
477
|
}
|
|
475
478
|
getTaglines(prefix) {
|
|
@@ -719,7 +722,10 @@ class PreparedResult {
|
|
|
719
722
|
return new tags_1.Tags(this.inner.annotation);
|
|
720
723
|
}
|
|
721
724
|
tagParse(spec) {
|
|
722
|
-
|
|
725
|
+
if (spec === undefined) {
|
|
726
|
+
const modelScope = tags_1.Tag.annotationToTag(this.modelDef.annotation);
|
|
727
|
+
spec = { scopes: [modelScope.tag] };
|
|
728
|
+
}
|
|
723
729
|
return tags_1.Tag.annotationToTag(this.inner.annotation, spec);
|
|
724
730
|
}
|
|
725
731
|
getTaglines(prefix) {
|
package/dist/tags.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LogMessage } from './lang';
|
|
|
2
2
|
import { Annotation } from './model';
|
|
3
3
|
export declare type TagDict = Record<string, TagInterface>;
|
|
4
4
|
declare type TagValue = string | TagInterface[];
|
|
5
|
-
interface TagInterface {
|
|
5
|
+
export interface TagInterface {
|
|
6
6
|
eq?: TagValue;
|
|
7
7
|
properties?: TagDict;
|
|
8
8
|
}
|
|
@@ -55,10 +55,10 @@ export declare class Tag implements TagInterface {
|
|
|
55
55
|
private find;
|
|
56
56
|
tag(...at: string[]): Tag | undefined;
|
|
57
57
|
has(...at: string[]): boolean;
|
|
58
|
-
text(...at: string[]): string;
|
|
59
|
-
numeric(...at: string[]): number;
|
|
58
|
+
text(...at: string[]): string | undefined;
|
|
59
|
+
numeric(...at: string[]): number | undefined;
|
|
60
60
|
get dict(): Record<string, Tag>;
|
|
61
|
-
array(...at: string[]): Tag[];
|
|
61
|
+
array(...at: string[]): Tag[] | undefined;
|
|
62
62
|
getProperties(): TagDict;
|
|
63
63
|
clone(): Tag;
|
|
64
64
|
}
|
package/dist/tags.js
CHANGED
|
@@ -162,15 +162,16 @@ class Tag {
|
|
|
162
162
|
if (typeof str === 'string') {
|
|
163
163
|
return str;
|
|
164
164
|
}
|
|
165
|
-
return '';
|
|
166
165
|
}
|
|
167
166
|
numeric(...at) {
|
|
168
167
|
var _a;
|
|
169
168
|
const str = (_a = this.find(at)) === null || _a === void 0 ? void 0 : _a.eq;
|
|
170
169
|
if (typeof str === 'string') {
|
|
171
|
-
|
|
170
|
+
const num = Number.parseFloat(str);
|
|
171
|
+
if (!Number.isNaN(num)) {
|
|
172
|
+
return num;
|
|
173
|
+
}
|
|
172
174
|
}
|
|
173
|
-
return NaN;
|
|
174
175
|
}
|
|
175
176
|
get dict() {
|
|
176
177
|
const newDict = {};
|
|
@@ -185,7 +186,7 @@ class Tag {
|
|
|
185
186
|
var _a;
|
|
186
187
|
const array = (_a = this.find(at)) === null || _a === void 0 ? void 0 : _a.eq;
|
|
187
188
|
if (array === undefined || typeof array === 'string') {
|
|
188
|
-
return
|
|
189
|
+
return undefined;
|
|
189
190
|
}
|
|
190
191
|
return array.map(el => typeof el === 'string' ? new Tag({ eq: el }) : Tag.tagFrom(el));
|
|
191
192
|
}
|
|
@@ -382,7 +383,10 @@ function parsePath(buildOn, path) {
|
|
|
382
383
|
return [path[path.length - 1], writeInto];
|
|
383
384
|
}
|
|
384
385
|
function getString(ctx) {
|
|
385
|
-
|
|
386
|
+
if (ctx.SQ_STRING() || ctx.DQ_STRING()) {
|
|
387
|
+
return (0, parse_utils_1.parseString)(ctx.text, ctx.text[0]);
|
|
388
|
+
}
|
|
389
|
+
return ctx.text;
|
|
386
390
|
}
|
|
387
391
|
function parseTagline(source, extending, outerScope, sourceURL, onLine, atChar) {
|
|
388
392
|
if (source[0] === '#') {
|