We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ec14f8 commit 96add38Copy full SHA for 96add38
examples/scripts/forEach.mcscript
@@ -1,6 +1,6 @@
1
#file: ./foreach
2
# basic loop
3
-forEach(var i = 0; i < 10; i++){
+forEach(var i = -5; i < 5; i++){
4
/say hey
5
}
6
lib/parser.js
@@ -695,6 +695,13 @@ function parse_atom() {
695
return tok;
696
697
698
+ if (tok.type == "op" && tok.value == "-") {
699
+ let num = input.next()
700
+ if(num.type != "num") {
701
+ unexpected()
702
+ }
703
+ tok = { type: "num", value: -num.value }
704
705
if (tok.type == "num" || tok.type == "str") return tok;
706
707
unexpected();
0 commit comments