diff --git a/language.rkt b/language.rkt index 0da5f58..a0d6904 100644 --- a/language.rkt +++ b/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 ...))) diff --git a/rash-lang.rkt b/rash-lang.rkt index 42c4b70..3fc4887 100644 --- a/rash-lang.rkt +++ b/rash-lang.rkt @@ -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\"")))))