Commit 63956e5
Merge #6248
6248: Textmate grammar: prevent early termination of raw strings with hash (closes #6042) r=matklad a=dustypomerleau
Problematic sample code from #6042:
```rust
#[derive(Debug, Clone, Logos)]
enum Quoted<'source> {
#[regex(r#"[^\\"']+"#)]
Text(&'source str),
#[token("\\")]
StartEscape,
#[token("\'", |_| Quote::Single)]
#[token("\"", |_| Quote::Double)]
End(Quote),
#[error]
Error,
}
```
Before fix:
<img width="400" alt="Screen Shot 2020-10-16 at 10 45 59" src="https://user-images.githubusercontent.com/6304651/96198390-6a726d00-0fa0-11eb-8428-e76b2866836b.png">
After fix:
<img width="400" alt="Screen Shot 2020-10-16 at 10 45 33" src="https://user-images.githubusercontent.com/6304651/96198408-7a8a4c80-0fa0-11eb-9104-ca708009fe63.png">
Co-authored-by: Dusty Pomerleau <[email protected]>1 file changed
+22
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
966 | 966 | | |
967 | 967 | | |
968 | 968 | | |
969 | | - | |
| 969 | + | |
970 | 970 | | |
971 | | - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
972 | 991 | | |
973 | 992 | | |
974 | 993 | | |
| |||
980 | 999 | | |
981 | 1000 | | |
982 | 1001 | | |
983 | | - | |
| 1002 | + | |
984 | 1003 | | |
985 | 1004 | | |
986 | 1005 | | |
| |||
0 commit comments