Skip to content

Conversation

bigfoot90
Copy link
Contributor

Related with #120 (comment)
The Lexer adds a \n at the end of each comment.

@codecov-io
Copy link

codecov-io commented Jan 8, 2017

Current coverage is 99.92% (diff: 100%)

Merging #123 into master will decrease coverage by <.01%

@@             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          

Powered by Codecov. Last update 2a589a3...5127520

@bigfoot90 bigfoot90 mentioned this pull request Jan 8, 2017
@bigfoot90 bigfoot90 force-pushed the fix-comment-parsing branch from 243a91b to 5127520 Compare January 10, 2017 21:30
*/
$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) {
Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's really there since beginning (e6a562e), most likely to behave consistently with formatter we had in past in phpMyAdmin. Maybe @udan11 can comment on this...

@bigfoot90
Copy link
Contributor Author

bigfoot90 commented Jan 10, 2017

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.

@bigfoot90
Copy link
Contributor Author

Should I rebase commits?

@ibennetch
Copy link
Member

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.

@bigfoot90
Copy link
Contributor Author

Should I rebase commits?
Should I squash commits?

@bigfoot90
Copy link
Contributor Author

@nijel Any news on this?

@ibennetch
Copy link
Member

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!

@bigfoot90
Copy link
Contributor Author

bigfoot90 commented Jan 15, 2017

Sorry, I know you are busy and full of work, I did not mean to hurry.

@ibennetch
Copy link
Member

ibennetch commented Jan 15, 2017 via email

@nijel
Copy link
Contributor

nijel commented Jan 17, 2017

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.

@nijel nijel self-assigned this Jan 17, 2017
@bigfoot90
Copy link
Contributor Author

Do you have any update?

@nijel nijel merged commit ed8d676 into phpmyadmin:master Jan 20, 2017
@nijel
Copy link
Contributor

nijel commented Jan 20, 2017

Okay, let's merge it as it looks reasonable to me. In case @udan11 disagrees later, we can handle that.

@bigfoot90
Copy link
Contributor Author

Thanks

@bigfoot90 bigfoot90 deleted the fix-comment-parsing branch January 20, 2017 13:04
nijel added a commit that referenced this pull request Jan 20, 2017
Signed-off-by: Michal Čihař <michal@cihar.com>
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.

4 participants