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

Fix blocks: cap, qui, noi, if, else, else if #28

Closed
kylebarron opened this issue Aug 7, 2018 · 4 comments · Fixed by #44
Closed

Fix blocks: cap, qui, noi, if, else, else if #28

kylebarron opened this issue Aug 7, 2018 · 4 comments · Fixed by #44

Comments

@kylebarron
Copy link
Owner

image

@kylebarron
Copy link
Owner Author

@mcaceresb

image

What I'm considering doing is:

  • creating cap, qui, and noi blocks in the Pygments lexer.
  • Entering one of these blocks would stop interactivity until you closed the block. So no code would be sent to Stata until you exited it.
  • Sending a block to Stata, even a nested block, I.e. qui { \n cap { \n di "a" \n } \n }, doesn't seem like it would provide two newlines and a dot until the next prompt, so it should run correctly, and then just remove any lines in the output that pexpect captured that have the same text as the input lines. Hopefully none of the output lines will exactly match an input line.

@kylebarron
Copy link
Owner Author

Also do the same thing for if, else, else if

@kylebarron kylebarron changed the title Support capture, qui, noi Fix blocks: cap, qui, noi, if, else, else if Aug 8, 2018
@kylebarron
Copy link
Owner Author

I think for all blocks I can just add {, } to the lexer. Then I can send all lines of a block at a time. And if the last token isn't Text, it isn't ready to send to Stata yet. That seems pretty simple.

@kylebarron
Copy link
Owner Author

The only other thing to watch out for if the code is complete is program?

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

Successfully merging a pull request may close this issue.

1 participant