Inconsistent output

17 views
Skip to first unread message

Jens Axel Søgaard

unread,
Sep 19, 2015, 11:07:52 AM9/19/15
to nanopass-...@googlegroups.com
Hi All,

The following example outputs:

    #(language:L1 (foo #<syntax:20:11 a> #<syntax:20:16 b>))
    #(language:L2 (foo a b))

I was expecting:

    #(language:L1 (foo #<syntax:20:11 a> #<syntax:20:16 b>))
    #(language:L2 (foo #<syntax:23:11 a> #<syntax:23:16 b>))

The problem seems to be that unparse-id is called even though I haven't used unparse-L2 explicitly.

Is it intentionally or is it a bug?



#lang racket
(require nanopass/base)

(define id?        identifier?)
(define unparse-id syntax-e)

(define-language L1
  (entry Bar)
  (terminals (id (x)))
  (Foo (f)
    (foo x ...)))

(define-language L2
  (entry Foo)
  (terminals ((id (x)) . => . unparse-id))
  (Foo (f)
    (foo x ...)))

(with-output-language (L1 Foo)
  `(foo ,#'a ,#'b))

(with-output-language (L2 Foo)
  `(foo ,#'a ,#'b))
  

/Jens Axel

Andy Keep

unread,
Apr 30, 2016, 7:23:19 PM4/30/16
to nanopass-...@googlegroups.com, Jens Axel Søgaard
That is an excellent question.  I know Leif had changed how some of the printing of nanopass records was handled in Racket.

Leif, is this intentional?
--
You received this message because you are subscribed to the Google Groups "nanopass-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nanopass-framew...@googlegroups.com.
To post to this group, send email to nanopass-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nanopass-framework/CABefVgzfTujPEM3KvGSV1DR3DD2Md%2BqnBUYy4pMr7K1t4N8N9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages