Replace the signature of targeted routines to be def INT for ENTITY ID instead of def INT for_ENTITY(ID) (where ENTITY is literally "object"/"actor"/"performer").
Keep and deprecate the old syntax.
Motivation
This syntax is much more consistent with the rest of ExplorerScript and doesn't require extra bespoke keywords (for_actor, etc.)
Since this will also need to be added to SsbScript, CTX_TYPE, ACTOR, OBJECT and PERFORMER could no longer be tokens, sice this would conflict with the object and performer operations. In this case CTX_TYPE would need to be replaced with IDENTIFIER wherever used and code needs to be adjusted in the compiler to handle this.
FOR needs to also become a keyword in SsbScript.
Behaviour
No changes.
Compiler Implementation
Compiler Interface Changes
No changes.
Decompiler Changes
The decompiler should use this new syntax.
How to teach
Update the documentation to only mention this new syntax.
Alternatives
Do nothing: Not great, it's better to eventually get rid of these extra unnecessary keywords, both to keep the language simpler to to make it easier for the user.
Backwards compatibility
The old syntax would still work but be deprecated and eventually removed.
Summary
Replace the signature of targeted routines to be
def INT for ENTITY ID
instead ofdef INT for_ENTITY(ID)
(where ENTITY is literally "object"/"actor"/"performer"). Keep and deprecate the old syntax.Motivation
This syntax is much more consistent with the rest of ExplorerScript and doesn't require extra bespoke keywords (
for_actor
, etc.)Examples
Example of the new syntax.
Equivalent old syntax.
Language Changes
Parser and Lexer Changes
Change the parser as such:
Note that the parenthesis would now be optional.
Since this will also need to be added to SsbScript,
CTX_TYPE
,ACTOR
,OBJECT
andPERFORMER
could no longer be tokens, sice this would conflict with the object and performer operations. In this caseCTX_TYPE
would need to be replaced withIDENTIFIER
wherever used and code needs to be adjusted in the compiler to handle this.FOR
needs to also become a keyword in SsbScript.Behaviour
No changes.
Compiler Implementation
Compiler Interface Changes
No changes.
Decompiler Changes
The decompiler should use this new syntax.
How to teach
Update the documentation to only mention this new syntax.
Alternatives
Backwards compatibility
The old syntax would still work but be deprecated and eventually removed.