-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
RFC: Remove Delegate #1514
Comments
I have a working implementation of this RFC, but I have a strange problem in the parser macros here. For reference here is the code in the master branch of ponyc. |
What kind of problems is it causing? |
When running
|
Without |
I think there is a function somewhere that still expects the old AST format for the rule you modified. The fastest way to find it probably is to run the asserting code in a debugger and to print the backtrace. |
I wasn't able to figure out the problem with a debugger. I did find that in flatten.c L227 |
An I don't know if you're familiar with the relationship between the parser rules and the resulting ASTs so I'll walk you through it. I'll take the rule causing you trouble as an example. DEF(field);
// The first TOKEN of a rule defines the node ID of the AST
TOKEN(NULL, TK_VAR, TK_LET, TK_EMBED);
MAP_ID(TK_VAR, TK_FVAR);
MAP_ID(TK_LET, TK_FLET);
// Subsequent TOKENs or RULEs create child nodes
TOKEN("field name", TK_ID);
// SKIP checks that the expected token is present but doesn't create a child node
SKIP("mandatory type declaration on field", TK_COLON);
RULE("field type", type);
// An IF rule is optional. If the specified token isn't present, a default TK_NONE child node is created
IF(TK_DELEGATE, RULE("delegated type", provides));
IF(TK_ASSIGN, RULE("field value", infix));
REORDER(0, 1, 3, 2);
DONE(); Because an With that change, fields won't be able to provide types anymore. To fix the problem in |
Remove the implementation and tests for delegates from the compiler and the explanation and examples from the tutorial.
https://github.com/ponylang/rfcs/blob/master/text/0031-remove-delegate.md
The text was updated successfully, but these errors were encountered: