mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-31 07:21:04 +00:00
Upgrade regex-syntax
This fixes a bug where some regexes are not correctly printed as string literals.
This commit is contained in:
parent
b78b2aaaa1
commit
b12643d413
@ -22,7 +22,7 @@ docopt = "0.7"
|
|||||||
ena = "0.5"
|
ena = "0.5"
|
||||||
itertools = "0.5.9"
|
itertools = "0.5.9"
|
||||||
regex = "0.2.1"
|
regex = "0.2.1"
|
||||||
regex-syntax = "0.2"
|
regex-syntax = "0.4.0"
|
||||||
petgraph = "0.3.2"
|
petgraph = "0.3.2"
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
term = "0.4.5"
|
term = "0.4.5"
|
||||||
|
@ -360,7 +360,15 @@ impl NFA {
|
|||||||
self.push_edge(s0, Noop, target);
|
self.push_edge(s0, Noop, target);
|
||||||
}
|
}
|
||||||
Ok(s0)
|
Ok(s0)
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// FIXME: Figure out what these should do
|
||||||
|
Expr::AnyByte => panic!("Unsupported"),
|
||||||
|
Expr::AnyByteNoNL => panic!("Unsupported"),
|
||||||
|
Expr::WordBoundaryAscii => panic!("Unsupported"),
|
||||||
|
Expr::NotWordBoundaryAscii => panic!("Unsupported"),
|
||||||
|
Expr::ClassBytes(_) => panic!("Unsupported"),
|
||||||
|
Expr::LiteralBytes { .. } => panic!("Unsupported")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ pub type RegexError = Error;
|
|||||||
|
|
||||||
/// Convert a string literal into a parsed regular expression.
|
/// Convert a string literal into a parsed regular expression.
|
||||||
pub fn parse_literal(s: &str) -> Regex {
|
pub fn parse_literal(s: &str) -> Regex {
|
||||||
match parse_regex(®ex_syntax::quote(s)) {
|
match parse_regex(®ex_syntax::escape(s)) {
|
||||||
Ok(v) => v,
|
Ok(v) => v,
|
||||||
Err(_) => panic!("failed to parse literal regular expression")
|
Err(_) => panic!("failed to parse literal regular expression")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user