Skip to content

Commit

Permalink
Fix incorrect highlighting of variable references in `replace_regex()…
Browse files Browse the repository at this point in the history
…` calls outside of interpolations
  • Loading branch information
laniakea64 committed Apr 7, 2024
1 parent a40cc97 commit a9ee95f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/just.vim
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ syn keyword justBuiltInFunction
syn match justUserDefinedError "\verror%(%(\s|\\\n)*\()@="

syn match justReplaceRegex '\vreplace_regex%(\s|\\\n)*\(@=' transparent contains=justBuiltInFunction nextgroup=justReplaceRegexCall
syn match justReplaceRegexInInterp '\vreplace_regex%(\s|\\\n)*\(@=' transparent contains=justBuiltInFunction nextgroup=justReplaceRegexCallInInterp
syn match justReplaceRegexInInterp '\vreplace_regex%(\s|\\\n)*\(@=' transparent contained contains=justBuiltInFunction nextgroup=justReplaceRegexCallInInterp

syn region justReplaceRegexCall
\ matchgroup=justReplaceRegexCall
Expand Down
1 change: 1 addition & 0 deletions tests/cases/recipes-with-extras.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

p1 <span class="Operator">:=</span> <span class="String">'test'</span>
p2 <span class="Operator">:=</span> <span class="Function">canonicalize</span>(<span class="String">'..'</span>)
pdirname <span class="Operator">:=</span> <span class="Function">replace_regex</span>(p2, <span class="String">'/([^/]*)$'</span>, <span class="String">'</span><span class="Constant">$1</span><span class="String">'</span>)
param <span class="Operator">:=</span> <span class="Function">semver_matches</span>(<span class="String">'0.1.1'</span>, <span class="String">'&gt;=0.1.0'</span>)

<span class="Special">@</span><span class="Function">foo1</span> <span class="Identifier">param1</span> <span class="Identifier">param2</span><span class="Operator">=</span><span class="String">"default test"</span> <span class="Statement">+</span><span class="Identifier">varparam</span><span class="Operator">=</span><span class="String">'default'</span><span class="Operator">:</span> <span class="Function">dependency1</span> <span class="Delimiter">(</span><span class="Function">dependency2</span> p1 p2<span class="Delimiter">)</span> <span class="Delimiter">(</span><span class="Function">dependency3</span> param<span class="Delimiter">)</span>
Expand Down
1 change: 1 addition & 0 deletions tests/cases/recipes-with-extras.just
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ foo: # comment

p1 := 'test'
p2 := canonicalize('..')
pdirname := replace_regex(p2, '/([^/]*)$', '$1')
param := semver_matches('0.1.1', '>=0.1.0')

@foo1 param1 param2="default test" +varparam='default': dependency1 (dependency2 p1 p2) (dependency3 param)
Expand Down

0 comments on commit a9ee95f

Please sign in to comment.