Commit 7a536e18 authored by Jeffery To's avatar Jeffery To Committed by Christian Hergert

sh.lang: Make "for-command" context end earlier

This changes the "for-command" context to end earlier, so that it does
not accidentally consume other keywords.

Fixes #40
parent f93a7029
......@@ -218,12 +218,12 @@
<keyword>(?&lt;=\s)\.(?=\s)</keyword>
</context>
<context id="for-command">
<context id="for-command" end-at-line-end="true">
<start>\bfor\b</start>
<end>\b(in|do)\b</end>
<end>(?=\S)</end>
<include>
<context sub-pattern="0" where="start" style-ref="keyword"/>
<context sub-pattern="0" where="end" style-ref="keyword"/>
<context ref="def:line-continue"/>
<context style-ref="variable-definition" once-only="true">
<match>\w+</match>
</context>
......
......@@ -34,3 +34,16 @@ xxx${x#"*"}xxx
var=val
if var=$(cmd); then some; fi
test -f xxx && var=xxx || var=yyy
for word in hello world
do
echo $word
done
for arg; do echo $arg; done
for \
arg; do echo $arg; done
echo Look for file
echo Look for; echo Look for
echo next line
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