|
|
@ -1,6 +1,3 @@ |
|
|
|
operator = @{ "operator" } // TODO |
|
|
|
|
|
|
|
operand = @{ "operand" } // TODO |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wordSeperator =_{ " " | "-" | "_" } |
|
|
|
wordSeperator =_{ " " | "-" | "_" } |
|
|
|
variable =@{ ASCII_ALPHA |
|
|
|
variable =@{ ASCII_ALPHA |
|
|
|
~ (ASCII_ALPHANUMERIC | wordSeperator)* |
|
|
|
~ (ASCII_ALPHANUMERIC | wordSeperator)* |
|
|
@ -16,21 +13,21 @@ path = { "\"" ~ (!"\"" ~ ANY)+ ~ "\"" } |
|
|
|
|
|
|
|
|
|
|
|
include =@{ "#include" ~ spacing+ ~ path } |
|
|
|
include =@{ "#include" ~ spacing+ ~ path } |
|
|
|
|
|
|
|
|
|
|
|
var =@{ "var" ~ spacing+ ~ variable } |
|
|
|
var =@{ "var" ~ spacing+ ~ variable } |
|
|
|
delvar =@{ "delvar" ~ spacing+ ~ variable } |
|
|
|
delvar =@{ "delvar" ~ spacing+ ~ variable } |
|
|
|
|
|
|
|
|
|
|
|
point =@{ "point" ~ spacing+ ~ variable } |
|
|
|
point =@{ "point" ~ spacing+ ~ variable } |
|
|
|
pointm =@{ "pointm" ~ spacing+ ~ variable } |
|
|
|
pointm =@{ "pointm" ~ spacing+ ~ variable } |
|
|
|
|
|
|
|
|
|
|
|
add =@{ "add" ~ spacing+ ~ constant } |
|
|
|
add =@{ "add" ~ spacing+ ~ constant } |
|
|
|
addb =@{ "addb" ~ spacing+ ~ constant } |
|
|
|
addb =@{ "addb" ~ spacing+ ~ constant } |
|
|
|
addv =@{ "addv" ~ spacing+ ~ variable } |
|
|
|
addv =@{ "addv" ~ spacing+ ~ variable } |
|
|
|
|
|
|
|
|
|
|
|
sub =@{ "sub" ~ spacing+ ~ constant } |
|
|
|
sub =@{ "sub" ~ spacing+ ~ constant } |
|
|
|
subb =@{ "subb" ~ spacing+ ~ constant } |
|
|
|
subb =@{ "subb" ~ spacing+ ~ constant } |
|
|
|
subv =@{ "subv" ~ spacing+ ~ variable } |
|
|
|
subv =@{ "subv" ~ spacing+ ~ variable } |
|
|
|
|
|
|
|
|
|
|
|
copy =@{ "copy" ~ spacing+ ~ variable } |
|
|
|
copy =@{ "copy" ~ spacing+ ~ variable } |
|
|
|
setz =@{ "setz" } |
|
|
|
setz =@{ "setz" } |
|
|
|
|
|
|
|
|
|
|
|
getchr =@{ "getchr" } |
|
|
|
getchr =@{ "getchr" } |
|
|
@ -58,8 +55,6 @@ instruction =_{ macaroo |
|
|
|
|
|
|
|
|
|
|
|
| getchr |
|
|
|
| getchr |
|
|
|
| print |
|
|
|
| print |
|
|
|
|
|
|
|
|
|
|
|
| operator ~ (spacing+ ~ operand)? |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loopBlockStart = { "[" ~ NEWLINE } |
|
|
|
loopBlockStart = { "[" ~ NEWLINE } |
|
|
@ -69,13 +64,13 @@ loopBlock = { loopBlockStart |
|
|
|
~ spacing* ~ loopBlockEnd |
|
|
|
~ spacing* ~ loopBlockEnd |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
statement = _{ spacing* |
|
|
|
statement =_{ spacing* |
|
|
|
~ (instruction | loopBlock) |
|
|
|
~ (instruction | loopBlock) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
statements = _{ (statement | NEWLINE)* } |
|
|
|
statements =_{ (statement | NEWLINE)* } |
|
|
|
|
|
|
|
|
|
|
|
spacing = _{ " " | "\t" } |
|
|
|
spacing =_{ " " | "\t" } |
|
|
|
COMMENT = _{ ";;" ~ (!NEWLINE ~ ANY)* ~ NEWLINE} |
|
|
|
COMMENT =_{ ";;" ~ (!NEWLINE ~ ANY)* ~ NEWLINE } |
|
|
|
|
|
|
|
|
|
|
|
file = {SOI ~ (statement ~ NEWLINE+)* ~ EOI} |
|
|
|
file = { SOI ~ (statement ~ NEWLINE+)* ~ EOI } |
|
|
|