tu6ge/valitron

achieve BNF

tu6ge opened this issue · 0 comments

tu6ge commented

/// # Register rules
///
/// **Feild support multiple formats:**
/// - `field1` used to matching struct field
/// - `0`,`1`.. used to matching tuple item or tuple struct field
/// - `[0]`,`[1]` used to matching array item
/// - `[foo]` used to matching struct variant, e.g. `enum Foo{ Color { r: u8, g: u8, b: u8 } }`
///
/// The above can also be combined:
/// - `field1.0`
/// - `0.color`
/// - `[12].1`
/// - `foo.1[color]`
/// - more combine
///
/// TODO add BNF