Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@scottstephens
Copy link

When Terse mode automatically adds a semi-colon to partial inputs it causes inputs like "for (int ii = 0; ii < 3; ii++)", or "while (ii < 3)" to execute immediately with no body in the loop, rather than waiting for further input.

This pull request fixes that problem by detecting loop expressions using a Regex, and not attempting to complete them by adding a semi-colon.

@migueldeicaza
Copy link
Contributor

Using a regular expression for detecting this is too fragile.

What I would rather do is this: just like we have a retry for ';', we should have a retry by adding a block '{}', if this one succeeds in parsing, we assume that we need a continuation. Otherwise we try the ';'

@migueldeicaza
Copy link
Contributor

I added the correct fix to master.

@scottstephens
Copy link
Author

Ah, much nicer solution. Catches "if (a > b)" too, which escaped my attention before.

Red54 pushed a commit to Red54/mono that referenced this pull request Mar 15, 2019
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 this pull request may close these issues.

2 participants