Skip to content

Access previous/next step during compile #43

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

Open
freenerd opened this issue Oct 19, 2016 · 1 comment
Open

Access previous/next step during compile #43

freenerd opened this issue Oct 19, 2016 · 1 comment

Comments

@freenerd
Copy link
Member

Currently, the compile(step) function only has the current step as input. There are cases that we can only solve by allowing access to the previous/next step:

@mkv123
Copy link

mkv123 commented Aug 6, 2018

Related to starting work on adding support for mode changes (#18), I will need to tackle this one to some extent as well. I think the easiest way is to at least initially keep the current compile(language, step, options) as is, and instead add something like compileLeg(language, leg, options) which then internally uses the single step compile function. Then to the single step compile function, I would add the needed options to make it aware when modes change etc, which the compileLeg would populate. The return value of compileLeg would be an array of the instructions.

This would keep backwards compatibility for compile() and reduce the amount of changes to that function.

What do you think of this approach?

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

3 participants