Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goofy error message on missing unquote #24

Open
jbclements opened this issue May 1, 2019 · 0 comments
Open

Goofy error message on missing unquote #24

jbclements opened this issue May 1, 2019 · 0 comments

Comments

@jbclements
Copy link
Contributor

Here's a simple program that's missing an unquote:

#lang racket

(require nanopass/base)

(define-language R1a
  (terminals
   (symbol (s)))
  (Ilos (l)
       (null)
       (cons s ... l)))

(define-pass all-to-a : R1a (l) -> R1a ()
  (Ilos : Ilos (l) -> Ilos ()
        [(null) `(null)]
        [(cons ,s ,l)
         (define new-syms '(a a a a))
         (define rest (Ilos l))
         `(cons new-syms ... ,rest)]))

(define-parser parse-R1a R1a)
(all-to-a (parse-R1a '(cons z (cons b (cons x (null))))))

This program produces the error

unsaved editor:13:22: all-to-a: unrecognized nonterminal in language R1a at: Ilos in: all-to-a
#(206 4)

... with a pointer to the first line of the transform. This only happens with a ...ed pattern. It took me quite a while to find this... I'm kind of baffled as to the chain that leads to this error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant