Comments don't screw with as much now\! (and work with semicolon infrencing\!)
This commit is contained in:
@@ -25,8 +25,10 @@ back_slash = "\\" ;
|
|||||||
line_break = "
|
line_break = "
|
||||||
+" ;
|
+" ;
|
||||||
actual_white = "( | )+" | line_break | line_break actual_white | "( | )+" actual_white ;
|
actual_white = "( | )+" | line_break | line_break actual_white | "( | )+" actual_white ;
|
||||||
WS = actual_white | WS comment WS | ;
|
# Why is WS comment necessary? The null case SHOULD handle it, I think. I'm just a tad worred......
|
||||||
SEMI = ";" | line_break ;
|
WS = actual_white | WS comment WS | WS comment | ;
|
||||||
|
# cpp_comment lets us do stuff like ending a statement with a cpp comment - c comments already work as they don't eat the return
|
||||||
|
SEMI = ";" | line_break | cpp_comment ;
|
||||||
#SEMI = ";" ;
|
#SEMI = ";" ;
|
||||||
|
|
||||||
if_comp = "__if_comp__" WS identifier WS if_comp_pred ;
|
if_comp = "__if_comp__" WS identifier WS if_comp_pred ;
|
||||||
@@ -112,7 +114,8 @@ alpha = "(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|
|
|||||||
numeric = "(0|1|2|3|4|5|6|7|8|9)+" ;
|
numeric = "(0|1|2|3|4|5|6|7|8|9)+" ;
|
||||||
string = triple_quoted_string | "\"(`|1|2|3|4|5|6|7|8|9|0|-|=| |q|w|e|r|t|y|u|i|o|p|[|]|\\|a|s|d|f|g|h|j|k|l|;|'|
|
string = triple_quoted_string | "\"(`|1|2|3|4|5|6|7|8|9|0|-|=| |q|w|e|r|t|y|u|i|o|p|[|]|\\|a|s|d|f|g|h|j|k|l|;|'|
|
||||||
|z|x|c|v|b|n|m|,|.|/|~|!|@|#|$|%|^|&|\*|\(|\)|_|\+|Q|W|E|R|T|Y|U|I|O|P|{|}|\||A|S|D|F|G|H|J|K|L|:|Z|X|C|V|B|N|M|<|>|\?| )*\"" ;
|
|z|x|c|v|b|n|m|,|.|/|~|!|@|#|$|%|^|&|\*|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*/)" ;
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
1337
|
1337
|
||||||
|
42
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
import io:*;
|
import io:*;
|
||||||
|
|
||||||
|int| main() {
|
|int| main() {
|
||||||
println(1337);
|
println(1337) /*how bout now*/
|
||||||
|
println(42) //or now
|
||||||
return 0;
|
return 0;
|
||||||
|
//hmm
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user