gash: resurrect.

This commit is contained in:
Jan Nieuwenhuizen 2018-10-21 15:24:24 +02:00
parent 0f5b538c3a
commit 13cb50af60
5 changed files with 11 additions and 17 deletions

View File

@ -307,27 +307,15 @@
;; (('assignment a b)
;; `(assignment ,(transform a) ,(map transform b)))
(('for-clause name sequence (and body ('pipeline _ ...)))
`(for ,(transform name) (lambda _ ,(transform sequence)) (lambda _ ,(transform body))))
(('for-clause name expr body)
`(for ,(transform name) (lambda _ ,(transform expr)) (lambda _ ,@(map transform body))))
(('sequence o)
`(sequence ,@(fold-right (lambda (o r)
(cons
(match o
(('substitution x) (transform o))
(_ `(list ,(transform o))))
r))
'() o)))
`(sequence (string-split ,(transform o) #\space)))
(('sequence o ...)
`(sequence ,@(fold-right (lambda (o r)
(cons
(match o
(('substitution x) (transform o))
(_ `(list ,(transform o))))
r))
'() o)))
`(sequence (quote ,(map transform o))))
(('substitution o) `(substitution ,(transform o)))
(('if-clause expr then) `(if-clause ,(transform expr) ,(transform then)))
(('if-clause expr then else) `(if-clause ,(transform expr) ,(transform then) ,(transform else)))

View File

@ -48,6 +48,7 @@
glob
if-clause
ignore-error
literal
pipeline
run
script
@ -144,6 +145,9 @@
(define (xtrace o)
(o))
(define (literal o)
o)
(define (word . o)
(define (flatten o)
(match o

View File

@ -6,7 +6,8 @@ SHELL=bin/gash
for f in test/*.sh; do
echo -n "$f: "
b=test/$(basename $f .sh)
$SHELL --geesh -e $f
# $SHELL --geesh -e $f
$SHELL -e $f
r=$?
if [ -f $b.exit ]; then
e=$(cat $b.exit)

View File

@ -1,3 +1,3 @@
for file in `echo ar.o arscan.o`; do
echo compiling ${file}...
echo compiling $file...
done

1
test/33-string-args.sh Normal file
View File

@ -0,0 +1 @@
echo foo "bar" '"baz"' \"bla\"