try to fix infix macros

This commit is contained in:
Jon Rafkind 2010-09-01 09:28:10 -06:00
parent 1b356476a4
commit a1e26dd01b
4 changed files with 9 additions and 5 deletions

View File

@ -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 ()

View File

@ -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

View File

@ -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)])
#;

View File

@ -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)