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