Commit 499977f1 authored by Vlasta Vesely's avatar Vlasta Vesely

sh.lang: fix variable definition in conditions

parent acb20cac
......@@ -202,7 +202,7 @@
</context>
<context id="variable-definition">
<match>(^\s*|(?&lt;=then|else|do|export)\s+)([a-zA-Z_][a-zA-Z0-9_]*)\=</match>
<match>(^\s*|(?&lt;=if|then|else|do|export|&amp;&amp;|\|\||\|)\s+)([a-zA-Z_][a-zA-Z0-9_]*)\=</match>
<include>
<context sub-pattern="2" style-ref="variable-definition"/>
</include>
......
......@@ -29,3 +29,8 @@ xxx${x#$HOME}xxx
xxx${x##*/}xxx
xxx${x#*}xxx
xxx${x#"*"}xxx
# Variable definitions
var=val
if var=$(cmd); then some; fi
test -f xxx && var=xxx || var=yyy
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment