Skip to content

Instantly share code, notes, and snippets.

@eholk
Created June 24, 2013 20:29
Show Gist options
  • Select an option

  • Save eholk/5853341 to your computer and use it in GitHub Desktop.

Select an option

Save eholk/5853341 to your computer and use it in GitHub Desktop.
;; The first language in the middle end.
(define-language M0
(terminals
(region-var (r))
(variable (x name)))
(Rho-Type
(t)
x)
(Module
(m)
(module decl ...))
(Decl
(decl)
(extern name (t* ...) -> t)
(fn name (x ...) t body))
(Body
(body)
(begin stmt ... body))
(Stmt
(stmt)
(let ((x t e) ...) stmt))
(Expr
(e)
(var t x)))
@eholk
Copy link
Author

eholk commented Jun 24, 2013

This gives me this error:

Exception in meta-parser: unrecognized meta variable -> in M0 at line 24, char 28 of harlan/middle/remove-lambdas.scm

@akeep
Copy link

akeep commented Jun 24, 2013

Just to compete the thought here... (extern name (t* ...) -> t) is not a legal production in the current grammar, because literals are not allowed in the middle of a production (here the -> is treated as a meta-variable, but since it is not defined, the nanopass framework gets confused.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment