diff --git a/check.sh b/check.sh index 4ede1e0..db7486d 100755 --- a/check.sh +++ b/check.sh @@ -43,6 +43,7 @@ tests=' 07-variable-not-or 07-variable-or-slash 07-variable-or-variable +07-variable-or-doublequote 08-variable-and 08-variable-not-and diff --git a/gash/grammar.scm b/gash/grammar.scm index 64fb5d6..1658eab 100644 --- a/gash/grammar.scm +++ b/gash/grammar.scm @@ -245,7 +245,7 @@ (('compound compound) (transform compound)) (('compound compound ...) `(begin ,@(map transform compound))) - (('command (word (or "." "source")) file-name) + (('command ('word (or "." "source")) file-name) `(source ,(transform file-name))) (('command word ... ('io-redirect ('io-here "<<" ('io-here-document string)))) `(pipeline (cut display ,string) (command ,@word))) @@ -281,5 +281,7 @@ (('function name body) `(function ,name (lambda ( . args) ,(transform body)))) + (('word 'delim) '(word "")) + ((h t ...) (map transform o)) (_ o))) diff --git a/gash/script.scm b/gash/script.scm index 3afb959..1a2b5bf 100644 --- a/gash/script.scm +++ b/gash/script.scm @@ -45,6 +45,7 @@ brace-group builtin command + delim doublequotes file-name for-clause diff --git a/test/07-variable-or-doublequote.sh b/test/07-variable-or-doublequote.sh new file mode 100644 index 0000000..04af4f2 --- /dev/null +++ b/test/07-variable-or-doublequote.sh @@ -0,0 +1,4 @@ +CPPFLAGS=${CPPFLAGS-" +-I ${srcdest}src +"} +echo $CPPFLAGS diff --git a/test/07-variable-or-doublequote.stdout b/test/07-variable-or-doublequote.stdout new file mode 100644 index 0000000..3bb5bf4 --- /dev/null +++ b/test/07-variable-or-doublequote.stdout @@ -0,0 +1 @@ +-I src