-
Notifications
You must be signed in to change notification settings - Fork 127
Add proper support for escape manipulation by Actions #1047
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
base: main
Are you sure you want to change the base?
Changes from all commits
81e9ad1
8f2d934
fe0fe44
6b605c9
4bfb427
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Robotgiggle marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,8 +49,8 @@ protected Iota(@NotNull IotaType<?> type, @NotNull Object payload) { | |
| abstract public @NotNull Tag serialize(); | ||
|
|
||
| /** | ||
| * This method is called when this iota is executed (i.e. Hermes is run on a list containing it, unescaped). | ||
| * By default it will return a {@link CastResult} indicating an error has occurred. | ||
| * This method is called when this iota is directly executed (i.e. Hermes is run on a list containing it, unescaped). | ||
| * By default, it will return a {@link CastResult} indicating an error has occurred. | ||
| */ | ||
| public @NotNull CastResult execute(CastingVM vm, ServerLevel world, SpellContinuation continuation) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a breaking change - any addon that implements custom iota execution (and also ContinuationIota) will now execute their unescaped behaviour inside of parentheses until patched. Likely we should do the same thing as with Action (ie add an executeInParens method).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! This has now been fixed. |
||
| return new CastResult( | ||
|
|
@@ -67,6 +67,21 @@ protected Iota(@NotNull IotaType<?> type, @NotNull Object payload) { | |
| HexEvalSounds.MISHAP); | ||
| } | ||
|
|
||
| /** | ||
| * This method is called when this iota is executed inside parentheses (i.e. Hermes is run on a list containing Introspection, this, Retrospection). | ||
| * By default, the iota will be added to the in-progress parenthesized list instead of causing a mishap. | ||
| * This is specifically for parentheses-based escaping, Consideration escaping is handled in {@link CastingVM#executeInner}. | ||
| */ | ||
| public @NotNull CastResult executeInParens(CastingVM vm, ServerLevel world, SpellContinuation continuation) { | ||
| return new CastResult( | ||
| this, | ||
| continuation, | ||
| vm.getImage().withNewParenthesized(this, false), | ||
| List.of(), | ||
| ResolvedPatternType.ESCAPED, | ||
| HexEvalSounds.NORMAL_EXECUTE); | ||
| } | ||
|
|
||
| /** | ||
| * Returns whether this iota is possible to execute (i.e. whether {@link Iota#execute} has been overridden. | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.