Skip to content

Commit a9fe86f

Browse files
committed
Remove unused COMMENT state from Fortran lexers
1 parent e498034 commit a9fe86f

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

src/org/opensolaris/opengrok/analysis/fortran/FortranSymbolTokenizer.lex

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
*/
2424

2525
package org.opensolaris.opengrok.analysis.fortran;
26-
import java.io.IOException;
27-
import java.io.Reader;
28-
import org.opensolaris.opengrok.analysis.JFlexTokenizer;
2926

27+
import org.opensolaris.opengrok.analysis.JFlexTokenizer;
3028
%%
3129
%public
3230
%class FortranSymbolTokenizer
@@ -41,7 +39,7 @@ super(in);
4139
%char
4240

4341
// (OK to exclude LSTRING state used in FortranXref.)
44-
%state STRING COMMENT SCOMMENT QSTRING
42+
%state STRING SCOMMENT QSTRING
4543

4644
%include Common.lexh
4745
%include Fortran.lexh
@@ -73,15 +71,11 @@ super(in);
7371
\' { yybegin(YYINITIAL); }
7472
}
7573

76-
<COMMENT> {
77-
"*/" { yybegin(YYINITIAL);}
78-
}
79-
8074
<SCOMMENT> {
8175
{WhiteSpace} {}
8276
{EOL} { yybegin(YYINITIAL);}
8377
}
8478

85-
<YYINITIAL, STRING, COMMENT, SCOMMENT, QSTRING> {
79+
<YYINITIAL, STRING, SCOMMENT, QSTRING> {
8680
[^] {}
8781
}

src/org/opensolaris/opengrok/analysis/fortran/FortranXref.lex

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ package org.opensolaris.opengrok.analysis.fortran;
3030
import org.opensolaris.opengrok.analysis.JFlexXrefSimple;
3131
import org.opensolaris.opengrok.web.HtmlConsts;
3232
import org.opensolaris.opengrok.web.Util;
33-
3433
%%
3534
%public
3635
%class FortranXref
@@ -49,7 +48,7 @@ import org.opensolaris.opengrok.web.Util;
4948

5049
File = [a-zA-Z]{FNameChar}* ".inc"
5150

52-
%state STRING COMMENT SCOMMENT QSTRING LCOMMENT
51+
%state STRING SCOMMENT QSTRING LCOMMENT
5352

5453
%include Common.lexh
5554
%include CommonURI.lexh
@@ -128,13 +127,6 @@ File = [a-zA-Z]{FNameChar}* ".inc"
128127
}
129128
}
130129

131-
<COMMENT> {
132-
"*/" {
133-
out.write(yytext());
134-
yypop();
135-
}
136-
}
137-
138130
<SCOMMENT> {
139131
{WhspChar}*{EOL} { yypop();
140132
startNewLine();}
@@ -150,15 +142,15 @@ File = [a-zA-Z]{FNameChar}* ".inc"
150142
}
151143

152144

153-
<YYINITIAL, STRING, COMMENT, SCOMMENT, QSTRING> {
145+
<YYINITIAL, STRING, SCOMMENT, QSTRING> {
154146
[&<>\'\"] { out.write(htmlize(yytext())); }
155147
{WhspChar}*{EOL} { startNewLine(); }
156148
{WhiteSpace} { out.write(yytext()); }
157149
[!-~] { out.write(yycharat(0)); }
158150
[^\n] { }
159151
}
160152

161-
<STRING, COMMENT, SCOMMENT, STRING, QSTRING> {
153+
<SCOMMENT, STRING, QSTRING> {
162154
{FPath}
163155
{ out.write(Util.breadcrumbPath(urlPrefix+"path=",yytext(),'/'));}
164156

0 commit comments

Comments
 (0)