Browse Source

[fix] `input` can start with `$`: `$input`

Stephan Fuchs 3 months ago
parent
commit
001f43c344

+ 1 - 1
qsrc2tw/README.md

@@ -8,4 +8,4 @@ Navigate to `.\tools\QSRC2TW` and run `npm i` there. Do this in the current fold
 
 If you change the grammar of the parser, you have to recompile it. If you change the lexer, you have to recompile the lexer and then the parser. The commands to do so are present in the respective files.
 
-You also need to recompile `QSPPARSER.js` by running `rpm run build` and update the version in `recources`.
+You also need to recompile `QSPPARSER.js` by running `npm run build` and update the version in `recources`.

File diff suppressed because it is too large
+ 0 - 0
qsrc2tw/tools/QSRC2TW/dist/QSPPARSER.js


File diff suppressed because it is too large
+ 0 - 0
qsrc2tw/tools/QSRC2TW/resources/QSPPARSER.js


+ 9 - 9
qsrc2tw/tools/QSRC2TW/src/antlr/qsrcLexer.g4

@@ -16,17 +16,17 @@ Done:
 	*P
 	PL
 	*PL
-TODO:	
+TODO:
 	ADDLIB
 	ADDOBJ
 	ADDQST
-	
+
 	ARRCOMP
 	ARRPOS
 	ARRSIZE
 	$BACKIMAGE
 	BCOLOR
-	
+
 	CMDCLEAR
 	CMDCLR
 	COPYARR
@@ -95,8 +95,8 @@ TODO:
 	$ONOBJSEL
 	OPENGAME
 	OPENQST
-	
-	
+
+
 	PLAY
 	QSPVER
 	RAND
@@ -130,7 +130,7 @@ TODO:
 	VIEW
 	WAIT
 	XGOTO
-	XGT 
+	XGT
  */
 
 lexer grammar qsrcLexer;
@@ -160,7 +160,7 @@ GOSUB: (G S) | (G O S U B);
 GOTO: (G T) | (G O T O);
 XGOTO: X GOTO;
 
-INPUT: I N P U T;
+INPUT: '$'? I N P U T;
 
 JUMP: J U M P;
 
@@ -265,7 +265,7 @@ EXCLAMATIONMARK: '!';
 CommentStart: '!!' -> pushMode (COMMENT);
 AttachedComment: '&' ' '* '!' -> pushMode(COMMENT);
 Multilinecomment: '!!' WHITESPACE? '{' .*? '}';
-	
+
 ARRAYBRACKOPEN: '[';
 ARRAYBRACKCLOSE: ']';
 BRACK_OPEN: '{' -> pushMode(MultiLine);
@@ -318,4 +318,4 @@ AnythingElseInMultiLine: .;
 
 mode COMMENT;
 COMMENNEWLINE: ('\r'? '\n' | '\r')+ -> type(NEWLINE), popMode;
-InComment: .;
+InComment: .;

Some files were not shown because too many files changed in this diff