You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After testing, found out that the characters (, ), [, and ] cause the error "{ required" when included in commented-out code.
Also, proposed a solution to " and I think it fixes most of the cases. I tested the following and it works:
/*******************************************************************************
Name of file: main.do
testing first instance of "quote
*******************************************************************************/
/* the do-file tests the "second instance of quote
error " */
// test brackets [
sysuse auto, clear
* testing open paranthesis (
bys mpg: /// sorting by mpg
gen dup = cond(_N==1,0,_n)
// testing third instance of quote "here
drop if dup > 1
But it does not work if quote is on the next line of the comment without any space:
/* the do-file tests the "second instance of quote
error" */
// test brackets [
sysuse auto, clear
This doesn't work for ". The problem isn't that we can't remove it, it's that it breaks functionality, typically in the sub-do-file cases like we have in the test file:
do "`fldr'/B sub1.do"
do `fldr'/B-sub2.do
You will typically find that the first one won't trigger recursive searching because it won't find the do file without the ".
@ankritisingh@kbjarkefurfb8b45d implements a reworked version of this functionality which I think solves nearly all the problems. All test files work fine, including the new comments.do test file that has all the evil comments.
What is not working is anything involving comments that would trigger recursive behaviors if they were not comments. See the recursion.do test file -- these are to my knowledge the unsolved cases (this file crashes the command instantly).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After testing, found out that the characters
(,),[, and]cause the error "{ required" when included in commented-out code.Also, proposed a solution to
"and I think it fixes most of the cases. I tested the following and it works:But it does not work if quote is on the next line of the comment without any space:
It causes the error "too few quotes"