ptal / oak

A typed parser generator embedded in Rust code for Parsing Expression Grammars
Apache License 2.0
142 stars 14 forks source link

Semantic actions (Rust code) #8

Closed ptal closed 9 years ago

ptal commented 10 years ago

my_rule = "match_me" { Ok(Expression(s)) }

ptal commented 9 years ago

The syntax has changed. We only accept function:

rule = [0-9]+ > to_integer

The idea of the > is to redirect the result of the parser to a function. It's like a reverse function call operator (instead of f(x) we write x>f).