-
Notifications
You must be signed in to change notification settings - Fork 78
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
Type.match and Type.instantiate for NonTerminalType #1844
base: main
Are you sure you want to change the base?
Conversation
…pe such that pattern matching works for types like {&T &E}* and &O?, such that generic functions like sort, size, zip and reverse can be written for syntax lists, such that some things become simpler for concrete syntax analysis
Currently "everything" is implemented but I managed to break the parser generator. In particular the code that uses abstract patterns to match against concrete trees is now broken. |
The current milestones for this branch are:
|
…ns regularly when matching empty lists of parse trees
Codecov Report
@@ Coverage Diff @@
## main #1844 +/- ##
========================================
- Coverage 49% 48% -1%
- Complexity 6091 6138 +47
========================================
Files 670 670
Lines 58698 58881 +183
Branches 8544 8603 +59
========================================
+ Hits 28792 28825 +33
- Misses 27729 27828 +99
- Partials 2177 2228 +51
|
Next steps before this can be merged:
|
#1835 is now needed to finish this work correctly. Consider:
Now we have two Then:
In #1835 we propose to have
More importantly, generic functions can that also be disambiguated:
Albeit a bit of a mouthful, I don't see another way. We need to specify which syntax role lists and generic lists have if we want some level of type correctness. |
@PaulKlint I will try and finish this in the coming days. I don't think it's relevant for you (except if I break things) in the short run, but it would be good if you read along with this in order to predict necessary fixes for the checker or compiler later. This is used to be a blind spot in our typing rules: i.e. what about This stuff is necessary to make the code around concrete syntax for external parsers work smoothly. Otherwise, we'll have to write a lot more code in Java, which I'm trying to avoid. |
Trying to implement Type.match and Type.instantiate for NonTerminalType such that pattern matching works for types like
{&T &E}*
and&O?
sort
,size
,zip
andreverse
can be written for syntax lists