mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-16 17:00:53 +00:00
fix escape test
This commit is contained in:
parent
d5b2603bcb
commit
0ec6824eeb
@ -198,7 +198,7 @@ impl<'input> Tokenizer<'input> {
|
||||
Some(idx1) => {
|
||||
self.bump(); // consume the '`'
|
||||
let text: &'input str = &self.text[idx0+1..idx1]; // do not include the `` in the str
|
||||
Ok((idx0, Escape(text), idx1))
|
||||
Ok((idx0, Escape(text), idx1+1))
|
||||
}
|
||||
None => {
|
||||
Err(UnterminatedEscape(idx0))
|
||||
|
@ -66,16 +66,18 @@ fn code_forgot_comma() {
|
||||
|
||||
#[test]
|
||||
fn various_kinds_of_ids() {
|
||||
test("foo<T<'a,U>>", vec![
|
||||
("~~~ ", MacroId("foo")),
|
||||
(" ~ ", LessThan),
|
||||
(" ~ ", MacroId("T")),
|
||||
(" ~ ", LessThan),
|
||||
(" ~~ ", Lifetime("'a")),
|
||||
(" ~ ", Comma),
|
||||
(" ~ ", Id("U")),
|
||||
(" ~ ", GreaterThan),
|
||||
(" ~", GreaterThan),
|
||||
test("foo<T<'a,U,`Z*{}`>>", vec![
|
||||
("~~~ ", MacroId("foo")),
|
||||
(" ~ ", LessThan),
|
||||
(" ~ ", MacroId("T")),
|
||||
(" ~ ", LessThan),
|
||||
(" ~~ ", Lifetime("'a")),
|
||||
(" ~ ", Comma),
|
||||
(" ~ ", Id("U")),
|
||||
(" ~ ", Comma),
|
||||
(" ~~~~~~ ", Escape("Z*{}")),
|
||||
(" ~ ", GreaterThan),
|
||||
(" ~", GreaterThan),
|
||||
]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user