Quoting not needed inside double brackets

Fixes #8
This commit is contained in:
Andreas Nordal 2018-06-04 00:30:31 +02:00
parent 4ed8ac2e86
commit f34d7e834d
5 changed files with 50 additions and 0 deletions

@ -619,6 +619,14 @@ fn keyword_or_command(
return flush(i);
}
let word = &horizon[i..i+len];
if word == b"[[" {
return WhatNow{
tri: Transition::Push(Box::new(
SitVec{terminator: vec!{b']', b']'}, color: 0x00007fff}
)),
pre: i, len: len, alt: None
};
}
match KEYWORDS_SORTED.binary_search(&word) {
Ok(_) => WhatNow{
tri: Transition::Push(Box::new(SitExtent{

@ -0,0 +1,18 @@
if [[ -v $julenissen ]]; then
[[ $julenissen ]] || [[ $kake ]] || exit 1
env [[ He is a "$n"åså ]]
a a a a | a a a a ; a a a a & a a a a
fi
# Comment above command
true
if true; then true true; fi
echo It is not possible \
# FIXME \
echo to comment between args
if test -e julenissen; then echo ja; elif test -e kake; then echo ok; else echo nei; fi
for i in "$a"; do echo "$i"; done
case "$PATH" in *"$HOME"*) echo homeopath;; esac

@ -0,0 +1,5 @@
[[

test/original/unexpected_eof_doublebracket.bash: Unexpected end of file
The file's end was reached without closing all sytactic scopes.
Either, the parser got lost, or the file is truncated or malformed.

@ -0,0 +1,18 @@
if [[ -v $julenissen ]]; then
[[ $julenissen ]] || [[ $kake ]] || exit 1
env [[ He is a $nåså ]]
a a a a | a a a a ; a a a a & a a a a
fi
# Comment above command
true
if true; then true true; fi
echo It is not possible \
# FIXME \
echo to comment between args
if test -e julenissen; then echo ja; elif test -e kake; then echo ok; else echo nei; fi
for i in $a; do echo $i; done
case $PATH in *"$HOME"*) echo homeopath;; esac

@ -0,0 +1 @@
[[