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

Allow qualified names in concrete patterns #638

Closed
PaulKlint opened this issue Aug 15, 2014 · 2 comments
Closed

Allow qualified names in concrete patterns #638

PaulKlint opened this issue Aug 15, 2014 · 2 comments

Comments

@PaulKlint
Copy link
Member

Based on the discussion in #502, we need to extend the Rascal syntax to permit qualified names in the symbol that types a concrete syntax fragment or ConcreteHole.

It concerns the following syntax rules:

lexical Concrete 
  = typed: "(" LAYOUTLIST l1 Sym symbol LAYOUTLIST l2 ")" LAYOUTLIST l3 "`" ConcretePart* parts "`";

syntax ConcreteHole 
  = \one: "\<" Sym symbol Name name "\>"
  ;

@jurgenvinju
Copy link
Member

It would be consistent if we can qualify nonterminals as well, but for this case it wouldn't help to solve #502? The symbol in the concrete pattern is guaranteed to be a nonterminal and nonterminals are merged automatically if multiple definitions come in scope.

@mahills
Copy link
Member

mahills commented Aug 16, 2014

That's actually a good point -- it doesn't really address #502 but it does address the more general problem of disambiguating type names. We do have a similar issue there -- if we have both a concrete and an abstract version of the same name, their unqualified forms are not brought into scope, meaning that the qualified versions have to be used -- see #493 for this. There are options there as well, since we may be able to automatically disambiguate in cases such as "used inside a concrete syntax pattern".

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

No branches or pull requests

3 participants