mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 01:29:28 +00:00
allow comment lines inside array initializer value
This commit is contained in:
parent
a9f5dc036c
commit
e7b631b087
@ -102,6 +102,8 @@ class AstToSourceTextConverter(val output: (text: String) -> Unit, val program:
|
||||
DataType.ARRAY_W -> "word["
|
||||
DataType.ARRAY_F -> "float["
|
||||
DataType.ARRAY_BOOL -> "bool["
|
||||
DataType.ARRAY_UW_SPLIT -> "@split uword["
|
||||
DataType.ARRAY_W_SPLIT -> "@split word["
|
||||
else -> throw IllegalArgumentException("weird dt: $dt")
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
- fix array expression assignment bug from Mark in the discord.
|
||||
- fix double code gen with tryInplaceModifyWithRemovedRedundantCast() ? word birdX[j] += testbyte
|
||||
|
||||
...
|
||||
|
@ -1,13 +1,19 @@
|
||||
%import textio
|
||||
%zeropage basicsafe
|
||||
|
||||
main {
|
||||
|
||||
sub start() {
|
||||
word[4] birdX
|
||||
byte testbyte = 0
|
||||
ubyte j = 0
|
||||
repeat {
|
||||
birdX[j] += testbyte
|
||||
byte[] foo = [ 1, 2, ; this comment is ok
|
||||
|
||||
; but after this comment there's a syntax error
|
||||
|
||||
|
||||
3 ]
|
||||
|
||||
byte bb
|
||||
for bb in foo {
|
||||
txt.print_b(bb)
|
||||
txt.nl()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,9 +16,9 @@ grammar Prog8ANTLR;
|
||||
package prog8.parser;
|
||||
}
|
||||
|
||||
LINECOMMENT : ('\r'? '\n' | '\r') [ \t]* COMMENT -> channel(HIDDEN);
|
||||
EOL : ('\r'? '\n' | '\r' | '\n')+ ;
|
||||
LINECOMMENT : EOL [ \t]* COMMENT -> channel(HIDDEN);
|
||||
COMMENT : ';' ~[\r\n]* -> channel(HIDDEN) ;
|
||||
EOL : ('\r'? '\n' | '\r')+ ;
|
||||
|
||||
WS : [ \t] -> skip ;
|
||||
// WS2 : '\\' EOL -> skip;
|
||||
|
Loading…
Reference in New Issue
Block a user