increment = { "MoO" }
decrement = { "MOo" }
move_left = { "mOo" }
move_right = { "moO" }
increment_block = { increment+ }
decrement_block = { decrement+ }
cancelling_moves = { (move_left ~ move_right) | (move_right ~ move_left) }
other_command = {
"moo" | "mOO" | "Moo" | "MOO" | "OOO" | "MMM" | "OOM" | "oom"
}
command = {
increment | decrement | move_left | move_right | other_command
}
program_token = _{ cancelling_moves | increment_block | decrement_block | command | ANY }
program = _{ SOI ~ program_token* ~ EOI }