Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

nanopass-case producing unexpected error #36

Open
akeep opened this issue Jul 19, 2015 · 0 comments
Open

nanopass-case producing unexpected error #36

akeep opened this issue Jul 19, 2015 · 0 comments
Assignees

Comments

@akeep
Copy link
Owner

akeep commented Jul 19, 2015

(originally submitted over email to the nanopass-framework mailing list by Axel Søgaard)

The following programs compiles without errors:

lang nanopass

(define variable? symbol?)

(define-language LFE
(entry TopLevelForm)
(terminals
(variable (x xd)))
(Formals (f) x)
(TopLevelForm (t) g)
(GeneralTopLevelForm (g) e)
(Expr (e) x))

(define-language LFE2 (extends LFE)
(Abstraction (ab)
(+ (λ f e) => (λ f e)))
(Expr (e)
(+ ab)))

(define-language LANF (extends LFE2)
(AExpr (ae)
(+ x
ab))
(CExpr (ce)
(+ ae))
(Expr (e)
(+ ae
ce)))

However, if I add the following expression, I get an error:

(λ()
(nanopass-case (LANF Expr) 43
[else 4]))

The (internal) compile time error I get is:

Dropbox/GitHub/nanopass-framework-racket/private/pass.rkt:1059:52: memf: not a proper list: '#s((nonterminal-alt #(0) alt 3) #<syntax:27:7 ae> #f #f #<syntax:21:3 AExpr>)

I know that 43 isn't an LANF Expression, but that's besides the point.

Note that if I change

(Expr (e)
(+ ae
ce)))

to

(Expr (e)
(+
ce)))

the error disappears.

Is the language definition correct?

@akeep akeep self-assigned this Jul 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant