syntax/parse: use lazy-require-syntax
This commit is contained in:
parent
e4d1bbc473
commit
c913d14d7c
|
@ -1,21 +0,0 @@
|
||||||
#lang racket/base
|
|
||||||
(require (for-template "parse.rkt"))
|
|
||||||
(provide id:define-syntax-class
|
|
||||||
id:define-splicing-syntax-class
|
|
||||||
id:define-integrable-syntax-class
|
|
||||||
id:syntax-parse
|
|
||||||
id:syntax-parser
|
|
||||||
id:define/syntax-parse
|
|
||||||
id:syntax-parser/template
|
|
||||||
id:parser/rhs
|
|
||||||
id:define-eh-alternative-set)
|
|
||||||
|
|
||||||
(define (id:define-syntax-class) #'define-syntax-class)
|
|
||||||
(define (id:define-splicing-syntax-class) #'define-splicing-syntax-class)
|
|
||||||
(define (id:define-integrable-syntax-class) #'define-integrable-syntax-class)
|
|
||||||
(define (id:syntax-parse) #'syntax-parse)
|
|
||||||
(define (id:syntax-parser) #'syntax-parser)
|
|
||||||
(define (id:define/syntax-parse) #'define/syntax-parse)
|
|
||||||
(define (id:syntax-parser/template) #'syntax-parser/template)
|
|
||||||
(define (id:parser/rhs) #'parser/rhs)
|
|
||||||
(define (id:define-eh-alternative-set) #'define-eh-alternative-set)
|
|
|
@ -1,6 +1,5 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require (for-syntax racket/base
|
(require racket/lazy-require
|
||||||
racket/lazy-require)
|
|
||||||
syntax/parse/private/keywords)
|
syntax/parse/private/keywords)
|
||||||
|
|
||||||
;; keep and keep as abs. path -- lazy-loaded macros produce references to this
|
;; keep and keep as abs. path -- lazy-loaded macros produce references to this
|
||||||
|
@ -8,25 +7,20 @@
|
||||||
;; (so for consistency etc, require absolutely from all modules)
|
;; (so for consistency etc, require absolutely from all modules)
|
||||||
(require stxparse-info/parse/private/residual)
|
(require stxparse-info/parse/private/residual)
|
||||||
|
|
||||||
(begin-for-syntax
|
(lazy-require-syntax
|
||||||
(lazy-require
|
|
||||||
;; load macro transformers lazily via identifier
|
;; load macro transformers lazily via identifier
|
||||||
;; This module path must also be absolute (not sure why,
|
;; This module path must also be absolute (not sure why,
|
||||||
;; but it definitely breaks on relative module path).
|
;; but it definitely breaks on relative module path).
|
||||||
[stxparse-info/parse/private/parse-aux
|
[syntax/parse/private/parse
|
||||||
(id:define-syntax-class
|
(define-syntax-class
|
||||||
id:define-splicing-syntax-class
|
define-splicing-syntax-class
|
||||||
id:define-integrable-syntax-class
|
define-integrable-syntax-class
|
||||||
id:syntax-parse
|
syntax-parse
|
||||||
id:syntax-parser
|
syntax-parser
|
||||||
id:define/syntax-parse
|
define/syntax-parse
|
||||||
id:syntax-parser/template
|
syntax-parser/template
|
||||||
id:parser/rhs
|
parser/rhs
|
||||||
id:define-eh-alternative-set)]))
|
define-eh-alternative-set)])
|
||||||
;; FIXME: workaround for phase>0 bug in racket/runtime-path (and thus lazy-require)
|
|
||||||
;; Without this, dependencies don't get collected.
|
|
||||||
(require racket/runtime-path (for-meta 2 '#%kernel))
|
|
||||||
(define-runtime-module-path-index _unused_ 'stxparse-info/parse/private/parse-aux)
|
|
||||||
|
|
||||||
(provide define-syntax-class
|
(provide define-syntax-class
|
||||||
define-splicing-syntax-class
|
define-splicing-syntax-class
|
||||||
|
@ -45,26 +39,3 @@
|
||||||
syntax-parser/template
|
syntax-parser/template
|
||||||
parser/rhs
|
parser/rhs
|
||||||
define-eh-alternative-set)
|
define-eh-alternative-set)
|
||||||
|
|
||||||
(define-syntaxes (define-syntax-class
|
|
||||||
define-splicing-syntax-class
|
|
||||||
define-integrable-syntax-class
|
|
||||||
syntax-parse
|
|
||||||
syntax-parser
|
|
||||||
define/syntax-parse
|
|
||||||
syntax-parser/template
|
|
||||||
parser/rhs
|
|
||||||
define-eh-alternative-set)
|
|
||||||
(let ([tx (lambda (get-id)
|
|
||||||
(lambda (stx)
|
|
||||||
((syntax-local-value (get-id)) stx)))])
|
|
||||||
(values
|
|
||||||
(tx id:define-syntax-class)
|
|
||||||
(tx id:define-splicing-syntax-class)
|
|
||||||
(tx id:define-integrable-syntax-class)
|
|
||||||
(tx id:syntax-parse)
|
|
||||||
(tx id:syntax-parser)
|
|
||||||
(tx id:define/syntax-parse)
|
|
||||||
(tx id:syntax-parser/template)
|
|
||||||
(tx id:parser/rhs)
|
|
||||||
(tx id:define-eh-alternative-set))))
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user