Skip to content

Commit efa7b0a

Browse files
committed
Fixes [BUG] Incorrect error in WeaponSet Weapon property #14
1 parent 8834ce1 commit efa7b0a

File tree

5 files changed

+32
-11
lines changed

5 files changed

+32
-11
lines changed

server/src/utils/antlr4ng/.antlr/MapIni.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

server/src/utils/antlr4ng/.antlr/MapIniParser.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201129,6 +201129,7 @@ public final Upgrade_valueContext upgrade_value() throws RecognitionException {
201129201129
@SuppressWarnings("CheckReturnValue")
201130201130
public static class Weapon_valueContext extends ParserRuleContext {
201131201131
public TerminalNode ID() { return getToken(MapIniParser.ID, 0); }
201132+
public TerminalNode None_value() { return getToken(MapIniParser.None_value, 0); }
201132201133
public Weapon_valueContext(ParserRuleContext parent, int invokingState) {
201133201134
super(parent, invokingState);
201134201135
}
@@ -201138,11 +201139,20 @@ public Weapon_valueContext(ParserRuleContext parent, int invokingState) {
201138201139
public final Weapon_valueContext weapon_value() throws RecognitionException {
201139201140
Weapon_valueContext _localctx = new Weapon_valueContext(_ctx, getState());
201140201141
enterRule(_localctx, 1380, RULE_weapon_value);
201142+
int _la;
201141201143
try {
201142201144
enterOuterAlt(_localctx, 1);
201143201145
{
201144201146
setState(43792);
201145-
match(ID);
201147+
_la = _input.LA(1);
201148+
if ( !(_la==None_value || _la==ID) ) {
201149+
_errHandler.recoverInline(this);
201150+
}
201151+
else {
201152+
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
201153+
_errHandler.reportMatch(this);
201154+
consume();
201155+
}
201146201156
}
201147201157
}
201148201158
catch (RecognitionException re) {
@@ -240147,7 +240157,7 @@ public final Distribution_formContext distribution_form() throws RecognitionExce
240147240157
"\u0000\u0000\u0000\u8000\uab0b\u8000\uab0c\u0001\u0000\u0000\u0000\u8000"+
240148240158
"\uab0c\u8000\uab0d\u0003\u0562\u02b1\u0000\u8000\uab0d\u0561\u0001\u0000"+
240149240159
"\u0000\u0000\u8000\uab0e\u8000\uab0f\u0007\u001a\u0000\u0000\u8000\uab0f"+
240150-
"\u0563\u0001\u0000\u0000\u0000\u8000\uab10\u8000\uab11\u0005\u0b6e\u0000"+
240160+
"\u0563\u0001\u0000\u0000\u0000\u8000\uab10\u8000\uab11\u0007\u001a\u0000"+
240151240161
"\u0000\u8000\uab11\u0565\u0001\u0000\u0000\u0000\u8000\uab12\u8000\uab1b"+
240152240162
"\u0005\u0b59\u0000\u0000\u8000\uab13\u8000\uab15\u0005\u0b70\u0000\u0000"+
240153240163
"\u8000\uab14\u8000\uab13\u0001\u0000\u0000\u0000\u8000\uab14\u8000\uab15"+

server/src/utils/antlr4ng/MapIni.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4287,7 +4287,7 @@ audioevent_value: (ID | None_value);
42874287
upgrade_property: 'Upgrade' ((WS? EQ WS?) | WS) upgrade_value;
42884288
upgrade_value: (ID | None_value);
42894289

4290-
weapon_value: ID;
4290+
weapon_value: ID | None_value;
42914291
turret_property: TURRET ((WS? EQ WS?) | WS) (None_value | ID | TURRET | ALT_TURRET);
42924292
alt_turret_property: ALT_TURRET ((WS? EQ WS?) | WS) (None_value | ID | TURRET | ALT_TURRET);
42934293
transitionKey_value: (None_value | ID | drawModule_conditionStateValue | 'TransitionFinishBeforeSwitch');

server/src/utils/antlr4ng/MapIni.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

server/src/utils/antlr4ng/MapIniParser.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187875,11 +187875,19 @@ export class MapIniParser extends antlr.Parser {
187875187875
public weapon_value(): Weapon_valueContext {
187876187876
let localContext = new Weapon_valueContext(this.context, this.state);
187877187877
this.enterRule(localContext, 1380, MapIniParser.RULE_weapon_value);
187878+
let _la: number;
187878187879
try {
187879187880
this.enterOuterAlt(localContext, 1);
187880187881
{
187881187882
this.state = 43792;
187882-
this.match(MapIniParser.ID);
187883+
_la = this.tokenStream.LA(1);
187884+
if(!(_la === 2896 || _la === 2926)) {
187885+
this.errorHandler.recoverInline(this);
187886+
}
187887+
else {
187888+
this.errorHandler.reportMatch(this);
187889+
this.consume();
187890+
}
187883187891
}
187884187892
}
187885187893
catch (re) {
@@ -211198,9 +211206,9 @@ export class MapIniParser extends antlr.Parser {
211198211206
0,43784,43787,1,0,0,0,43785,43787,5,2928,0,0,43786,43779,1,0,0,0,
211199211207
43786,43785,1,0,0,0,43787,43788,1,0,0,0,43788,43789,3,1378,689,0,
211200211208
43789,1377,1,0,0,0,43790,43791,7,26,0,0,43791,1379,1,0,0,0,43792,
211201-
43793,5,2926,0,0,43793,1381,1,0,0,0,43794,43803,5,2905,0,0,43795,
211202-
43797,5,2928,0,0,43796,43795,1,0,0,0,43796,43797,1,0,0,0,43797,43798,
211203-
1,0,0,0,43798,43800,5,2901,0,0,43799,43801,5,2928,0,0,43800,43799,
211209+
43793,7,26,0,0,43793,1381,1,0,0,0,43794,43803,5,2905,0,0,43795,43797,
211210+
5,2928,0,0,43796,43795,1,0,0,0,43796,43797,1,0,0,0,43797,43798,1,
211211+
0,0,0,43798,43800,5,2901,0,0,43799,43801,5,2928,0,0,43800,43799,
211204211212
1,0,0,0,43800,43801,1,0,0,0,43801,43804,1,0,0,0,43802,43804,5,2928,
211205211213
0,0,43803,43796,1,0,0,0,43803,43802,1,0,0,0,43804,43805,1,0,0,0,
211206211214
43805,43806,7,30,0,0,43806,1383,1,0,0,0,43807,43816,5,2906,0,0,43808,
@@ -249599,8 +249607,11 @@ export class Weapon_valueContext extends antlr.ParserRuleContext {
249599249607
public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
249600249608
super(parent, invokingState);
249601249609
}
249602-
public ID(): antlr.TerminalNode {
249603-
return this.getToken(MapIniParser.ID, 0)!;
249610+
public ID(): antlr.TerminalNode | null {
249611+
return this.getToken(MapIniParser.ID, 0);
249612+
}
249613+
public None_value(): antlr.TerminalNode | null {
249614+
return this.getToken(MapIniParser.None_value, 0);
249604249615
}
249605249616
public override get ruleIndex(): number {
249606249617
return MapIniParser.RULE_weapon_value;

0 commit comments

Comments
 (0)