fix: broken regex (#1851)
This commit is contained in:
parent
17050afd04
commit
ac713a8588
|
@ -43,7 +43,7 @@ pub static RE_THREE_OR_MORE_NEWLINES: Lazy<Regex> = Lazy::new(|| Regex::new("\n{
|
||||||
|
|
||||||
/// Create a regex that matches any library or contract name inside a file
|
/// Create a regex that matches any library or contract name inside a file
|
||||||
pub fn create_contract_or_lib_name_regex(name: &str) -> Regex {
|
pub fn create_contract_or_lib_name_regex(name: &str) -> Regex {
|
||||||
Regex::new(&format!(r#"(?:using\s+(?P<n1>{name})\s+|is\s+(?:\w+\s*,\s*)*(?P<n2>{name})(?:\s*,\s*\w+)*|(?:(?P<ignore>(?:function|error|as)\s+|\n[^\n]*(?:"([^"\n]|\\")*|'([^'\n]|\\')*))|\W+)(?P<n3>{name})name.|\(| ))"#)).unwrap()
|
Regex::new(&format!(r#"(?:using\s+(?P<n1>{name})\s+|is\s+(?:\w+\s*,\s*)*(?P<n2>{name})(?:\s*,\s*\w+)*|(?:(?P<ignore>(?:function|error|as)\s+|\n[^\n]*(?:"([^"\n]|\\")*|'([^'\n]|\\')*))|\W+)(?P<n3>{name})(?:\.|\(| ))"#)).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Move a range by a specified offset
|
/// Move a range by a specified offset
|
||||||
|
|
Loading…
Reference in New Issue