Skip to content

Commit 2af9bbf

Browse files
committed
Fix to fine-tune URI link for Erlang QATOM
1 parent 2b0f4fd commit 2af9bbf

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727
*/
2828

2929
package org.opensolaris.opengrok.analysis.erlang;
30-
import java.io.IOException;
31-
import java.io.Reader;
32-
import org.opensolaris.opengrok.analysis.JFlexTokenizer;
3330

31+
import org.opensolaris.opengrok.analysis.JFlexTokenizer;
3432
%%
3533
%public
3634
%class ErlangSymbolTokenizer

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@
2727
*/
2828

2929
package org.opensolaris.opengrok.analysis.erlang;
30+
3031
import org.opensolaris.opengrok.analysis.JFlexXrefSimple;
31-
import java.io.IOException;
32-
import java.io.Writer;
33-
import java.io.Reader;
32+
import org.opensolaris.opengrok.util.StringUtils;
3433
import org.opensolaris.opengrok.web.HtmlConsts;
3534
import org.opensolaris.opengrok.web.Util;
36-
3735
%%
3836
%public
3937
%class ErlangXref
@@ -157,7 +155,7 @@ File = [a-zA-Z]{FNameChar}* "." ([Ee][Rr][Ll] | [Hh][Rr][Ll] | [Aa][Pp][Pp] |
157155
[^] { writeUnicodeChar(yycharat(0)); }
158156
}
159157

160-
<STRING, COMMENT, STRING, QATOM> {
158+
<STRING, COMMENT, QATOM> {
161159
{FPath}
162160
{ out.write(Util.breadcrumbPath(urlPrefix+"path=",yytext(),'/'));}
163161

@@ -171,12 +169,20 @@ File = [a-zA-Z]{FNameChar}* "." ([Ee][Rr][Ll] | [Hh][Rr][Ll] | [Aa][Pp][Pp] |
171169
out.write(path);
172170
out.write("</a>");}
173171

174-
{BrowseableURI} {
175-
appendLink(yytext(), true);
176-
}
177-
178172
{FNameChar}+ "@" {FNameChar}+ "." {FNameChar}+
179173
{
180174
writeEMailAddress(yytext());
181175
}
182176
}
177+
178+
<STRING, COMMENT> {
179+
{BrowseableURI} {
180+
appendLink(yytext(), true);
181+
}
182+
}
183+
184+
<QATOM> {
185+
{BrowseableURI} {
186+
appendLink(yytext(), true, StringUtils.APOS_NO_BSESC);
187+
}
188+
}

test/org/opensolaris/opengrok/analysis/erlang/sample.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ flush() ->
5757
after 0 ->
5858
ok
5959
end.
60+
'http://example.com?a='

test/org/opensolaris/opengrok/analysis/erlang/sample_xref.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@
6565
<a class="l" name="57" href="#57">57</a> <b>after</b> <span class="n">0</span> -&gt;
6666
<a class="l" name="58" href="#58">58</a> <a href="/source/s?defs=ok" class="intelliWindow-symbol" data-definition-place="undefined-in-file">ok</a>
6767
<a class="l" name="59" href="#59">59</a> <b>end</b>.
68-
<a class="hl" name="60" href="#60">60</a></body>
68+
<a class="hl" name="60" href="#60">60</a><span class="s">&apos;<a href="http://example.com?a=">http://example.com?a=</a>&apos;</span>
69+
<a class="l" name="61" href="#61">61</a></body>
6970
</html>

0 commit comments

Comments
 (0)