person_struct_parser 1.1.0

Rust parser for person struct #parser #grammar #person_struct
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
alpha = { 'a'..'z' | 'A'..'Z' }
digit = { '0'..'9' }
non_digit = { !digit ~ . }
non_alpha = { !alpha ~ . }
all_characters_without_digits = { non_digit+ }
all_characters_without_alpha = { non_alpha+ }

name = {(all_characters_without_digits)+ ~ (alpha)+ ~ (all_characters_without_digits)+}
age = {(all_characters_without_alpha)+ ~ (digit)+ ~ (all_characters_without_alpha)+}
city = {(all_characters_without_digits)+ ~ (alpha)+ ~ .+}
zip = {.+ ~ (digit)+ ~ .+}

person = {name ~ age ~ city ~ zip}