@zenuml/core 4.10.2 → 4.10.3
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/cli/zenuml.mjs +357 -284
- package/dist/parser/index.cjs +2 -2
- package/dist/parser/index.mjs +837 -752
- package/dist/zenuml.esm.mjs +9948 -9943
- package/dist/zenuml.js +540 -540
- package/package.json +1 -1
package/dist/cli/zenuml.mjs
CHANGED
|
@@ -2081,7 +2081,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
2081
2081
|
|
|
2082
2082
|
|
|
2083
2083
|
prog() {
|
|
2084
|
-
let localctx = new ProgContext$
|
|
2084
|
+
let localctx = new ProgContext$2(this, this._ctx, this.state);
|
|
2085
2085
|
this.enterRule(localctx, 0, sequenceParser.RULE_prog);
|
|
2086
2086
|
var _la = 0; // Token type
|
|
2087
2087
|
try {
|
|
@@ -2161,7 +2161,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
2161
2161
|
|
|
2162
2162
|
|
|
2163
2163
|
title() {
|
|
2164
|
-
let localctx = new TitleContext
|
|
2164
|
+
let localctx = new TitleContext(this, this._ctx, this.state);
|
|
2165
2165
|
this.enterRule(localctx, 2, sequenceParser.RULE_title);
|
|
2166
2166
|
var _la = 0; // Token type
|
|
2167
2167
|
try {
|
|
@@ -2804,7 +2804,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
2804
2804
|
|
|
2805
2805
|
|
|
2806
2806
|
ret() {
|
|
2807
|
-
let localctx = new RetContext
|
|
2807
|
+
let localctx = new RetContext(this, this._ctx, this.state);
|
|
2808
2808
|
this.enterRule(localctx, 28, sequenceParser.RULE_ret);
|
|
2809
2809
|
var _la = 0; // Token type
|
|
2810
2810
|
try {
|
|
@@ -2885,7 +2885,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
2885
2885
|
|
|
2886
2886
|
|
|
2887
2887
|
returnAsyncMessage() {
|
|
2888
|
-
let localctx = new ReturnAsyncMessageContext$
|
|
2888
|
+
let localctx = new ReturnAsyncMessageContext$1(this, this._ctx, this.state);
|
|
2889
2889
|
this.enterRule(localctx, 30, sequenceParser.RULE_returnAsyncMessage);
|
|
2890
2890
|
var _la = 0; // Token type
|
|
2891
2891
|
try {
|
|
@@ -2993,7 +2993,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
2993
2993
|
|
|
2994
2994
|
|
|
2995
2995
|
stat() {
|
|
2996
|
-
let localctx = new StatContext$
|
|
2996
|
+
let localctx = new StatContext$2(this, this._ctx, this.state);
|
|
2997
2997
|
this.enterRule(localctx, 36, sequenceParser.RULE_stat);
|
|
2998
2998
|
var _la = 0; // Token type
|
|
2999
2999
|
try {
|
|
@@ -3313,7 +3313,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
3313
3313
|
|
|
3314
3314
|
|
|
3315
3315
|
creation() {
|
|
3316
|
-
let localctx = new CreationContext$
|
|
3316
|
+
let localctx = new CreationContext$5(this, this._ctx, this.state);
|
|
3317
3317
|
this.enterRule(localctx, 46, sequenceParser.RULE_creation);
|
|
3318
3318
|
try {
|
|
3319
3319
|
this.enterOuterAlt(localctx, 1);
|
|
@@ -3481,7 +3481,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
3481
3481
|
|
|
3482
3482
|
|
|
3483
3483
|
message() {
|
|
3484
|
-
let localctx = new MessageContext$
|
|
3484
|
+
let localctx = new MessageContext$5(this, this._ctx, this.state);
|
|
3485
3485
|
this.enterRule(localctx, 52, sequenceParser.RULE_message);
|
|
3486
3486
|
try {
|
|
3487
3487
|
this.enterOuterAlt(localctx, 1);
|
|
@@ -3822,7 +3822,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
3822
3822
|
|
|
3823
3823
|
|
|
3824
3824
|
asyncMessage() {
|
|
3825
|
-
let localctx = new AsyncMessageContext$
|
|
3825
|
+
let localctx = new AsyncMessageContext$1(this, this._ctx, this.state);
|
|
3826
3826
|
this.enterRule(localctx, 70, sequenceParser.RULE_asyncMessage);
|
|
3827
3827
|
var _la = 0; // Token type
|
|
3828
3828
|
try {
|
|
@@ -4080,7 +4080,7 @@ class sequenceParser extends antlr4.Parser {
|
|
|
4080
4080
|
|
|
4081
4081
|
|
|
4082
4082
|
parameters() {
|
|
4083
|
-
let localctx = new ParametersContext
|
|
4083
|
+
let localctx = new ParametersContext(this, this._ctx, this.state);
|
|
4084
4084
|
this.enterRule(localctx, 82, sequenceParser.RULE_parameters);
|
|
4085
4085
|
var _la = 0; // Token type
|
|
4086
4086
|
try {
|
|
@@ -5268,7 +5268,7 @@ sequenceParser.RULE_condition = 58;
|
|
|
5268
5268
|
sequenceParser.RULE_inExpr = 59;
|
|
5269
5269
|
sequenceParser.RULE_textExpr = 60;
|
|
5270
5270
|
|
|
5271
|
-
let ProgContext$
|
|
5271
|
+
let ProgContext$2 = class ProgContext extends antlr4.ParserRuleContext {
|
|
5272
5272
|
|
|
5273
5273
|
constructor(parser, parent, invokingState) {
|
|
5274
5274
|
if(parent===undefined) {
|
|
@@ -5287,7 +5287,7 @@ let ProgContext$3 = class ProgContext extends antlr4.ParserRuleContext {
|
|
|
5287
5287
|
};
|
|
5288
5288
|
|
|
5289
5289
|
title() {
|
|
5290
|
-
return this.getTypedRuleContext(TitleContext
|
|
5290
|
+
return this.getTypedRuleContext(TitleContext,0);
|
|
5291
5291
|
};
|
|
5292
5292
|
|
|
5293
5293
|
head() {
|
|
@@ -5315,7 +5315,7 @@ let ProgContext$3 = class ProgContext extends antlr4.ParserRuleContext {
|
|
|
5315
5315
|
|
|
5316
5316
|
|
|
5317
5317
|
|
|
5318
|
-
|
|
5318
|
+
class TitleContext extends antlr4.ParserRuleContext {
|
|
5319
5319
|
|
|
5320
5320
|
constructor(parser, parent, invokingState) {
|
|
5321
5321
|
if(parent===undefined) {
|
|
@@ -5354,7 +5354,7 @@ let TitleContext$1 = class TitleContext extends antlr4.ParserRuleContext {
|
|
|
5354
5354
|
}
|
|
5355
5355
|
|
|
5356
5356
|
|
|
5357
|
-
}
|
|
5357
|
+
}
|
|
5358
5358
|
|
|
5359
5359
|
|
|
5360
5360
|
|
|
@@ -5891,9 +5891,9 @@ class BlockContext extends antlr4.ParserRuleContext {
|
|
|
5891
5891
|
i = null;
|
|
5892
5892
|
}
|
|
5893
5893
|
if(i===null) {
|
|
5894
|
-
return this.getTypedRuleContexts(StatContext$
|
|
5894
|
+
return this.getTypedRuleContexts(StatContext$2);
|
|
5895
5895
|
} else {
|
|
5896
|
-
return this.getTypedRuleContext(StatContext$
|
|
5896
|
+
return this.getTypedRuleContext(StatContext$2,i);
|
|
5897
5897
|
}
|
|
5898
5898
|
};
|
|
5899
5899
|
|
|
@@ -5914,7 +5914,7 @@ class BlockContext extends antlr4.ParserRuleContext {
|
|
|
5914
5914
|
|
|
5915
5915
|
|
|
5916
5916
|
|
|
5917
|
-
|
|
5917
|
+
class RetContext extends antlr4.ParserRuleContext {
|
|
5918
5918
|
|
|
5919
5919
|
constructor(parser, parent, invokingState) {
|
|
5920
5920
|
if(parent===undefined) {
|
|
@@ -5945,7 +5945,7 @@ let RetContext$3 = class RetContext extends antlr4.ParserRuleContext {
|
|
|
5945
5945
|
};
|
|
5946
5946
|
|
|
5947
5947
|
asyncMessage() {
|
|
5948
|
-
return this.getTypedRuleContext(AsyncMessageContext$
|
|
5948
|
+
return this.getTypedRuleContext(AsyncMessageContext$1,0);
|
|
5949
5949
|
};
|
|
5950
5950
|
|
|
5951
5951
|
EVENT_END() {
|
|
@@ -5953,7 +5953,7 @@ let RetContext$3 = class RetContext extends antlr4.ParserRuleContext {
|
|
|
5953
5953
|
};
|
|
5954
5954
|
|
|
5955
5955
|
returnAsyncMessage() {
|
|
5956
|
-
return this.getTypedRuleContext(ReturnAsyncMessageContext$
|
|
5956
|
+
return this.getTypedRuleContext(ReturnAsyncMessageContext$1,0);
|
|
5957
5957
|
};
|
|
5958
5958
|
|
|
5959
5959
|
enterRule(listener) {
|
|
@@ -5969,11 +5969,11 @@ let RetContext$3 = class RetContext extends antlr4.ParserRuleContext {
|
|
|
5969
5969
|
}
|
|
5970
5970
|
|
|
5971
5971
|
|
|
5972
|
-
}
|
|
5972
|
+
}
|
|
5973
5973
|
|
|
5974
5974
|
|
|
5975
5975
|
|
|
5976
|
-
let ReturnAsyncMessageContext$
|
|
5976
|
+
let ReturnAsyncMessageContext$1 = class ReturnAsyncMessageContext extends antlr4.ParserRuleContext {
|
|
5977
5977
|
|
|
5978
5978
|
constructor(parser, parent, invokingState) {
|
|
5979
5979
|
if(parent===undefined) {
|
|
@@ -6094,7 +6094,7 @@ class DividerNoteContext extends antlr4.ParserRuleContext {
|
|
|
6094
6094
|
|
|
6095
6095
|
|
|
6096
6096
|
|
|
6097
|
-
let StatContext$
|
|
6097
|
+
let StatContext$2 = class StatContext extends antlr4.ParserRuleContext {
|
|
6098
6098
|
|
|
6099
6099
|
constructor(parser, parent, invokingState) {
|
|
6100
6100
|
if(parent===undefined) {
|
|
@@ -6137,15 +6137,15 @@ let StatContext$3 = class StatContext extends antlr4.ParserRuleContext {
|
|
|
6137
6137
|
};
|
|
6138
6138
|
|
|
6139
6139
|
creation() {
|
|
6140
|
-
return this.getTypedRuleContext(CreationContext$
|
|
6140
|
+
return this.getTypedRuleContext(CreationContext$5,0);
|
|
6141
6141
|
};
|
|
6142
6142
|
|
|
6143
6143
|
message() {
|
|
6144
|
-
return this.getTypedRuleContext(MessageContext$
|
|
6144
|
+
return this.getTypedRuleContext(MessageContext$5,0);
|
|
6145
6145
|
};
|
|
6146
6146
|
|
|
6147
6147
|
asyncMessage() {
|
|
6148
|
-
return this.getTypedRuleContext(AsyncMessageContext$
|
|
6148
|
+
return this.getTypedRuleContext(AsyncMessageContext$1,0);
|
|
6149
6149
|
};
|
|
6150
6150
|
|
|
6151
6151
|
EVENT_END() {
|
|
@@ -6153,7 +6153,7 @@ let StatContext$3 = class StatContext extends antlr4.ParserRuleContext {
|
|
|
6153
6153
|
};
|
|
6154
6154
|
|
|
6155
6155
|
ret() {
|
|
6156
|
-
return this.getTypedRuleContext(RetContext
|
|
6156
|
+
return this.getTypedRuleContext(RetContext,0);
|
|
6157
6157
|
};
|
|
6158
6158
|
|
|
6159
6159
|
divider() {
|
|
@@ -6361,7 +6361,7 @@ class SectionContext extends antlr4.ParserRuleContext {
|
|
|
6361
6361
|
|
|
6362
6362
|
|
|
6363
6363
|
|
|
6364
|
-
let CreationContext$
|
|
6364
|
+
let CreationContext$5 = class CreationContext extends antlr4.ParserRuleContext {
|
|
6365
6365
|
|
|
6366
6366
|
constructor(parser, parent, invokingState) {
|
|
6367
6367
|
if(parent===undefined) {
|
|
@@ -6509,7 +6509,7 @@ class CreationBodyContext extends antlr4.ParserRuleContext {
|
|
|
6509
6509
|
};
|
|
6510
6510
|
|
|
6511
6511
|
parameters() {
|
|
6512
|
-
return this.getTypedRuleContext(ParametersContext
|
|
6512
|
+
return this.getTypedRuleContext(ParametersContext,0);
|
|
6513
6513
|
};
|
|
6514
6514
|
|
|
6515
6515
|
enterRule(listener) {
|
|
@@ -6529,7 +6529,7 @@ class CreationBodyContext extends antlr4.ParserRuleContext {
|
|
|
6529
6529
|
|
|
6530
6530
|
|
|
6531
6531
|
|
|
6532
|
-
let MessageContext$
|
|
6532
|
+
let MessageContext$5 = class MessageContext extends antlr4.ParserRuleContext {
|
|
6533
6533
|
|
|
6534
6534
|
constructor(parser, parent, invokingState) {
|
|
6535
6535
|
if(parent===undefined) {
|
|
@@ -6856,7 +6856,7 @@ class InvocationContext extends antlr4.ParserRuleContext {
|
|
|
6856
6856
|
};
|
|
6857
6857
|
|
|
6858
6858
|
parameters() {
|
|
6859
|
-
return this.getTypedRuleContext(ParametersContext
|
|
6859
|
+
return this.getTypedRuleContext(ParametersContext,0);
|
|
6860
6860
|
};
|
|
6861
6861
|
|
|
6862
6862
|
enterRule(listener) {
|
|
@@ -6919,7 +6919,7 @@ class AssignmentContext extends antlr4.ParserRuleContext {
|
|
|
6919
6919
|
|
|
6920
6920
|
|
|
6921
6921
|
|
|
6922
|
-
let AsyncMessageContext$
|
|
6922
|
+
let AsyncMessageContext$1 = class AsyncMessageContext extends antlr4.ParserRuleContext {
|
|
6923
6923
|
|
|
6924
6924
|
constructor(parser, parent, invokingState) {
|
|
6925
6925
|
if(parent===undefined) {
|
|
@@ -7201,7 +7201,7 @@ class MethodNameContext extends antlr4.ParserRuleContext {
|
|
|
7201
7201
|
|
|
7202
7202
|
|
|
7203
7203
|
|
|
7204
|
-
|
|
7204
|
+
class ParametersContext extends antlr4.ParserRuleContext {
|
|
7205
7205
|
|
|
7206
7206
|
constructor(parser, parent, invokingState) {
|
|
7207
7207
|
if(parent===undefined) {
|
|
@@ -7251,7 +7251,7 @@ let ParametersContext$1 = class ParametersContext extends antlr4.ParserRuleConte
|
|
|
7251
7251
|
}
|
|
7252
7252
|
|
|
7253
7253
|
|
|
7254
|
-
}
|
|
7254
|
+
}
|
|
7255
7255
|
|
|
7256
7256
|
|
|
7257
7257
|
|
|
@@ -8189,7 +8189,7 @@ class CreationExprContext extends ExprContext {
|
|
|
8189
8189
|
}
|
|
8190
8190
|
|
|
8191
8191
|
creation() {
|
|
8192
|
-
return this.getTypedRuleContext(CreationContext$
|
|
8192
|
+
return this.getTypedRuleContext(CreationContext$5,0);
|
|
8193
8193
|
};
|
|
8194
8194
|
|
|
8195
8195
|
enterRule(listener) {
|
|
@@ -8880,8 +8880,8 @@ class TextExprContext extends antlr4.ParserRuleContext {
|
|
|
8880
8880
|
|
|
8881
8881
|
|
|
8882
8882
|
|
|
8883
|
-
sequenceParser.ProgContext = ProgContext$
|
|
8884
|
-
sequenceParser.TitleContext = TitleContext
|
|
8883
|
+
sequenceParser.ProgContext = ProgContext$2;
|
|
8884
|
+
sequenceParser.TitleContext = TitleContext;
|
|
8885
8885
|
sequenceParser.HeadContext = HeadContext;
|
|
8886
8886
|
sequenceParser.GroupContext = GroupContext$1;
|
|
8887
8887
|
sequenceParser.StarterExpContext = StarterExpContext;
|
|
@@ -8894,19 +8894,19 @@ sequenceParser.NameContext = NameContext;
|
|
|
8894
8894
|
sequenceParser.WidthContext = WidthContext;
|
|
8895
8895
|
sequenceParser.EmojiContext = EmojiContext;
|
|
8896
8896
|
sequenceParser.BlockContext = BlockContext;
|
|
8897
|
-
sequenceParser.RetContext = RetContext
|
|
8898
|
-
sequenceParser.ReturnAsyncMessageContext = ReturnAsyncMessageContext$
|
|
8897
|
+
sequenceParser.RetContext = RetContext;
|
|
8898
|
+
sequenceParser.ReturnAsyncMessageContext = ReturnAsyncMessageContext$1;
|
|
8899
8899
|
sequenceParser.DividerContext = DividerContext$1;
|
|
8900
8900
|
sequenceParser.DividerNoteContext = DividerNoteContext;
|
|
8901
|
-
sequenceParser.StatContext = StatContext$
|
|
8901
|
+
sequenceParser.StatContext = StatContext$2;
|
|
8902
8902
|
sequenceParser.ParContext = ParContext;
|
|
8903
8903
|
sequenceParser.OptContext = OptContext;
|
|
8904
8904
|
sequenceParser.CriticalContext = CriticalContext;
|
|
8905
8905
|
sequenceParser.SectionContext = SectionContext;
|
|
8906
|
-
sequenceParser.CreationContext = CreationContext$
|
|
8906
|
+
sequenceParser.CreationContext = CreationContext$5;
|
|
8907
8907
|
sequenceParser.RefContext = RefContext$1;
|
|
8908
8908
|
sequenceParser.CreationBodyContext = CreationBodyContext;
|
|
8909
|
-
sequenceParser.MessageContext = MessageContext$
|
|
8909
|
+
sequenceParser.MessageContext = MessageContext$5;
|
|
8910
8910
|
sequenceParser.MessageBodyContext = MessageBodyContext;
|
|
8911
8911
|
sequenceParser.FromToContext = FromToContext;
|
|
8912
8912
|
sequenceParser.FuncContext = FuncContext;
|
|
@@ -8915,13 +8915,13 @@ sequenceParser.ToContext = ToContext;
|
|
|
8915
8915
|
sequenceParser.SignatureContext = SignatureContext;
|
|
8916
8916
|
sequenceParser.InvocationContext = InvocationContext;
|
|
8917
8917
|
sequenceParser.AssignmentContext = AssignmentContext;
|
|
8918
|
-
sequenceParser.AsyncMessageContext = AsyncMessageContext$
|
|
8918
|
+
sequenceParser.AsyncMessageContext = AsyncMessageContext$1;
|
|
8919
8919
|
sequenceParser.ContentContext = ContentContext;
|
|
8920
8920
|
sequenceParser.ConstructContext = ConstructContext;
|
|
8921
8921
|
sequenceParser.TypeContext = TypeContext;
|
|
8922
8922
|
sequenceParser.AssigneeContext = AssigneeContext;
|
|
8923
8923
|
sequenceParser.MethodNameContext = MethodNameContext;
|
|
8924
|
-
sequenceParser.ParametersContext = ParametersContext
|
|
8924
|
+
sequenceParser.ParametersContext = ParametersContext;
|
|
8925
8925
|
sequenceParser.ParameterContext = ParameterContext;
|
|
8926
8926
|
sequenceParser.NamedParameterContext = NamedParameterContext;
|
|
8927
8927
|
sequenceParser.DeclarationContext = DeclarationContext;
|
|
@@ -9237,27 +9237,37 @@ ToCollector.getParticipants = function(context) {
|
|
|
9237
9237
|
return participants;
|
|
9238
9238
|
};
|
|
9239
9239
|
|
|
9240
|
+
function augment(ctxClass, methods) {
|
|
9241
|
+
const prototype = ctxClass.prototype;
|
|
9242
|
+
for (const key of Object.keys(methods)) {
|
|
9243
|
+
prototype[key] = methods[key];
|
|
9244
|
+
}
|
|
9245
|
+
}
|
|
9246
|
+
|
|
9240
9247
|
const seqParser$9 = sequenceParser;
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9248
|
+
augment(seqParser$9.TitleContext, {
|
|
9249
|
+
content() {
|
|
9250
|
+
if (this.children.length < 2) {
|
|
9251
|
+
return "";
|
|
9252
|
+
} else {
|
|
9253
|
+
return this.children[1].getText().trim();
|
|
9254
|
+
}
|
|
9247
9255
|
}
|
|
9248
|
-
};
|
|
9256
|
+
});
|
|
9249
9257
|
|
|
9250
9258
|
const seqParser$8 = sequenceParser;
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
}
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9259
|
+
augment(seqParser$8.CreationContext, {
|
|
9260
|
+
Body: seqParser$8.CreationContext.prototype.creationBody,
|
|
9261
|
+
isCurrent(cursor) {
|
|
9262
|
+
return isCurrent.bind(this)(cursor);
|
|
9263
|
+
}
|
|
9264
|
+
});
|
|
9265
|
+
augment(seqParser$8.MessageContext, {
|
|
9266
|
+
Body: seqParser$8.MessageContext.prototype.messageBody,
|
|
9267
|
+
isCurrent(cursor) {
|
|
9268
|
+
return isCurrent.bind(this)(cursor);
|
|
9269
|
+
}
|
|
9270
|
+
});
|
|
9261
9271
|
function isCurrent(cursor) {
|
|
9262
9272
|
try {
|
|
9263
9273
|
if (cursor === null || cursor === void 0) return false;
|
|
@@ -9270,39 +9280,43 @@ function isCurrent(cursor) {
|
|
|
9270
9280
|
}
|
|
9271
9281
|
|
|
9272
9282
|
const seqParser$7 = sequenceParser;
|
|
9273
|
-
const CreationContext$
|
|
9274
|
-
const MessageContext$
|
|
9275
|
-
const AsyncMessageContext
|
|
9276
|
-
const ReturnAsyncMessageContext
|
|
9283
|
+
const CreationContext$4 = seqParser$7.CreationContext;
|
|
9284
|
+
const MessageContext$4 = seqParser$7.MessageContext;
|
|
9285
|
+
const AsyncMessageContext = seqParser$7.AsyncMessageContext;
|
|
9286
|
+
const ReturnAsyncMessageContext = seqParser$7.ReturnAsyncMessageContext;
|
|
9277
9287
|
const RetMessageContext = seqParser$7.RetContext;
|
|
9278
|
-
CreationContext$
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9288
|
+
augment(CreationContext$4, {
|
|
9289
|
+
Assignee() {
|
|
9290
|
+
return this.creationBody()?.assignment()?.assignee()?.getFormattedText();
|
|
9291
|
+
},
|
|
9292
|
+
AssigneePosition() {
|
|
9293
|
+
const assignee = this.creationBody()?.assignment()?.assignee();
|
|
9294
|
+
if (!assignee) {
|
|
9295
|
+
return void 0;
|
|
9296
|
+
}
|
|
9297
|
+
return [assignee.start.start, assignee.stop.stop + 1];
|
|
9298
|
+
},
|
|
9299
|
+
Constructor() {
|
|
9300
|
+
return this.creationBody()?.construct()?.getFormattedText();
|
|
9301
|
+
},
|
|
9302
|
+
Owner() {
|
|
9303
|
+
if (!this.Constructor()) {
|
|
9304
|
+
return "Missing Constructor";
|
|
9305
|
+
}
|
|
9306
|
+
const assignee = this.Assignee();
|
|
9307
|
+
const type = this.Constructor();
|
|
9308
|
+
return assignee ? `${assignee}:${type}` : type;
|
|
9285
9309
|
}
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
CreationContext$6.prototype.Owner = function() {
|
|
9292
|
-
if (!this.Constructor()) {
|
|
9293
|
-
return "Missing Constructor";
|
|
9310
|
+
});
|
|
9311
|
+
augment(MessageContext$4, {
|
|
9312
|
+
To() {
|
|
9313
|
+
const toCtx = this.messageBody()?.fromTo()?.to();
|
|
9314
|
+
return toCtx?.name?.()?.getFormattedText() || toCtx?.getFormattedText();
|
|
9294
9315
|
}
|
|
9295
|
-
|
|
9296
|
-
const type = this.Constructor();
|
|
9297
|
-
return assignee ? `${assignee}:${type}` : type;
|
|
9298
|
-
};
|
|
9299
|
-
MessageContext$6.prototype.To = function() {
|
|
9300
|
-
const toCtx = this.messageBody()?.fromTo()?.to();
|
|
9301
|
-
return toCtx?.name?.()?.getFormattedText() || toCtx?.getFormattedText();
|
|
9302
|
-
};
|
|
9316
|
+
});
|
|
9303
9317
|
function getOwnerFromAncestor(ctx) {
|
|
9304
9318
|
while (ctx) {
|
|
9305
|
-
if (ctx instanceof CreationContext$
|
|
9319
|
+
if (ctx instanceof CreationContext$4 || ctx instanceof MessageContext$4) {
|
|
9306
9320
|
return ctx.Owner();
|
|
9307
9321
|
}
|
|
9308
9322
|
ctx = ctx.parentCtx;
|
|
@@ -9312,63 +9326,75 @@ function getOwnerFromAncestor(ctx) {
|
|
|
9312
9326
|
function ownerFromToOrAncestor() {
|
|
9313
9327
|
return this.To() || getOwnerFromAncestor(this.parentCtx);
|
|
9314
9328
|
}
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9329
|
+
augment(MessageContext$4, {
|
|
9330
|
+
Owner: ownerFromToOrAncestor
|
|
9331
|
+
});
|
|
9332
|
+
augment(AsyncMessageContext, {
|
|
9333
|
+
Owner: ownerFromToOrAncestor
|
|
9334
|
+
});
|
|
9335
|
+
augment(ReturnAsyncMessageContext, {
|
|
9336
|
+
Owner: ownerFromToOrAncestor
|
|
9337
|
+
});
|
|
9338
|
+
augment(RetMessageContext, {
|
|
9339
|
+
Owner: ownerFromToOrAncestor
|
|
9322
9340
|
});
|
|
9323
9341
|
function toFromDirectTo() {
|
|
9324
9342
|
const toCtx = this.to();
|
|
9325
9343
|
return toCtx?.name?.()?.getFormattedText() || toCtx?.getFormattedText();
|
|
9326
9344
|
}
|
|
9327
|
-
AsyncMessageContext
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9345
|
+
augment(AsyncMessageContext, {
|
|
9346
|
+
To: toFromDirectTo
|
|
9347
|
+
});
|
|
9348
|
+
augment(ReturnAsyncMessageContext, {
|
|
9349
|
+
To: toFromDirectTo
|
|
9350
|
+
});
|
|
9351
|
+
augment(RetMessageContext, {
|
|
9352
|
+
To() {
|
|
9353
|
+
return this.ReturnTo();
|
|
9354
|
+
}
|
|
9355
|
+
});
|
|
9332
9356
|
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
}
|
|
9357
|
+
augment(sequenceParser.ProgContext, {
|
|
9358
|
+
Starter() {
|
|
9359
|
+
return this.head()?.starterExp()?.starter()?.getFormattedText?.();
|
|
9360
|
+
}
|
|
9361
|
+
});
|
|
9337
9362
|
|
|
9338
9363
|
const seqParser$6 = sequenceParser;
|
|
9339
|
-
const RetContext$2 = seqParser$6.RetContext;
|
|
9340
9364
|
const ProgContext$1 = seqParser$6.ProgContext;
|
|
9341
|
-
const MessageContext$
|
|
9342
|
-
const CreationContext$
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9365
|
+
const MessageContext$3 = seqParser$6.MessageContext;
|
|
9366
|
+
const CreationContext$3 = seqParser$6.CreationContext;
|
|
9367
|
+
augment(seqParser$6.RetContext, {
|
|
9368
|
+
Signature() {
|
|
9369
|
+
return this.asyncMessage()?.content()?.getFormattedText() || this.returnAsyncMessage()?.content()?.getFormattedText() || this.expr()?.getFormattedText();
|
|
9370
|
+
},
|
|
9371
|
+
ReturnTo() {
|
|
9372
|
+
const asyncToCtx = this.asyncMessage()?.to() || this.returnAsyncMessage()?.to();
|
|
9373
|
+
const asyncTo = asyncToCtx?.name?.()?.getFormattedText() || asyncToCtx?.getFormattedText();
|
|
9374
|
+
if (asyncTo) {
|
|
9375
|
+
return asyncTo;
|
|
9376
|
+
}
|
|
9377
|
+
const stat = this.parentCtx;
|
|
9378
|
+
const block = stat.parentCtx;
|
|
9379
|
+
const blockParent = block.parentCtx;
|
|
9380
|
+
if (blockParent instanceof ProgContext$1) {
|
|
9381
|
+
return blockParent.Starter();
|
|
9382
|
+
} else {
|
|
9383
|
+
let ctx = blockParent;
|
|
9384
|
+
while (ctx && !(ctx instanceof MessageContext$3) && !(ctx instanceof CreationContext$3)) {
|
|
9385
|
+
if (ctx instanceof ProgContext$1) {
|
|
9386
|
+
return ctx.Starter();
|
|
9387
|
+
}
|
|
9388
|
+
ctx = ctx.parentCtx;
|
|
9362
9389
|
}
|
|
9363
|
-
ctx
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
return
|
|
9390
|
+
if (ctx instanceof MessageContext$3) {
|
|
9391
|
+
const messageCtx = ctx;
|
|
9392
|
+
return messageCtx.messageBody()?.fromTo()?.from()?.name?.()?.getFormattedText() || messageCtx.messageBody()?.fromTo()?.from()?.getFormattedText() || messageCtx.ClosestAncestorStat().Origin();
|
|
9393
|
+
}
|
|
9394
|
+
return ctx.ClosestAncestorStat().Origin();
|
|
9368
9395
|
}
|
|
9369
|
-
return ctx.ClosestAncestorStat().Origin();
|
|
9370
9396
|
}
|
|
9371
|
-
};
|
|
9397
|
+
});
|
|
9372
9398
|
|
|
9373
9399
|
const seqParser$5 = sequenceParser;
|
|
9374
9400
|
const RefContext = seqParser$5.RefContext;
|
|
@@ -9376,51 +9402,59 @@ function isSynthesizedName(name) {
|
|
|
9376
9402
|
if (!name || !name.start || !name.stop) return true;
|
|
9377
9403
|
return name.stop.tokenIndex < name.start.tokenIndex;
|
|
9378
9404
|
}
|
|
9379
|
-
RefContext
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9405
|
+
augment(RefContext, {
|
|
9406
|
+
Content() {
|
|
9407
|
+
const first = this.name()[0];
|
|
9408
|
+
return isSynthesizedName(first) ? void 0 : first;
|
|
9409
|
+
},
|
|
9410
|
+
Participants() {
|
|
9411
|
+
return this.name().slice(1) ?? [];
|
|
9412
|
+
}
|
|
9413
|
+
});
|
|
9386
9414
|
|
|
9387
|
-
const ParserRuleContext$2 = antlr4.ParserRuleContext;
|
|
9388
|
-
const StatContext$2 = sequenceParser.StatContext;
|
|
9389
9415
|
const ProgContext = sequenceParser.ProgContext;
|
|
9390
|
-
const MessageContext$
|
|
9391
|
-
const CreationContext$
|
|
9392
|
-
ParserRuleContext
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
if (receiver) {
|
|
9404
|
-
return receiver;
|
|
9416
|
+
const MessageContext$2 = sequenceParser.MessageContext;
|
|
9417
|
+
const CreationContext$2 = sequenceParser.CreationContext;
|
|
9418
|
+
augment(antlr4.ParserRuleContext, {
|
|
9419
|
+
Origin() {
|
|
9420
|
+
return this.ClosestAncestorStat()?.Origin();
|
|
9421
|
+
}
|
|
9422
|
+
});
|
|
9423
|
+
augment(sequenceParser.StatContext, {
|
|
9424
|
+
Origin() {
|
|
9425
|
+
let ctx = this.parentCtx;
|
|
9426
|
+
while (ctx) {
|
|
9427
|
+
if (ctx instanceof ProgContext) {
|
|
9428
|
+
return ctx.Starter();
|
|
9405
9429
|
}
|
|
9430
|
+
if (ctx instanceof MessageContext$2 || ctx instanceof CreationContext$2) {
|
|
9431
|
+
const receiver = ctx.Owner();
|
|
9432
|
+
if (receiver) {
|
|
9433
|
+
return receiver;
|
|
9434
|
+
}
|
|
9435
|
+
}
|
|
9436
|
+
ctx = ctx.parentCtx;
|
|
9406
9437
|
}
|
|
9407
|
-
|
|
9438
|
+
return void 0;
|
|
9408
9439
|
}
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
}
|
|
9440
|
+
});
|
|
9441
|
+
augment(ProgContext, {
|
|
9442
|
+
Origin() {
|
|
9443
|
+
return this.Starter();
|
|
9444
|
+
}
|
|
9445
|
+
});
|
|
9414
9446
|
|
|
9415
9447
|
const seqParser$4 = sequenceParser;
|
|
9416
9448
|
const DividerContext = seqParser$4.DividerContext;
|
|
9417
|
-
DividerContext
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9449
|
+
augment(DividerContext, {
|
|
9450
|
+
Note() {
|
|
9451
|
+
const formattedText = this.dividerNote()?.getFormattedText().trim();
|
|
9452
|
+
if (!formattedText.startsWith("==")) {
|
|
9453
|
+
throw new Error("Divider note must start with ==");
|
|
9454
|
+
}
|
|
9455
|
+
return formattedText?.replace(/^=+|=+$/g, "");
|
|
9421
9456
|
}
|
|
9422
|
-
|
|
9423
|
-
};
|
|
9457
|
+
});
|
|
9424
9458
|
|
|
9425
9459
|
function formatParameter(param) {
|
|
9426
9460
|
if (param.namedParameter?.()) {
|
|
@@ -9446,43 +9480,52 @@ function formatParameter(param) {
|
|
|
9446
9480
|
function formatParameters(params) {
|
|
9447
9481
|
return params.map(formatParameter).join(",");
|
|
9448
9482
|
}
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
const CreationContext$3 = sequenceParser.CreationContext;
|
|
9453
|
-
const RetContext$1 = sequenceParser.RetContext;
|
|
9454
|
-
const ReturnAsyncMessageContext$1 = sequenceParser.ReturnAsyncMessageContext;
|
|
9455
|
-
MessageContext$3.prototype.SignatureText = function() {
|
|
9456
|
-
return this.messageBody()?.func()?.signature()?.map((s) => s?.getFormattedText()).join(".") ?? "";
|
|
9457
|
-
};
|
|
9458
|
-
AsyncMessageContext$1.prototype.SignatureText = function() {
|
|
9459
|
-
return this.content()?.getFormattedText() ?? "";
|
|
9460
|
-
};
|
|
9461
|
-
CreationContext$3.prototype.ParametersText = function() {
|
|
9462
|
-
const params = this.creationBody().parameters();
|
|
9463
|
-
return params?.parameter()?.length > 0 ? formatParameters(params.parameter()) : "";
|
|
9464
|
-
};
|
|
9465
|
-
CreationContext$3.prototype.SignatureText = function() {
|
|
9466
|
-
const text = this.ParametersText() || "create";
|
|
9467
|
-
return `«${text}»`;
|
|
9468
|
-
};
|
|
9469
|
-
RetContext$1.prototype.SignatureText = function() {
|
|
9470
|
-
return this.asyncMessage()?.content()?.getFormattedText() ?? this.returnAsyncMessage()?.content()?.getFormattedText() ?? this.expr()?.getFormattedText() ?? "";
|
|
9471
|
-
};
|
|
9472
|
-
ReturnAsyncMessageContext$1.prototype.SignatureText = function() {
|
|
9473
|
-
return this.content()?.getFormattedText() ?? "";
|
|
9474
|
-
};
|
|
9475
|
-
ParametersContext.prototype.getFormattedText = function() {
|
|
9476
|
-
const params = this.parameter();
|
|
9477
|
-
if (!params || params.length === 0) {
|
|
9478
|
-
return "";
|
|
9483
|
+
augment(sequenceParser.MessageContext, {
|
|
9484
|
+
SignatureText() {
|
|
9485
|
+
return this.messageBody()?.func()?.signature()?.map((s) => s?.getFormattedText()).join(".") ?? "";
|
|
9479
9486
|
}
|
|
9480
|
-
|
|
9481
|
-
|
|
9487
|
+
});
|
|
9488
|
+
augment(sequenceParser.AsyncMessageContext, {
|
|
9489
|
+
SignatureText() {
|
|
9490
|
+
return this.content()?.getFormattedText() ?? "";
|
|
9491
|
+
}
|
|
9492
|
+
});
|
|
9493
|
+
augment(sequenceParser.CreationContext, {
|
|
9494
|
+
ParametersText() {
|
|
9495
|
+
const params = this.creationBody().parameters();
|
|
9496
|
+
return params?.parameter()?.length > 0 ? formatParameters(params.parameter()) : "";
|
|
9497
|
+
},
|
|
9498
|
+
SignatureText() {
|
|
9499
|
+
const text = this.ParametersText() || "create";
|
|
9500
|
+
return `«${text}»`;
|
|
9501
|
+
}
|
|
9502
|
+
});
|
|
9503
|
+
augment(sequenceParser.RetContext, {
|
|
9504
|
+
SignatureText() {
|
|
9505
|
+
return this.asyncMessage()?.content()?.getFormattedText() ?? this.returnAsyncMessage()?.content()?.getFormattedText() ?? this.expr()?.getFormattedText() ?? "";
|
|
9506
|
+
}
|
|
9507
|
+
});
|
|
9508
|
+
augment(
|
|
9509
|
+
sequenceParser.ReturnAsyncMessageContext,
|
|
9510
|
+
{
|
|
9511
|
+
SignatureText() {
|
|
9512
|
+
return this.content()?.getFormattedText() ?? "";
|
|
9513
|
+
}
|
|
9514
|
+
}
|
|
9515
|
+
);
|
|
9516
|
+
augment(sequenceParser.ParametersContext, {
|
|
9517
|
+
getFormattedText() {
|
|
9518
|
+
const params = this.parameter();
|
|
9519
|
+
if (!params || params.length === 0) {
|
|
9520
|
+
return "";
|
|
9521
|
+
}
|
|
9522
|
+
return formatParameters(params);
|
|
9523
|
+
}
|
|
9524
|
+
});
|
|
9482
9525
|
|
|
9483
9526
|
const seqParser$3 = sequenceParser;
|
|
9484
|
-
const MessageContext$
|
|
9485
|
-
const CreationContext$
|
|
9527
|
+
const MessageContext$1 = seqParser$3.MessageContext;
|
|
9528
|
+
const CreationContext$1 = seqParser$3.CreationContext;
|
|
9486
9529
|
class Assignment {
|
|
9487
9530
|
assignee;
|
|
9488
9531
|
type;
|
|
@@ -9518,95 +9561,118 @@ function extractAssignmentFromContext(assignmentContext) {
|
|
|
9518
9561
|
}
|
|
9519
9562
|
return void 0;
|
|
9520
9563
|
}
|
|
9521
|
-
MessageContext$
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9564
|
+
augment(MessageContext$1, {
|
|
9565
|
+
Assignment() {
|
|
9566
|
+
return extractAssignmentFromContext(this.messageBody().assignment());
|
|
9567
|
+
}
|
|
9568
|
+
});
|
|
9569
|
+
augment(CreationContext$1, {
|
|
9570
|
+
Assignment() {
|
|
9571
|
+
return extractAssignmentFromContext(this.creationBody()?.assignment());
|
|
9572
|
+
}
|
|
9573
|
+
});
|
|
9527
9574
|
|
|
9528
9575
|
const seqParser$2 = sequenceParser;
|
|
9529
|
-
const MessageContext
|
|
9530
|
-
const CreationContext
|
|
9576
|
+
const MessageContext = seqParser$2.MessageContext;
|
|
9577
|
+
const CreationContext = seqParser$2.CreationContext;
|
|
9531
9578
|
const IfBlockContext = seqParser$2.IfBlockContext;
|
|
9532
9579
|
const LoopContext = seqParser$2.LoopContext;
|
|
9533
|
-
MessageContext
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
}
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9580
|
+
augment(MessageContext, {
|
|
9581
|
+
Statements() {
|
|
9582
|
+
return this.braceBlock()?.block()?.stat() || [];
|
|
9583
|
+
}
|
|
9584
|
+
});
|
|
9585
|
+
augment(CreationContext, {
|
|
9586
|
+
Statements() {
|
|
9587
|
+
return this.braceBlock()?.block()?.stat() || [];
|
|
9588
|
+
}
|
|
9589
|
+
});
|
|
9590
|
+
augment(IfBlockContext, {
|
|
9591
|
+
Statements() {
|
|
9592
|
+
return this.braceBlock()?.block()?.stat() || [];
|
|
9593
|
+
}
|
|
9594
|
+
});
|
|
9595
|
+
augment(LoopContext, {
|
|
9596
|
+
Statements() {
|
|
9597
|
+
return this.braceBlock()?.block()?.stat() || [];
|
|
9598
|
+
}
|
|
9599
|
+
});
|
|
9545
9600
|
|
|
9546
9601
|
const seqParser$1 = sequenceParser;
|
|
9547
9602
|
const StatContext$1 = seqParser$1.StatContext;
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
if (this.parentCtx instanceof StatContext$1) {
|
|
9555
|
-
return this.ClosestAncestorStat()?.Origin();
|
|
9603
|
+
augment(seqParser$1.CreationContext, {
|
|
9604
|
+
From() {
|
|
9605
|
+
if (this.parentCtx instanceof StatContext$1) {
|
|
9606
|
+
return this.ClosestAncestorStat()?.Origin();
|
|
9607
|
+
}
|
|
9608
|
+
return void 0;
|
|
9556
9609
|
}
|
|
9557
|
-
|
|
9558
|
-
};
|
|
9610
|
+
});
|
|
9559
9611
|
function fromProvidedOrOrigin() {
|
|
9560
9612
|
return this.ProvidedFrom() || this.ClosestAncestorStat()?.Origin();
|
|
9561
9613
|
}
|
|
9562
|
-
MessageContext
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9614
|
+
augment(seqParser$1.MessageContext, {
|
|
9615
|
+
ProvidedFrom() {
|
|
9616
|
+
const fromCtx = this.messageBody()?.fromTo?.()?.from?.();
|
|
9617
|
+
return fromCtx?.name?.()?.getFormattedText?.() || fromCtx?.getFormattedText?.();
|
|
9618
|
+
},
|
|
9619
|
+
From: fromProvidedOrOrigin
|
|
9620
|
+
});
|
|
9567
9621
|
function providedFromDirectFrom() {
|
|
9568
9622
|
const fromCtx = this.from();
|
|
9569
9623
|
return fromCtx?.name?.()?.getFormattedText?.() || fromCtx?.getFormattedText?.();
|
|
9570
9624
|
}
|
|
9571
|
-
AsyncMessageContext
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9625
|
+
augment(seqParser$1.AsyncMessageContext, {
|
|
9626
|
+
ProvidedFrom: providedFromDirectFrom,
|
|
9627
|
+
From: fromProvidedOrOrigin
|
|
9628
|
+
});
|
|
9629
|
+
augment(
|
|
9630
|
+
seqParser$1.ReturnAsyncMessageContext,
|
|
9631
|
+
{
|
|
9632
|
+
ProvidedFrom: providedFromDirectFrom,
|
|
9633
|
+
From: fromProvidedOrOrigin
|
|
9634
|
+
}
|
|
9635
|
+
);
|
|
9636
|
+
augment(seqParser$1.RetContext, {
|
|
9637
|
+
From() {
|
|
9638
|
+
return this.asyncMessage()?.From?.() || this.returnAsyncMessage()?.From?.() || this.ClosestAncestorStat()?.Origin();
|
|
9639
|
+
}
|
|
9640
|
+
});
|
|
9578
9641
|
|
|
9579
9642
|
const seqParser = sequenceParser;
|
|
9580
9643
|
const StatContext = seqParser.StatContext;
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9644
|
+
augment(antlr4.ParserRuleContext, {
|
|
9645
|
+
ClosestAncestorStat() {
|
|
9646
|
+
if (this instanceof StatContext) {
|
|
9647
|
+
return this;
|
|
9648
|
+
}
|
|
9649
|
+
let current = this.parentCtx;
|
|
9650
|
+
while (current && !(current instanceof StatContext)) {
|
|
9651
|
+
current = current.parentCtx;
|
|
9652
|
+
}
|
|
9653
|
+
if (current instanceof StatContext) {
|
|
9654
|
+
return current;
|
|
9655
|
+
}
|
|
9656
|
+
return void 0;
|
|
9592
9657
|
}
|
|
9593
|
-
|
|
9594
|
-
};
|
|
9658
|
+
});
|
|
9595
9659
|
|
|
9596
|
-
antlr4.ParserRuleContext
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
let current = this.parentCtx;
|
|
9602
|
-
while (current) {
|
|
9603
|
-
if (!predicate || predicate(current)) {
|
|
9604
|
-
ancestors.push(current);
|
|
9660
|
+
augment(antlr4.ParserRuleContext, {
|
|
9661
|
+
getAncestors(predicate) {
|
|
9662
|
+
const ancestors = [];
|
|
9663
|
+
if (!predicate || predicate(this)) {
|
|
9664
|
+
ancestors.push(this);
|
|
9605
9665
|
}
|
|
9606
|
-
current =
|
|
9666
|
+
let current = this.parentCtx;
|
|
9667
|
+
while (current) {
|
|
9668
|
+
if (!predicate || predicate(current)) {
|
|
9669
|
+
ancestors.push(current);
|
|
9670
|
+
}
|
|
9671
|
+
current = current.parentCtx;
|
|
9672
|
+
}
|
|
9673
|
+
return ancestors;
|
|
9607
9674
|
}
|
|
9608
|
-
|
|
9609
|
-
};
|
|
9675
|
+
});
|
|
9610
9676
|
|
|
9611
9677
|
const formatText = (text) => text.replace(/[\n\r]/g, " ").replace(/\s+/g, " ").replace(/\s*([,;.])\s*/g, "$1").replace(/\s*(\()\s*|\s*(\))/g, "$1$2").replace(/\s+$/g, "").replace(/^"(.*)"$/, "$1");
|
|
9612
9678
|
|
|
@@ -9666,20 +9732,23 @@ function rootContext(code) {
|
|
|
9666
9732
|
parser.addErrorListener(new SeqErrorListener());
|
|
9667
9733
|
return parser.prog();
|
|
9668
9734
|
}
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
}
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9735
|
+
augment(antlr4.ParserRuleContext, {
|
|
9736
|
+
getFormattedText() {
|
|
9737
|
+
const code = this.parser.getTokenStream().getText(this.getSourceInterval());
|
|
9738
|
+
return formatText(code);
|
|
9739
|
+
},
|
|
9740
|
+
// Comment is where users have the most flexibility. The parser should make minimal assumptions about
|
|
9741
|
+
// the content and the style including change of line, indentation, etc.
|
|
9742
|
+
getComment() {
|
|
9743
|
+
let tokenIndex = this.start.tokenIndex;
|
|
9744
|
+
const channel = sequenceLexer.channelNames.indexOf("COMMENT_CHANNEL");
|
|
9745
|
+
if (this.constructor.name === "BraceBlockContext") {
|
|
9746
|
+
tokenIndex = this.stop.tokenIndex;
|
|
9747
|
+
}
|
|
9748
|
+
const hiddenTokensToLeft = this.parser.getTokenStream().getHiddenTokensToLeft(tokenIndex, channel);
|
|
9749
|
+
return hiddenTokensToLeft && hiddenTokensToLeft.map((t) => t.text.substring(2)).join("\n");
|
|
9750
|
+
}
|
|
9751
|
+
});
|
|
9683
9752
|
function parse(code) {
|
|
9684
9753
|
const listener = new CollectingErrorListener();
|
|
9685
9754
|
const chars = new antlr4.InputStream(code);
|
|
@@ -11180,7 +11249,8 @@ const SINGLE_BLOCK_FRAGMENT_KINDS = [
|
|
|
11180
11249
|
];
|
|
11181
11250
|
|
|
11182
11251
|
const blockOf = (ctx) => ctx?.braceBlock?.()?.block?.();
|
|
11183
|
-
const
|
|
11252
|
+
const conditionOf = (ctx) => ctx?.parExpr?.()?.condition?.();
|
|
11253
|
+
const conditionText = (ctx) => conditionOf(ctx)?.getFormattedText?.() || "";
|
|
11184
11254
|
function fragmentOf(stat) {
|
|
11185
11255
|
for (const kind of SINGLE_BLOCK_FRAGMENT_KINDS) {
|
|
11186
11256
|
const frag = stat[kind]?.();
|
|
@@ -11192,6 +11262,7 @@ function fragmentOf(stat) {
|
|
|
11192
11262
|
{
|
|
11193
11263
|
guardKeyword: kind === "loop" ? frag.WHILE?.()?.getText?.() : void 0,
|
|
11194
11264
|
condition: conditionText(frag),
|
|
11265
|
+
conditionContext: conditionOf(frag),
|
|
11195
11266
|
isLeading: true,
|
|
11196
11267
|
block: blockOf(frag)
|
|
11197
11268
|
}
|
|
@@ -11207,6 +11278,7 @@ function fragmentOf(stat) {
|
|
|
11207
11278
|
sections.push({
|
|
11208
11279
|
guardKeyword: "if",
|
|
11209
11280
|
condition: conditionText(ifBlock),
|
|
11281
|
+
conditionContext: conditionOf(ifBlock),
|
|
11210
11282
|
isLeading: true,
|
|
11211
11283
|
block: blockOf(ifBlock)
|
|
11212
11284
|
});
|
|
@@ -11215,6 +11287,7 @@ function fragmentOf(stat) {
|
|
|
11215
11287
|
sections.push({
|
|
11216
11288
|
guardKeyword: "else if",
|
|
11217
11289
|
condition: conditionText(elseIf),
|
|
11290
|
+
conditionContext: conditionOf(elseIf),
|
|
11218
11291
|
isLeading: false,
|
|
11219
11292
|
block: blockOf(elseIf)
|
|
11220
11293
|
});
|