You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: See return-key for an additional macro for ergonomics.
Currently when a declarative hook is called with an exec, the entire context is parsed with a special field for returning the appropriate value (return) being used to specify what the result is of that parsing.
This proposal would add a hook for being able to escape parsing and return a specific value as the public context.
Examples
Normal parsing
foo: barreturn a key->: return {{foo}}
Would result in the value bar being returned in the public context.
Similarly with exec:
<-:
exec:
foo: barreturn a key->: return {{foo}}something that: is ignored
Implementation
Context can be set within the hook. Need a way to send kill signal to parsing though since once the context is set, we need to be able to stop the parsing of the next key.
NOTE: Likely this kill signal approach would also enable a macro like approach for implementing return-key.
The text was updated successfully, but these errors were encountered:
Return Hook
None
Proposal Status: implemented
Issue Number: 256
Proposal Doc: return-hook.md
Overview
Currently when a declarative hook is called with an exec, the entire context is parsed with a special field for returning the appropriate value (
return
) being used to specify what the result is of that parsing.This proposal would add a hook for being able to escape parsing and return a specific value as the public context.
Examples
Normal parsing
Would result in the value
bar
being returned in the public context.Similarly with
exec
:Implementation
Context can be set within the hook. Need a way to send kill signal to parsing though since once the context is set, we need to be able to stop the parsing of the next key.
The text was updated successfully, but these errors were encountered: