-
Notifications
You must be signed in to change notification settings - Fork 47
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
Try catch support #248
Try catch support #248
Conversation
throw = true | ||
end sub | ||
`); | ||
|
||
expect(parser.diagnostics[0]?.message).to.eql(DiagnosticMessages.cannotUseReservedWordAsIdentifier('throw').message); | ||
expect(parser.diagnostics[0]?.message).to.eql(DiagnosticMessages.foundUnexpectedToken('=').message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking for throw
token earlier in the process causes a more generic error to be thrown. It's not really worth refactoring the parser just to get a slightly better error message, and we will definitely still get an error message so it's fine to just change this test.
: print a.b.c : catch e : print "error" : end try | ||
`); | ||
|
||
// expectNoParseErrors(` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three outlier syntaxes aren't currently supported. I want to support them eventually, but just don't have the time right now. I left them here so we don't forget to support them sometime in the future.
Add support for try/catch statements and
throw
statements.Resolves #218