[][src]Function abnf_to_pest::escape_rulename

pub fn escape_rulename(x: &str) -> String

Escape the rule name to be a valid Rust identifier.

Replaces e.g. if with if_, and rule-name with rule_name. Also changes whitespace to whitespace_ because of https://github.com/pest-parser/pest/pull/374 Also changes Some and None to Some_ and None_, because it was such a pain to work around.