-
-
Notifications
You must be signed in to change notification settings - Fork 109
Fix comment parsing #123
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
Fix comment parsing #123
Conversation
Current coverage is 99.92% (diff: 100%)@@ master #123 diff @@
==========================================
Files 53 53
Lines 3771 3755 -16
Methods 184 184
Messages 0 0
Branches 0 0
==========================================
- Hits 3768 3752 -16
Misses 3 3
Partials 0 0
|
243a91b
to
5127520
Compare
*/ | ||
$curr = $list->tokens[$list->idx]; | ||
|
||
if ($curr->type === Token::TYPE_WHITESPACE) { | ||
// Whitespaces are skipped because the formatter adds its own. | ||
continue; | ||
} elseif ($curr->type === Token::TYPE_COMMENT) { |
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.
@nijel Do you know to what these lines was made for? Formatter works much better now.
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.
Ready for review! ;-) Input SELECT /* Comment */ 1
FROM tbl # Comment
WHERE 1 -- Comment Before SELECT
/* Comment */ 1
FROM
tbl
# Comment\x0AWHERE
1 -- Comment\x0A Now SELECT
/* Comment */ 1
FROM
tbl # Comment
WHERE
1 -- Comment Also written test to prevent regression. |
Should I rebase commits? |
I'll let Michal or one of the others comment on the code here, but as far as your rebase question there are no conflicts currently so there's no need to rebase at this time. A rebase would be handy if there were commits to 'master' that conflicted with your work or if you wished to keep your branch up to date with some other changes that have been happening in master (such as happens in main phpMyAdmin with a branch that takes a while to develop and merge back in, it's handy to rebase to stay up-to-date), but in this case I don't see a need. |
|
@nijel Any news on this? |
Nijel may be able to squash the commits when merging (Github has added some feature for this recently), but he'll let you know what would be best. Since neither he nor anyone else has commented, and since I'm still not very familiar with the code in the parser, I suggest to must've patient because someone will get to this soon. Thanks! |
Sorry, I know you are busy and full of work, I did not mean to hurry. |
No problem, I just thought you deserve a status update :-)
|
Overall I think your change makes sense, let's give @udan11 some time to comment on this as he is author of this code and there might have been some reasons behind it. |
Do you have any update? |
Okay, let's merge it as it looks reasonable to me. In case @udan11 disagrees later, we can handle that. |
Thanks |
Signed-off-by: Michal Čihař <michal@cihar.com>
Related with #120 (comment)
The Lexer adds a
\n
at the end of each comment.