18
18
*/
19
19
20
20
/*
21
- * Copyright (c) 2017, Chris Fraire <
[email protected] >.
21
+ * Copyright (c) 2017
-2018 , Chris Fraire <
[email protected] >.
22
22
*/
23
23
24
24
/*
@@ -96,7 +96,9 @@ Real = ({Decimal_integer}? "." {Decimal_integer} |
96
96
/*
97
97
* Character_constant = Δ "'" Character "'"
98
98
*/
99
- Character_constant = \' [^\']+ \'
99
+ Character_constant = \' ([^\'\n\r] | {Special_character}) \'
100
+
101
+ Special_character = % ([A-Da-dFfHhLlNnQqRrSsT-Vt-v%\'\"\(\)\<\>] | "/" [0-9]+ "/")
100
102
101
103
/*
102
104
* SCOMMENT : single-line comment
@@ -166,7 +168,8 @@ Character_constant = \' [^\']+ \'
166
168
* Eiffel defines "Line_wrapping_part" as a sequence of characters
167
169
* consisting of the following, in order: % (percent character); zero or
168
170
* more blanks or tabs; New_line; zero or more blanks or tabs; % again. For
169
- * OpenGrok purposes, just recognizing LFs in STRING is good enough.
171
+ * OpenGrok purposes, just recognizing LFs in STRING is good enough; though
172
+ * see also the {Special_character} handling for STRING,VSTRING.
170
173
*/
171
174
}
172
175
@@ -178,6 +181,11 @@ Character_constant = \' [^\']+ \'
178
181
}
179
182
180
183
<STRING, VSTRING> {
184
+ {Special_character} {
185
+ h.chkLOC();
186
+ offer(yytext());
187
+ }
188
+
181
189
{WhspChar}*{EOL} {
182
190
onDisjointSpanChanged(null, yychar);
183
191
onEndOfLineMatched(yytext(), yychar);
@@ -188,7 +196,10 @@ Character_constant = \' [^\']+ \'
188
196
<YYINITIAL, SCOMMENT, STRING, VSTRING> {
189
197
{WhspChar}*{EOL} { onEndOfLineMatched(yytext(), yychar); }
190
198
\s { offer(yytext()); }
191
- [^] { h.chkLOC(); offer(yytext()); }
199
+ [^] {
200
+ h.chkLOC();
201
+ offer(yytext());
202
+ }
192
203
}
193
204
194
205
<SCOMMENT, STRING, VSTRING> {
0 commit comments