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

Variables in concrete syntax patterns cannot use [ and ] in the sort name #87

Open
BertLisser opened this issue Apr 16, 2013 · 0 comments
Labels

Comments

@BertLisser
Copy link
Owner

Created 2010-03-02 by [email protected] assigned to [email protected]

In attempting to use a concrete syntax pattern for matching a Rascal map, I've encountered a problem with declaring a variable to represent a mapping. Pasted below is part of an email sent to Jurgen on 19/2/2010:

I'll look through the code to see if I can figure this out, but will just work on other things for now. I'm trying to match mappings in the type checker, but I'm getting a parser error:

rascal>( <{Mapping[[Expression]] ","}* mps> ) := expMap;
^ parse error here
rascal>( < {Mapping[[Expression]] ","}* mps > ) := expMap;
^ parse error here
rascal>( < {Mapping ","}* mps > ) := expMap;
internal exception: java.lang.NullPointerException
rascal>( < {Mapping[Expression] ","}* mps > ) := expMap;
^ parse error here

I think this is because of the use of [ and ] in the pattern, but this is what is used in the SDF definition:

sorts Mapping
context-free syntax
from:Expression ":" to:Expression -> Mapping[[Expression]] {cons("Default")}
"(" mappings:{Mapping[[Expression]] ","}* ")" -> Expression {cons("Map")}

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

No branches or pull requests

1 participant