diff --git a/src/path/parser.rs b/src/path/parser.rs index bcecc2d7..77132118 100644 --- a/src/path/parser.rs +++ b/src/path/parser.rs @@ -52,7 +52,7 @@ fn postfix(i: &mut &str) -> ModalResult { } fn ident(i: &mut &str) -> ModalResult { - take_while(1.., ('a'..='z', 'A'..='Z', '0'..='9', '_', '-')) + take_while(1.., ('a'..='z', 'A'..='Z', '0'..='9', '_', '-', '/')) .map(ToOwned::to_owned) .context(StrContext::Label("identifier")) .context(StrContext::Expected(StrContextValue::Description( @@ -147,6 +147,22 @@ Expression { ], } +"#]] + ); + + let parsed: Expression = from_str("nested/slash.v").unwrap(); + assert_data_eq!( + parsed.to_debug(), + str![[r#" +Expression { + root: "nested/slash", + postfix: [ + Key( + "v", + ), + ], +} + "#]] ); }