• Operand
  • some 1 had 2.

gram:scope

> ./src/grammar/sample.pest

Lenses
(coming soon!)


anchor = {"."}
alpha = { 'a'..'z' | 'A'..'Z' }
num = { '0'..'9' }

ambiguous = { (alpha | num | anchor | "(" | ")" | "{" | "}" | "[" | "]" | sp)+ }

label = { alpha ~ (alpha | num)+ }
phrase = { label* }
space = { " "+ }
sp = { space }
radius = { "(" ~ phrase ~ ")" }
scope = { label | label? ~ anchor ~ radius } // | scope ~ anchor ~ radius }
node = { label | radius | scope }

expression = { scope | command | (label? ~ anchor ~ scope ~ sp? ~ command?) }

command = { scope ~ ">" ~ sp* ~ ambiguous }
assign = { label ~ sp* ~ "=" ~ sp* ~ node }

consequence = { command | assign }

// program = { SOI ~ EOI }