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:
Cristian Esquivias 2014-08-19 15:15:34 -07:00
parent 86bf1e3052
commit af9dfb7876
2 changed files with 17 additions and 5 deletions

View File

@ -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 ...)))

View File

@ -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\"")))))