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

make #$start & #$stop tags for your parser #385

Open
github-serenity3 opened this issue Apr 8, 2021 · 2 comments
Open

make #$start & #$stop tags for your parser #385

github-serenity3 opened this issue Apr 8, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@github-serenity3
Copy link

github-serenity3 commented Apr 8, 2021

Hi! You have the "#$end" tag, but it is useless in many cases. How can I stop parsing and start it again from some different place skipping some blocks not to be parsed.

Please make two universal tags, say "#$start" for the parser to switch on, and "#$stop" to switch off to skip parsing unwanting blocks. I remember this technique from masm32, as for listing directives [ %list / %nolist ]. So, we can put them freely to . %list directive starts listing, %nolist stops it. Then we can start it again, then stop... The best and the simplest. Think about it. It would be a simple and marvelous solution ever. And very subtle. And Universal. Sorry if i missed something, and this is already implemented or is going to be solved in the future. It could be used ерут for really large modules for testing in separate code blocks.

@Almenon
Copy link
Owner

Almenon commented Apr 10, 2021

Adding a single #$start tag would be pretty simple 🤔 but you would have to redeclare any imports at the top. Are you okay with that? If you have time I would like to hop on a call with you to see how you're using AREPL and talk about your idea.

@Almenon Almenon added the enhancement New feature or request label Jun 28, 2021
@apitofme
Copy link

I would very much like to second the motion for this enhancement.

Often there are particular lines or blocks that I would like to ignore or skip whilst allowing execution to carry on below. This is of particular use when debugging, or working with incomplete code, since the execution stops when an error is encountered (of course). So being able to skip a line or section which causing an error, whilst continuing to be able to work on the rest of the code would be of great help!

I don't really know anything about how a REPL interpreter works, or how it has been implemented in the case of AREPL, but with regards to duplication of imports, would some kind of (per file) caching not be possible? ... Or the interpreter implemented in such a way that the session is never closed, but rather the $stop and $start tags trigger the in between block to be treated as a block-comment (i.e. docstring)? That way any declared imports, variables and their values are persisted and still available to the rest of the code outside of those tags.

As much as possible I want to be able to use AREPL with minimal 'pollution' of my code files (preferably none)!

Thanks.

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

No branches or pull requests

3 participants