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 more standard types from ISO C #4076

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

Conversation

braewoods
Copy link
Contributor

This adds the types defined by stddef.h, wchar.h, and uchar.h. Some of these types were first defined by C++ but are now defined by C11 or C23 so we will defer to C instead now.

@michaelblyons
Copy link
Collaborator

Did you intend to remove the types from C++?

@braewoods
Copy link
Contributor Author

Did you intend to remove the types from C++?

Yes. C++, etc, will inherit from the C syntax now instead, or at least that was the idea. It's why I removed the assertions that will no longer work with this change. I thought it would be better to just have these in one place since they're shared between a total of 4 syntax families related to C.

@michaelblyons
Copy link
Collaborator

The inheritance isn't set up. People just muse about how it should be.

@braewoods
Copy link
Contributor Author

braewoods commented Oct 31, 2024

The inheritance isn't set up. People just muse about how it should be.

It isn't? I thought it was given that changes I made to C were also showing up in Objective-C, etc.

@michaelblyons
Copy link
Collaborator

Where are you getting Obj-C from?

@braewoods
Copy link
Contributor Author

Where are you getting Obj-C from?

I have both the C++ and Objective-C packages from this repository overriding the builtin ones in my Sublime Text. I noted that anything new that I've been adding syntax highlighting for to C.sublime-syntax would also show up for C++, Objective-C, and Objective-C++ syntax languages. So that's why I thought it was being inherited.

@deathaxe
Copy link
Collaborator

C is indeed the base syntax for C++, Objective-C and Objective-C++. They don't yet use inheritance but include common contexts from C to share contexts/rules.

Even though patterns/contexts are implemented modified only in C, we still should add relevant assertions to all 4 syntax test files so we can be sure this kind of pattern sharing works or doesn't get broken by any future change.

@braewoods
Copy link
Contributor Author

Even though patterns/contexts are implemented modified only in C, we still should add relevant assertions to all 4 syntax test files so we can be sure this kind of pattern sharing works or doesn't get broken by any future change.

So then how do you update the tests for the other languages over time? I noticed a lot was previously shared but not necessarily up to date with the one it originally copied from.

@deathaxe
Copy link
Collaborator

The update of tests is a manual copy & paste process, one of the reasons for possible inconsistency. More over C family syntax definitions and tests are rather a unsorted collection of arbritary contributors' changes.

Thus entropy of a possibly initial structure of contexts and tests has grown over time.

@braewoods
Copy link
Contributor Author

The update of tests is a manual copy & paste process, one of the reasons for possible inconsistency. More over C family syntax definitions and tests are rather a unsorted collection of arbritary contributors' changes.

Thus entropy of a possibly initial structure of contexts and tests has grown over time.

For this PR, I can just replace the removed tests with the new one from C if that helps. Given what you've told me, I think I will review the tests and try to rewrite them off the C one once I am finished with my whole set of revisions.

This adds the types defined by stddef.h, wchar.h, and uchar.h.
Some of these types were first defined by C++ but are now defined
by C11 or C23 so we will defer to C instead now.
@braewoods
Copy link
Contributor Author

Ok. I've revised the syntax tests for the other shared languages.

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