Skip to content

Commit 82e9390

Browse files
committed
Update Unary_op_req_lookahead to include '+' operators
1 parent 38958e6 commit 82e9390

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/org/opensolaris/opengrok/analysis/sh/Sh.lexh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Identifier = [a-zA-Z_] [a-zA-Z0-9_]*
2727
Number = \$? [0-9]+\.[0-9]+| [0-9][0-9]* | [0][xX] [0-9a-fA-F]+
2828

2929
/*
30-
* Rather than enumerate letters, just treat all hyphen-single-char as a
31-
* unary op. "req_lookahead" because an assertion is needed that it is followed
32-
* by non-word or end-of-line.
30+
* Rather than enumerate letters, just treat all hyphen- or plus- with a
31+
* single-char as a unary op. "req_lookahead" because an assertion is needed
32+
* that it is followed by non-word or end-of-line.
3333
*/
34-
Unary_op_req_lookahead = [\-]{Unary_op_char}
34+
Unary_op_req_lookahead = [\-\+]{Unary_op_char}
3535
Unary_op_char = [A-Za-z]
3636

3737
Binary_op = [\-]("ef"|"nt"|"ot"|"eq"|"ge"|"gt"|"le"|"lt"|"ne"){WhspChar}

test/org/opensolaris/opengrok/analysis/sh/sample.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,4 @@ exit 0
268268
typeset -i vint
269269
vint=0xFFEF
270270
echo 'http://example.com'
271+
typeset +l -i vint2

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,5 +276,6 @@
276276
<a class="l" name="268" href="#268">268</a><b>typeset</b> -i <a href="/source/s?defs=vint" class="intelliWindow-symbol" data-definition-place="undefined-in-file">vint</a>
277277
<a class="l" name="269" href="#269">269</a><a href="/source/s?defs=vint" class="intelliWindow-symbol" data-definition-place="undefined-in-file">vint</a>=<span class="n">0xFFEF</span>
278278
<a class="hl" name="270" href="#270">270</a><b>echo</b> <span class="s">&apos;<a href="http://example.com">http://example.com</a>&apos;</span>
279-
<a class="l" name="271" href="#271">271</a></body>
279+
<a class="l" name="271" href="#271">271</a><b>typeset</b> +l -i <a href="/source/s?defs=vint2" class="intelliWindow-symbol" data-definition-place="undefined-in-file">vint2</a>
280+
<a class="l" name="272" href="#272">272</a></body>
280281
</html>

test/org/opensolaris/opengrok/analysis/sh/samplesymbols.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,4 @@ dev
209209
null
210210
vint
211211
vint
212+
vint2

0 commit comments

Comments
 (0)