core: support raise exception short form #455
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#455
Loading…
Reference in New Issue
No description provided.
Delete Branch "issue-194"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds support for "raise Exception" short form #194
Exceptions can now be raised using either of these syntaxes:
@ -2461,0 +2460,4 @@
if let Some(res) = resolver.get_symbol_value(*id, ctx) {
res
} else {
// Allow "raise Exception" short form (Issue #194)
No need to quote issue number.
Why is the code so complicated?
Ok.
The shorthand exception notation is treated as a variable in the AST. Here I am performing a lookup using the variable definition to get the signature of the exception. Most of the code is to ensure the exception is matched to correct type.
Sounds fishy to me. The other one would be a variable inside a call, so there shouldn't be that much difference.
The other already has the function signature (the constructor of the exception) linked to it, so there is no need for lookup.
16dac8b2c4
to52e5d417ea