Took out 'start prepend hack from reader.
When proc-expression is a string call start instead with proc-expression as the first argument.
This commit is contained in:
parent
86bf1e3052
commit
af9dfb7876
14
language.rkt
14
language.rkt
|
@ -4,4 +4,16 @@
|
|||
|
||||
(provide start
|
||||
pipe
|
||||
(all-from-out racket/base))
|
||||
(except-out (all-from-out racket/base)
|
||||
#%app
|
||||
#%top)
|
||||
(rename-out [my-app #%app]
|
||||
[my-top #%top]))
|
||||
|
||||
(define-syntax-rule (my-top . id)
|
||||
'id)
|
||||
|
||||
(define-syntax-rule (my-app proc-expr arg ...)
|
||||
(if (string? proc-expr)
|
||||
(start proc-expr arg ...)
|
||||
(proc-expr arg ...)))
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
(define-values (start-line start-col start-pos) (port-next-location in))
|
||||
(define (list->rash-syntax l span)
|
||||
(datum->syntax #f
|
||||
(cons 'start l)
|
||||
l
|
||||
(vector src start-line start-col start-pos span)))
|
||||
|
||||
(let loop ([words '()]
|
||||
|
@ -58,14 +58,14 @@
|
|||
|
||||
(test-case
|
||||
"Read alphanumeric words with EOF"
|
||||
(check equal? '(start "echo" "hello1") (rash-read (2port "echo hello1"))))
|
||||
(check equal? '("echo" "hello1") (rash-read (2port "echo hello1"))))
|
||||
|
||||
(test-case
|
||||
"Read string with newline"
|
||||
(check equal? '(start "echo") (rash-read (2port "echo\n"))))
|
||||
(check equal? '("echo") (rash-read (2port "echo\n"))))
|
||||
|
||||
(test-case
|
||||
"Read string"
|
||||
(check equal?
|
||||
'(start "echo" "hello world")
|
||||
'("echo" "hello world")
|
||||
(rash-read (2port "echo \"hello world\"")))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user