Add a 'raise' statement and the ParamCount/ParamStr builtins#310
Open
TetzkatLipHoka wants to merge 1 commit into
Open
Add a 'raise' statement and the ParamCount/ParamStr builtins#310TetzkatLipHoka wants to merge 1 commit into
TetzkatLipHoka wants to merge 1 commit into
Conversation
raise: scripts could report custom errors only through the
RaiseException builtin and could not re-raise inside except blocks with
the usual Pascal syntax. The identifier RAISE is now handled as a
statement in ProcessSub:
raise; // re-raise: RaiseLastException
raise Exception.Create('message'); // RaiseException(erCustomError, msg)
The class name is parsed but not evaluated (scripts have no exception
objects), the message may be any string expression, and the strict
<ident>.Create(<expr>) grammar keeps the single-token-lookahead parser
deterministic. Both forms work as if/then one-liners and interact with
try/except/finally as expected; ExceptionType/ExceptionParam report
erCustomError and the message.
ParamCount/ParamStr: the host process' command line was not reachable
from scripts. Registered as DefProc indices 49/50 (45-48 are taken by
the StrToUInt64 family and UIntToStr), kept in sync in
DefineStandardProcedures, DefProc and RegisterStandardProcs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
raise: scripts could report custom errors only through the
RaiseException builtin and could not re-raise inside except blocks with
the usual Pascal syntax. The identifier RAISE is now handled as a
statement in ProcessSub:
raise; // re-raise: RaiseLastException
raise Exception.Create('message'); // RaiseException(erCustomError, msg)
The class name is parsed but not evaluated (scripts have no exception
objects), the message may be any string expression, and the strict
.Create() grammar keeps the single-token-lookahead parser
deterministic. Both forms work as if/then one-liners and interact with
try/except/finally as expected; ExceptionType/ExceptionParam report
erCustomError and the message.
ParamCount/ParamStr: the host process' command line was not reachable
from scripts. Registered as DefProc indices 49/50 (45-48 are taken by
the StrToUInt64 family and UIntToStr), kept in sync in
DefineStandardProcedures, DefProc and RegisterStandardProcs.
🤖 Generated with Claude Code