Skip to content

Commit

Permalink
fix: raw shell-expanded strings default values don't do line continua…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
laniakea64 committed Jun 22, 2024
1 parent 613049a commit c771fb5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion syntax/just.vim
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ syn region justConditionalBraces start="\v\{\{@!" end="\v\}@=" transparent conta
syn region justConditionalBracesInInterp start="\v\{\{@!" end="\v\}@=" transparent contained contains=@justExprInInterp

syn match justLineLeadingSymbol "\v^%(\\\n)@3<!\s+\zs%(\@-|-\@|\@|-)"
syn match justLineContinuation "\\$" containedin=ALLBUT,justComment,justCommentInBody,justShebang,@justRawStrings,justPreBodyCommentError,justRecipeAttrArgError

syn match justLineContinuation "\\$"
\ containedin=ALLBUT,justComment,justCommentInBody,justShebang,@justRawStrings,justPreBodyCommentError,justRecipeAttrArgError,justShellExpandRawDefaultValue

syn region justBody
\ start=/\v^\z( +|\t+)%(#!)@!\S/
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/expressions.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
<span class="Character"> baz</span><span class="PreProc">}</span>
<span class="String">'''</span>
shell_expanded6 <span class="Operator">:=</span> <span class="String">x'</span><span class="Special">$$$$</span><span class="String">not_an_env_var </span><span class="Special">$$$$</span><span class="String">{also_not_an_env_var}'</span>
shell_expanded7 <span class="Operator">:=</span> <span class="String">x'''</span>
<span class="String"> </span><span class="PreProc">${FOOOOOOOOOOOOOOOOO</span><span class="Operator">:-</span><span class="Character">bar \</span>
<span class="Character"> baz</span>
<span class="Character"> </span><span class="PreProc">}</span>
<span class="String">'''</span>

_true <span class="Operator">:=</span> <span class="Exception">assert</span>(<span class="String">'1'</span> <span class="Operator">!=</span> <span class="String">'0'</span>, <span class="String">'1 is not 0'</span>)

Expand Down
5 changes: 5 additions & 0 deletions tests/cases/expressions.just
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ shell_expanded5 := x'''
baz}
'''
shell_expanded6 := x'$$$$not_an_env_var $$$${also_not_an_env_var}'
shell_expanded7 := x'''
${FOOOOOOOOOOOOOOOOO:-bar \
baz
}
'''

_true := assert('1' != '0', '1 is not 0')

Expand Down

0 comments on commit c771fb5

Please sign in to comment.