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