🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@jsoref
Copy link
Contributor

@jsoref jsoref commented Dec 16, 2022

I have a much larger change that includes changes to this file, but I figure I'd start with this change.

TokenScope scope = new TokenScope(initialChar: $A + 1);

// We start with 'A'.
// We start with 'B'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution, but I think this comment is correct. We start with A so we naturally get B when we ask for the next name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, line 78 starts with $A+1 which is $B

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be slightly more explicit, if your explanation was correct, then the comment in the previous block would be wrong, but it really can't be:

TokenScope scope = new TokenScope(initialChar: $A);
// We start with 'A'.
Expect.equals("A", scope.getNextName());

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. It seems that getNextName actually returns the current name and advances. Makes sense.

@mraleph mraleph closed this Dec 16, 2022
@mraleph mraleph reopened this Dec 16, 2022
@mraleph
Copy link
Member

mraleph commented Dec 16, 2022

+2ed the CL (https://dart-review.googlesource.com/c/sdk/+/275985), waiting for it to land.

@jsoref jsoref deleted the comment-b branch December 16, 2022 09:06
@jsoref jsoref mentioned this pull request Dec 19, 2022
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