Skip to content

Commit 0ef1317

Browse files
committed
Allow single-char identifiers per Lubos
... but still do not link "_" though it is a valid Erlang identifier.
1 parent 2af9bbf commit 0ef1317

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/org/opensolaris/opengrok/analysis/erlang/ErlangSymbolTokenizer.lex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ super(in);
5454

5555
{Identifier} {
5656
String id = yytext();
57-
if (id.length() > 1 && !Consts.kwd.contains(id)) {
57+
if (!id.equals("_") && !Consts.kwd.contains(id)) {
5858
setAttribs(id, yychar, yychar + yylength());
5959
return yystate();
6060
}

src/org/opensolaris/opengrok/analysis/erlang/ErlangXref.lex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ File = [a-zA-Z]{FNameChar}* "." ([Ee][Rr][Ll] | [Hh][Rr][Ll] | [Aa][Pp][Pp] |
7070

7171
{Identifier} {
7272
String id = yytext();
73-
// N.b. for historical reasons, ErlangXref does not link identifiers of
74-
// length=1
75-
if (id.length() > 1) {
73+
if (!id.equals("_")) {
7674
writeSymbol(id, Consts.kwd, yyline);
7775
} else {
7876
out.write(id);

0 commit comments

Comments
 (0)