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

[Bug][Python Migration] Added support for parsing inside list of lists #2670

Open
wants to merge 1 commit into
base: SYCLomatic
Choose a base branch
from

Conversation

TejaX-Alaghari
Copy link
Contributor

This PR adds support for parsing Python syntax inside list of lists like '[[a.cu]]'

@TejaX-Alaghari TejaX-Alaghari requested a review from a team as a code owner February 18, 2025 03:04
Copy link
Contributor

@zhiweij1 zhiweij1 left a 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

Comment on lines -303 to -315
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;
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

@zhiweij1 zhiweij1 Feb 18, 2025

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.

@tomflinda
Copy link
Contributor

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

@zhiweij1 yes, I think so.

Comment on lines +466 to +467
if (Input[Pos] == '[')
Pos++;
Copy link
Contributor

@tomflinda tomflinda Feb 20, 2025

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.

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.

3 participants