-
Notifications
You must be signed in to change notification settings - Fork 91
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
[Bug][Python Migration] Added support for parsing inside list of lists #2670
base: SYCLomatic
Are you sure you want to change the base?
Conversation
936c9eb
to
7b4fdae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From an overall view, I think this PR is a little strange.
There are too many special processes in the parser.
For example: can we just pass MatchPattern
into parseBlock
and use it in the parseCodeElement
call?
@tomflinda
if (Character == '{') { | ||
Index = parseBlock('{', '}', Input, Index, Mode); | ||
continue; | ||
} | ||
if (isLeftDelimiter(Character)) { | ||
char rightDelimiter = getRightDelimiter(Character); | ||
|
||
if (Character == '[') { | ||
Index = parseBlock('[', ']', Input, Index, Mode); | ||
continue; | ||
} | ||
|
||
if (Character == '(') { | ||
Index = parseBlock('(', ')', Input, Index, Mode); | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I think to parse the content inside, Index
should be ++Index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index is getting incremented inside parseBlock here
Did you mean the same or more additional increment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index is getting incremented inside parseBlock here
You are right.
@zhiweij1 yes, I think so. |
if (Input[Pos] == '[') | ||
Pos++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take the "out = func([["foo.cpp", "bar.cu", "baz.cpp"]])" for example.
Instead of skipping '{', we should locate the root cause of why the target "foo.cpp" could not be matched.
This PR adds support for parsing Python syntax inside list of lists like '[[a.cu]]'