diff --git a/TODO b/TODO index 674e9ea..9211b2f 100644 --- a/TODO +++ b/TODO @@ -9,5 +9,6 @@ * compound: case, while, until * expansion: done * alias: +* iohere: * redirection: * posix compliance: diff --git a/gash/gash.scm b/gash/gash.scm index 3c8513e..3aedf3d 100644 --- a/gash/gash.scm +++ b/gash/gash.scm @@ -45,6 +45,7 @@ "" (string-split s #\newline))) (define (file-to-string filename) + (stdout "\n\n** " filename ":") ((compose read-string open-input-file) filename)) (define (string-to-ast string) diff --git a/gash/peg.scm b/gash/peg.scm index dad53c4..6ec18ba 100644 --- a/gash/peg.scm +++ b/gash/peg.scm @@ -159,7 +159,7 @@ assignment <-- name assign (substitution / word)* assign < '=' dollar <- '$' - literal <-- (!'[' !']' !tick !dollar !pipe !semi !par !nl !sp .)+ + literal <-- (!ltest !tick !dollar !pipe !semi !par !nl !sp .)+ variable <-- dollar (dollar / '*' / '?' / '@' / [0-9] / identifier / ([{] (![}] .)+ [}])) delim <- singlequotes / doublequotes / substitution sq < ['] @@ -167,8 +167,8 @@ bt < [`] singlequotes <-- sq (doublequotes / (!sq .))* sq doublequotes <-- dq (singlequotes / substitution / variable / (!dq .))* dq - separator <- (sp* break ws*) / ws+ break <- amp / semi !semi + separator <- (sp* break ws*) / ws+ sequential-sep <- (semi !semi ws*) / ws+ amp <- '&' semi < ';' @@ -365,7 +365,7 @@ (define (for name expr body) (for-each (lambda (value) (assignment name value) - (body)) (pk 'for-expr: (expr)))) + (body)) (expr))) (define (command . args) (define (exec command) @@ -384,7 +384,7 @@ (exec (append-map glob args))) (define (substitution . commands) - (apply (@ (gash pipe) pipeline->string) (map cdr commands))) + (apply (@ (gash pipe) pipeline->string) (map cdr commands))) ;;HACK (define (pipeline . commands) (apply (@ (gash pipe) pipeline) #t commands)) diff --git a/test/substitution.sh b/test/substitution.sh index 2b87ce6..8d686de 100644 --- a/test/substitution.sh +++ b/test/substitution.sh @@ -1,2 +1,2 @@ echo $(find test -type f) -echo `find test -type f` +#echo `find test -type f`