Skip to content

Commit

Permalink
(fix) allow - in reference [#84]
Browse files Browse the repository at this point in the history
Signed-off-by: Ning Sun <[email protected]>
  • Loading branch information
sunng87 committed Jul 4, 2016
1 parent 0fae391 commit 4392580
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl_rdp! {
path_char = _{ ["/"] }

identifier = @{ symbol_char ~ ( symbol_char | path_char )* }
reference = @{ identifier ~ (["["] ~ (string_literal|['0'..'9']+) ~ ["]"])* ~ reference* }
reference = @{ identifier ~ (["["] ~ (string_literal|['0'..'9']+) ~ ["]"])* ~ ["-"]* ~ reference* }
name = _{ subexpression | identifier }

param = { literal | reference | subexpression }
Expand Down Expand Up @@ -105,7 +105,8 @@ fn test_reference() {
"@abc",
"a[\"abc\"]",
"aBc[\"abc\"]",
"abc[0][\"nice\"]"];
"abc[0][\"nice\"]",
"some-name"];
for i in s.iter() {
let mut rdp = Rdp::new(StringInput::new(i));
assert!(rdp.reference());
Expand Down

0 comments on commit 4392580

Please sign in to comment.