-
Notifications
You must be signed in to change notification settings - Fork 208
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
[Bug] Undesired Behavior on Walker With Entry and With Exit #1313
Comments
@ChrisIsKing Does kugesan's pr on this resolve your issue? |
@marsninja @kugesan1105 I think I found a bug, not sure if this is related to the PR but I modified the test case to check for the condition where the developer wants to have an ability that is triggered on any node entry
It resulted in this error:
Since this addition replaces the ability to trigger on an entry of any type, we should still cater for this. |
Seems like you can achieve this using the
All nodes are python object so it makes sense that this works but there is a readability argument here as core jac users may not be familiar with this keyword. |
@marsninja If you're fine with the above comments, we can close this issue. |
@ChrisIsKing and @kugesan1105, Actually this is actually and important issue for us to address in the language. Essentially a number of legit types from the @kugesan1105 The best way to build this static error condition (that would trigger in the static compiler passes) is to look into the below code location in pythons standard library and see all teh casese that trigger this type of error and statically try to catch them during compile.
Spool up a pr with the test and your (or someone else on the team) should look into whether that fix makes sense. Certainly keep me posted. Also, @ChrisIsKing Thank goodness you didn't close this and move on with the work around. These are exactly the types of things we need to do to button up Jac. object is the way to go here but better error reporting is super necessary and shouldnt fall throught eh cracks.
|
@marsninja My understanding of the
|
You are 100% correct @ChrisIsKing , and now that you mention it there should indeed be a typecheck error in the with entry syntax. Right now all of the typechecks are warnings but in principle and when its beta tested enough we should flip a switch to make jac treat these (or at least some of these) as static errors. This would be in the realm of Jac as a typescript to javascript mode (which woudl be an option to make type checks warnigns). @kugesan1105 do we have a test case specificly for hte kind of code chris shows in his example. This would simply validate that the type check pass produces an error with the with int entry. If not do assign that PR to me once created and i can take a quick look. |
@kugesan1105 Is this issue good to close now? I believe the inconsistency mentioned is a separate issue/feature request right? |
Closing as the original issue was fixed in PR #1333. Will track typing issue and recommendation in a new issue |
Describe the bug
In Jac 1 walkers had the ability to execute functions/abilities based on the node they are currently traversing. e.g
the same can be achieved in jaclang with a more descriptive and readable syntax. eg.
This execute logic when entering a node of type
test_node
.However, missing from jaclang is the ability to execute upon the the
entry
andexit
of the entire walk. e.g in Jac 1 you could doSyntactically, it appear you could the same in jaclang by doing the following
However, this results in the logic being executed upon the entry and exit of any node type, which is not the desired behavior. This should behave like jac1 since the same can already be achieved by doing
can execute_entry with any entry
.To Reproduce
Here is a sample program to reproduce this:
The text was updated successfully, but these errors were encountered: