[honu] handle empty files
This commit is contained in:
parent
182cded2a3
commit
b823df23a7
|
@ -452,9 +452,12 @@ Then, in the pattern above for 'if', 'then' would be bound to the following synt
|
||||||
(define-syntax (honu-unparsed-begin stx)
|
(define-syntax (honu-unparsed-begin stx)
|
||||||
(emit-remark "Honu unparsed begin!" stx)
|
(emit-remark "Honu unparsed begin!" stx)
|
||||||
(debug "honu unparsed begin: ~a at phase ~a\n" (syntax->datum stx) (syntax-local-phase-level))
|
(debug "honu unparsed begin: ~a at phase ~a\n" (syntax->datum stx) (syntax-local-phase-level))
|
||||||
(define expanded (honu-expand (stx-cdr stx)))
|
(syntax-parse stx
|
||||||
|
[(_) #'(void)]
|
||||||
|
[(_ forms ...)
|
||||||
|
(define expanded (honu-expand #'(forms ...)))
|
||||||
(debug "expanded ~a\n" expanded)
|
(debug "expanded ~a\n" expanded)
|
||||||
expanded)
|
expanded]))
|
||||||
|
|
||||||
(define-syntax (#%dynamic-honu-module-begin stx)
|
(define-syntax (#%dynamic-honu-module-begin stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
|
|
|
@ -153,7 +153,7 @@
|
||||||
;; (printf "next ~a\n" next)
|
;; (printf "next ~a\n" next)
|
||||||
(match next
|
(match next
|
||||||
[(struct* position-token ([token (? token-eof?)] [start-pos start] [end-pos end]))
|
[(struct* position-token ([token (? token-eof?)] [start-pos start] [end-pos end]))
|
||||||
;; (printf "done lexing\n")
|
; (printf "done lexing ~a\n" tokens)
|
||||||
(reverse tokens)]
|
(reverse tokens)]
|
||||||
[(struct* position-token ([token (? token-end-of-line-comment?)]
|
[(struct* position-token ([token (? token-end-of-line-comment?)]
|
||||||
[start-pos start]
|
[start-pos start]
|
||||||
|
@ -357,7 +357,7 @@
|
||||||
[else (loop (cdr use))])))
|
[else (loop (cdr use))])))
|
||||||
|
|
||||||
(if (null? tokens)
|
(if (null? tokens)
|
||||||
eof
|
(datum->syntax #f '() #f)
|
||||||
(datum->syntax #f (do-parse '() tokens dispatch-table)
|
(datum->syntax #f (do-parse '() tokens dispatch-table)
|
||||||
#f)))
|
#f)))
|
||||||
|
|
||||||
|
@ -380,6 +380,7 @@
|
||||||
(port-count-lines! port)
|
(port-count-lines! port)
|
||||||
port)
|
port)
|
||||||
|
|
||||||
|
#;
|
||||||
(test-case
|
(test-case
|
||||||
"Basic tests"
|
"Basic tests"
|
||||||
(check-equal? (strip (lex-string "5"))
|
(check-equal? (strip (lex-string "5"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user