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

[C] Add digit separator like is already implemented for C++ #4101

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

Conversation

braewoods
Copy link
Contributor

C23 added this feature previously available in C++. This should close #3972 as well as both C and C++ now have syntax support for the ' digit separator.

This was implemented by just copying the digit variables from the C++ syntax file as it is the same construct in the end. The existing tests were updated to fix the part of the existing tests were broken by this new feature.

Furthermore, some tests from C++ were adapted for C to add better testing for the new digit seperator. I also included tests for the newer base 2 integer contants. The C file did not have any tests for that yet.

C23 added this feature previously available in C++. This should
close sublimehq#3972 as well as both C and C++ now have syntax support for
the ' digit separator.

This was implemented by just copying the digit variables from the
C++ syntax file as it is the same construct in the end. The existing
tests were updated to fix the part of the existing tests were broken
by this new feature.

Furthermore, some tests from C++ were adapted for C to add better
testing for the new digit seperator. I also included tests for the
newer base 2 integer contants. The C file did not have any tests for
that yet.
@braewoods
Copy link
Contributor Author

I fixed the test issues with Objectice-C.

Copy link
Collaborator

@deathaxe deathaxe left a comment

Choose a reason for hiding this comment

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

Maybe following 2 meta.number tests can be extended to be inline with the other assertions. Otherwise LGTM!

Comment on lines +1177 to 1179
/* ^^^^^ constant.numeric.value.c */
/* ^^^^ invalid.illegal.numeric.suffix.c */
/* ^^^^^^ meta.number.integer.decimal.c */
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest to extend existing meta.number test to cover whole constant.

Suggested change
/* ^^^^^ constant.numeric.value.c */
/* ^^^^ invalid.illegal.numeric.suffix.c */
/* ^^^^^^ meta.number.integer.decimal.c */
/* ^^^^^^^^^^^^^^^^ meta.number.integer.decimal.c */
/* ^^^^^ constant.numeric.value.c */
/* ^^^^ invalid.illegal.numeric.suffix.c */

Comment on lines +923 to 925
/* ^^^^^ constant.numeric.value.c */
/* ^^^^ invalid.illegal.numeric.suffix.c */
/* ^^^^^^ meta.number.integer.decimal.c */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

Suggested change
/* ^^^^^ constant.numeric.value.c */
/* ^^^^ invalid.illegal.numeric.suffix.c */
/* ^^^^^^ meta.number.integer.decimal.c */
/* ^^^^^^^^^^^^^^^^ meta.number.integer.decimal.c */
/* ^^^^^ constant.numeric.value.c */
/* ^^^^ invalid.illegal.numeric.suffix.c */

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.

[C/C++] digit separators
2 participants