try to fix infix macros
This commit is contained in:
parent
1b356476a4
commit
a1e26dd01b
|
@ -4,7 +4,7 @@
|
|||
|
||||
(provide debug)
|
||||
|
||||
(define-for-syntax verbose? #f)
|
||||
(define-for-syntax verbose? #t)
|
||||
(define-syntax (debug stx)
|
||||
(if verbose?
|
||||
(syntax-case stx ()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
(require (rename-in typed-scheme (#%module-begin #%module-begin-typed-scheme)))
|
||||
(require (for-syntax scheme/base
|
||||
|
|
|
@ -497,6 +497,7 @@
|
|||
|
||||
(define-honu-syntax honu-infix-macro
|
||||
(lambda (stx ctx)
|
||||
(debug "Infix macro!\n")
|
||||
(define-splicing-syntax-class patterns
|
||||
#:literal-sets ([cruft #:phase (syntax-local-phase-level)])
|
||||
#;
|
||||
|
|
|
@ -72,9 +72,12 @@
|
|||
(debug "Transforming honu infix macro ~a\n" (stx-car stx))
|
||||
(let-values ([(used rest)
|
||||
(transformer (introducer full-stx) context)])
|
||||
(debug "Result is ~a. Object position is ~a out of expression ~a\n" used (syntax-object-position full-stx (introducer rest)) (syntax->datum full-stx))
|
||||
(list (introducer rest) (syntax-object-position full-stx (introducer rest))
|
||||
(introducer (used)))))]
|
||||
(let ([rest (introducer rest)]
|
||||
[position
|
||||
(sub1 (syntax-object-position full-stx (introducer rest)))]
|
||||
[parsed (introducer (used))])
|
||||
(debug "Result is ~a. Object position is ~a out of expression ~a\n" parsed position (syntax->datum full-stx))
|
||||
(list rest position parsed))))]
|
||||
[else (fail)])))
|
||||
|
||||
(define-primitive-splicing-syntax-class (honu-transformer context)
|
||||
|
|
Loading…
Reference in New Issue
Block a user