Skip to content
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

Add return hook with interrupt #112

Open
robcxyz opened this issue Dec 3, 2022 · 0 comments
Open

Add return hook with interrupt #112

robcxyz opened this issue Dec 3, 2022 · 0 comments

Comments

@robcxyz
Copy link
Collaborator

robcxyz commented Dec 3, 2022

Right now there is no way to gracefully stop parsing without exiting completely. For instance:

<-: 
  exec: 
    foo: bar 
    # Run some hook to return 
    exit->: return --if foo=='bar'    # Not possible 
    some: other context 

It is not simple to do this as the parser will continue to parse unless it has been given some kind of interrupt to tell it to stop parsing.

Couple options:

  1. Add a bool INTERRUPT variable in parser and check that when in walk_sync to stop parsing
  2. Add bool field in Context from hook and check that
  • Would additionally need to load that into the context when parsing hook

Option 1 seems like the most reasonable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant