File tree Expand file tree Collapse file tree 3 files changed +116
-2
lines changed Expand file tree Collapse file tree 3 files changed +116
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ Version 2.13.0
24
24
* Coq: add some common keywords, improve recognition of ``Set``
25
25
and qualified identifiers (#2158)
26
26
* F*: Allow C-style comments anywhere in a line
27
+ * Fortran: fix catastrophic backtracking with backslashes in strings
28
+ (#2194)
27
29
* Go: add support for generics (#2167)
28
30
* Inform: update for version 6.40 (#2190)
29
31
* Isabelle: recognize cartouches (#2089)
Original file line number Diff line number Diff line change @@ -157,8 +157,8 @@ class FortranLexer(RegexLexer):
157
157
],
158
158
159
159
'strings' : [
160
- (r'(?s)"(\\\\|\\ [0-7]+|\\. |[^"\\])*"' , String .Double ),
161
- (r"(?s)'(\\\\|\\ [0-7]+|\\. |[^'\\])*'" , String .Single ),
160
+ (r'(?s)"(\\[0-7]+|\\[^0-7\n] |[^"\\])*"' , String .Double ),
161
+ (r"(?s)'(\\[0-7]+|\\[^0-7\n] |[^'\\])*'" , String .Single ),
162
162
],
163
163
164
164
'nums' : [
Original file line number Diff line number Diff line change
1
+ ---input---
2
+ ! Bad string, there isn't an even number of backslashes.
3
+ ! This should not cause catastrophic backtracking.
4
+ '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
5
+
6
+ ---tokens---
7
+ "! Bad string, there isn't an even number of backslashes.\n" Comment
8
+
9
+ '! This should not cause catastrophic backtracking.\n' Comment
10
+
11
+ "'" Error
12
+ '\\' Error
13
+ '\\' Error
14
+ '\\' Error
15
+ '\\' Error
16
+ '\\' Error
17
+ '\\' Error
18
+ '\\' Error
19
+ '\\' Error
20
+ '\\' Error
21
+ '\\' Error
22
+ '\\' Error
23
+ '\\' Error
24
+ '\\' Error
25
+ '\\' Error
26
+ '\\' Error
27
+ '\\' Error
28
+ '\\' Error
29
+ '\\' Error
30
+ '\\' Error
31
+ '\\' Error
32
+ '\\' Error
33
+ '\\' Error
34
+ '\\' Error
35
+ '\\' Error
36
+ '\\' Error
37
+ '\\' Error
38
+ '\\' Error
39
+ '\\' Error
40
+ '\\' Error
41
+ '\\' Error
42
+ '\\' Error
43
+ '\\' Error
44
+ '\\' Error
45
+ '\\' Error
46
+ '\\' Error
47
+ '\\' Error
48
+ '\\' Error
49
+ '\\' Error
50
+ '\\' Error
51
+ '\\' Error
52
+ '\\' Error
53
+ '\\' Error
54
+ '\\' Error
55
+ '\\' Error
56
+ '\\' Error
57
+ '\\' Error
58
+ '\\' Error
59
+ '\\' Error
60
+ '\\' Error
61
+ '\\' Error
62
+ '\\' Error
63
+ '\\' Error
64
+ '\\' Error
65
+ '\\' Error
66
+ '\\' Error
67
+ '\\' Error
68
+ '\\' Error
69
+ '\\' Error
70
+ '\\' Error
71
+ '\\' Error
72
+ '\\' Error
73
+ '\\' Error
74
+ '\\' Error
75
+ '\\' Error
76
+ '\\' Error
77
+ '\\' Error
78
+ '\\' Error
79
+ '\\' Error
80
+ '\\' Error
81
+ '\\' Error
82
+ '\\' Error
83
+ '\\' Error
84
+ '\\' Error
85
+ '\\' Error
86
+ '\\' Error
87
+ '\\' Error
88
+ '\\' Error
89
+ '\\' Error
90
+ '\\' Error
91
+ '\\' Error
92
+ '\\' Error
93
+ '\\' Error
94
+ '\\' Error
95
+ '\\' Error
96
+ '\\' Error
97
+ '\\' Error
98
+ '\\' Error
99
+ '\\' Error
100
+ '\\' Error
101
+ '\\' Error
102
+ '\\' Error
103
+ '\\' Error
104
+ '\\' Error
105
+ '\\' Error
106
+ '\\' Error
107
+ '\\' Error
108
+ '\\' Error
109
+ '\\' Error
110
+ '\\' Error
111
+ "'" Error
112
+ '\n' Text.Whitespace
You can’t perform that action at this time.
0 commit comments