shift some `requires`

pull/2/head
Matthew Butterick 10 years ago
parent d1a738c4f2
commit 1dae4f7199

@ -3,7 +3,8 @@
(require (for-syntax racket/base
syntax/path-spec
racket/private/increader
compiler/cm-accomplice))
compiler/cm-accomplice
racket/match racket/function))
(provide include-without-lang-line)
@ -99,10 +100,9 @@
;; the guts are the (expr ...). To get them, we want the cdr of the fourth element.
(define fourth cadddr) ; we don't have `fourth` in the syntax environment.
;; get the guts and package them back into a syntax object using the saved content-syntax as context.
(local-require racket/match racket/function)
(define guts-data (match (map syntax->datum content)
[(list (list 'module modname lang (list '#%module-begin exprs ...))) exprs]
[(list exprs ...) exprs]))
[(list (list 'module modname lang (list '#%module-begin exprs ...))) exprs]
[(list exprs ...) exprs]))
(map (curry datum->syntax content-syntax) guts-data)]
[else null]))
(close-input-port p)

@ -1,7 +1,7 @@
#lang racket/base
(require rackunit net/url racket/set racket/list)
(require "main.rkt")
(require "../main.rkt")
(check-equal? (->string "foo") "foo")
(check-equal? (->string '()) "")
@ -189,7 +189,7 @@
(module include-test racket/base
(require sugar/include)
(include-without-lang-line "test/source.rkt")
(include-without-lang-line "source.rkt")
(provide included-symbol))
(require 'include-test)
@ -197,7 +197,7 @@
(module no-lang-line-include-test racket/base
(require sugar/include)
(include-without-lang-line "test/no-lang-line-source.rkt")
(include-without-lang-line "no-lang-line-source.rkt")
(provide no-lang-symbol))
(require 'no-lang-line-include-test)

Loading…
Cancel
Save