Skip to content

Commit 172a431

Browse files
committed
fix #7
1 parent f6f1e9f commit 172a431

File tree

4 files changed

+39
-39
lines changed

4 files changed

+39
-39
lines changed
17 Bytes
Binary file not shown.

lua-preprocessor/pluginsrc/com/defold/extension/pipeline/antlr/LuaPreProc.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ options {
33
tokenVocab = LuaPreProcLexer;
44
}
55

6-
codefile: (preproc | line)+ EOF ;
6+
codefile: (preproc | line)* EOF ;
77

88
preproc : ifdef | elsedef | endif ;
99
param : PP_PARAM_RELEASE | PP_PARAM_DEBUG | PP_PARAM_HEADLESS ;

lua-preprocessor/pluginsrc/com/defold/extension/pipeline/antlr/LuaPreProcParser.java

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ public final CodefileContext codefile() throws RecognitionException {
130130
try {
131131
enterOuterAlt(_localctx, 1);
132132
{
133-
setState(16);
133+
setState(18);
134134
_errHandler.sync(this);
135135
_la = _input.LA(1);
136-
do {
136+
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PP_IFDEF) | (1L << PP_ELSE) | (1L << PP_ENDIF) | (1L << TEXT))) != 0)) {
137137
{
138138
setState(16);
139139
_errHandler.sync(this);
@@ -156,11 +156,11 @@ public final CodefileContext codefile() throws RecognitionException {
156156
throw new NoViableAltException(this);
157157
}
158158
}
159-
setState(18);
159+
setState(20);
160160
_errHandler.sync(this);
161161
_la = _input.LA(1);
162-
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PP_IFDEF) | (1L << PP_ELSE) | (1L << PP_ENDIF) | (1L << TEXT))) != 0) );
163-
setState(20);
162+
}
163+
setState(21);
164164
match(EOF);
165165
}
166166
}
@@ -203,27 +203,27 @@ public final PreprocContext preproc() throws RecognitionException {
203203
PreprocContext _localctx = new PreprocContext(_ctx, getState());
204204
enterRule(_localctx, 2, RULE_preproc);
205205
try {
206-
setState(25);
206+
setState(26);
207207
_errHandler.sync(this);
208208
switch (_input.LA(1)) {
209209
case PP_IFDEF:
210210
enterOuterAlt(_localctx, 1);
211211
{
212-
setState(22);
212+
setState(23);
213213
ifdef();
214214
}
215215
break;
216216
case PP_ELSE:
217217
enterOuterAlt(_localctx, 2);
218218
{
219-
setState(23);
219+
setState(24);
220220
elsedef();
221221
}
222222
break;
223223
case PP_ENDIF:
224224
enterOuterAlt(_localctx, 3);
225225
{
226-
setState(24);
226+
setState(25);
227227
endif();
228228
}
229229
break;
@@ -267,7 +267,7 @@ public final ParamContext param() throws RecognitionException {
267267
try {
268268
enterOuterAlt(_localctx, 1);
269269
{
270-
setState(27);
270+
setState(28);
271271
_la = _input.LA(1);
272272
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PP_PARAM_RELEASE) | (1L << PP_PARAM_DEBUG) | (1L << PP_PARAM_HEADLESS))) != 0)) ) {
273273
_errHandler.recoverInline(this);
@@ -316,11 +316,11 @@ public final IfdefContext ifdef() throws RecognitionException {
316316
try {
317317
enterOuterAlt(_localctx, 1);
318318
{
319-
setState(29);
320-
match(PP_IFDEF);
321319
setState(30);
322-
param();
320+
match(PP_IFDEF);
323321
setState(31);
322+
param();
323+
setState(32);
324324
match(PP_EOL);
325325
}
326326
}
@@ -358,9 +358,9 @@ public final ElsedefContext elsedef() throws RecognitionException {
358358
try {
359359
enterOuterAlt(_localctx, 1);
360360
{
361-
setState(33);
362-
match(PP_ELSE);
363361
setState(34);
362+
match(PP_ELSE);
363+
setState(35);
364364
match(PP_EOL);
365365
}
366366
}
@@ -399,14 +399,14 @@ public final EndifContext endif() throws RecognitionException {
399399
try {
400400
enterOuterAlt(_localctx, 1);
401401
{
402-
setState(36);
402+
setState(37);
403403
match(PP_ENDIF);
404-
setState(38);
404+
setState(39);
405405
_errHandler.sync(this);
406406
_la = _input.LA(1);
407407
if (_la==PP_EOL) {
408408
{
409-
setState(37);
409+
setState(38);
410410
match(PP_EOL);
411411
}
412412
}
@@ -449,20 +449,20 @@ public final LineContext line() throws RecognitionException {
449449
try {
450450
enterOuterAlt(_localctx, 1);
451451
{
452-
setState(40);
452+
setState(41);
453453
match(TEXT);
454-
setState(46);
454+
setState(47);
455455
_errHandler.sync(this);
456456
switch (_input.LA(1)) {
457457
case PP_EOL:
458458
{
459-
setState(41);
459+
setState(42);
460460
match(PP_EOL);
461461
}
462462
break;
463463
case EOL:
464464
{
465-
setState(42);
465+
setState(43);
466466
match(EOL);
467467
}
468468
break;
@@ -472,12 +472,12 @@ public final LineContext line() throws RecognitionException {
472472
case PP_ENDIF:
473473
case TEXT:
474474
{
475-
setState(44);
475+
setState(45);
476476
_errHandler.sync(this);
477477
switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
478478
case 1:
479479
{
480-
setState(43);
480+
setState(44);
481481
match(EOF);
482482
}
483483
break;
@@ -501,20 +501,20 @@ public final LineContext line() throws RecognitionException {
501501
}
502502

503503
public static final String _serializedATN =
504-
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\20\63\4\2\t\2\4\3"+
505-
"\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\3\2\3\2\6\2\23\n\2\r\2\16"+
506-
"\2\24\3\2\3\2\3\3\3\3\3\3\5\3\34\n\3\3\4\3\4\3\5\3\5\3\5\3\5\3\6\3\6\3"+
507-
"\6\3\7\3\7\5\7)\n\7\3\b\3\b\3\b\3\b\5\b/\n\b\5\b\61\n\b\3\b\2\2\t\2\4"+
508-
"\6\b\n\f\16\2\3\3\2\t\13\2\63\2\22\3\2\2\2\4\33\3\2\2\2\6\35\3\2\2\2\b"+
509-
"\37\3\2\2\2\n#\3\2\2\2\f&\3\2\2\2\16*\3\2\2\2\20\23\5\4\3\2\21\23\5\16"+
510-
"\b\2\22\20\3\2\2\2\22\21\3\2\2\2\23\24\3\2\2\2\24\22\3\2\2\2\24\25\3\2"+
511-
"\2\2\25\26\3\2\2\2\26\27\7\2\2\3\27\3\3\2\2\2\30\34\5\b\5\2\31\34\5\n"+
512-
"\6\2\32\34\5\f\7\2\33\30\3\2\2\2\33\31\3\2\2\2\33\32\3\2\2\2\34\5\3\2"+
513-
"\2\2\35\36\t\2\2\2\36\7\3\2\2\2\37 \7\6\2\2 !\5\6\4\2!\"\7\r\2\2\"\t\3"+
514-
"\2\2\2#$\7\7\2\2$%\7\r\2\2%\13\3\2\2\2&(\7\b\2\2\')\7\r\2\2(\'\3\2\2\2"+
515-
"()\3\2\2\2)\r\3\2\2\2*\60\7\17\2\2+\61\7\r\2\2,\61\7\20\2\2-/\7\2\2\3"+
516-
".-\3\2\2\2./\3\2\2\2/\61\3\2\2\2\60+\3\2\2\2\60,\3\2\2\2\60.\3\2\2\2\61"+
517-
"\17\3\2\2\2\b\22\24\33(.\60";
504+
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\20\64\4\2\t\2\4\3"+
505+
"\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\3\2\3\2\7\2\23\n\2\f\2\16"+
506+
"\2\26\13\2\3\2\3\2\3\3\3\3\3\3\5\3\35\n\3\3\4\3\4\3\5\3\5\3\5\3\5\3\6"+
507+
"\3\6\3\6\3\7\3\7\5\7*\n\7\3\b\3\b\3\b\3\b\5\b\60\n\b\5\b\62\n\b\3\b\2"+
508+
"\2\t\2\4\6\b\n\f\16\2\3\3\2\t\13\2\64\2\24\3\2\2\2\4\34\3\2\2\2\6\36\3"+
509+
"\2\2\2\b \3\2\2\2\n$\3\2\2\2\f\'\3\2\2\2\16+\3\2\2\2\20\23\5\4\3\2\21"+
510+
"\23\5\16\b\2\22\20\3\2\2\2\22\21\3\2\2\2\23\26\3\2\2\2\24\22\3\2\2\2\24"+
511+
"\25\3\2\2\2\25\27\3\2\2\2\26\24\3\2\2\2\27\30\7\2\2\3\30\3\3\2\2\2\31"+
512+
"\35\5\b\5\2\32\35\5\n\6\2\33\35\5\f\7\2\34\31\3\2\2\2\34\32\3\2\2\2\34"+
513+
"\33\3\2\2\2\35\5\3\2\2\2\36\37\t\2\2\2\37\7\3\2\2\2 !\7\6\2\2!\"\5\6\4"+
514+
"\2\"#\7\r\2\2#\t\3\2\2\2$%\7\7\2\2%&\7\r\2\2&\13\3\2\2\2\')\7\b\2\2(*"+
515+
"\7\r\2\2)(\3\2\2\2)*\3\2\2\2*\r\3\2\2\2+\61\7\17\2\2,\62\7\r\2\2-\62\7"+
516+
"\20\2\2.\60\7\2\2\3/.\3\2\2\2/\60\3\2\2\2\60\62\3\2\2\2\61,\3\2\2\2\61"+
517+
"-\3\2\2\2\61/\3\2\2\2\62\17\3\2\2\2\b\22\24\34)/\61";
518518
public static final ATN _ATN =
519519
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
520520
static {

main/empty.lua

Whitespace-only changes.

0 commit comments

Comments
 (0)