Hi All,
The output of the following program is:
'(foo (prop a) (prop b))
I was hoping for:
The problem is that a syntax object representing a symbol
can be both an identifier and a property.
Since the nonterminal (foo x p) declares that the first x is an identifier
and p is a property, the unparser could pick the correct unparser.
/Jens Axel
#lang racket
(require nanopass/base)
(define id? identifier?)
(define (unparse-id id) (list 'id (syntax-e id)))
(define property? identifier?)
(define (unparse-property p) (list 'prop (syntax-e p)))
(define-language L
(entry Foo)
(terminals ((id (x)) . => . unparse-id)
((property (p)) . => . unparse-property))
(Foo (f)
(foo x p)))
(unparse-L
(with-output-language (L Foo)
`(foo ,#'a ,#'b)))