ptal / oak

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

Attribute on rule to ignore the letter case. #25

Closed ptal closed 8 years ago

ptal commented 10 years ago
#[ignore_case]
rule = "primary"

PrimAry, PRIMARY or primary will match. This is useful for language such as SQL that ignores case.

ptal commented 8 years ago

This should not be an annotation. Actually we can provide a Stream type such that its method check_prefix doesn't take into account the case. Therefore, no change to the grammar required.