-
Notifications
You must be signed in to change notification settings - Fork 30
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 objective-C and objective-C++ to not inherit #107
Comments
Once this is done we can clean up/remove the |
For reference:
|
The objective-c grammar includes
The objective-C++ grammar includes |
Wow I think that means the C language was being double included on Objective-C++ (once inside C++ and again inside Objective-C) |
having both This would require modifying the objective-c includes. |
I was thinking about doing something like that, but I think it doesn't really fix the case when the language spec diverges, or when there are generally complicated ways of matching things in Textmate. For example Objective C could break the assumptions we made about |
Although I guess it is true that Objective-C is a strict superset of C (unlike C++) I still think there is times where the TextMate syntax of one will screw up the TextMate syntax of the other because of priority matching. |
yeah, it's a strict superset so
|
well, https://github.com/GrinCash/Grinc-core/blob/1377979453ba84082f70f9c128be38e57b65a909/depends/work/build/i686-w64-mingw32/qt/5.9.7-f2560c1efa6/qtbase/src/testlib/qxctestlogger.mm#L135 shows that Objective-C++ is not a strict superset of C++. |
So assuming that Objective-C++ continues to extend c++ |
I had enough time today to redo a bit of the fundamentals of the Grammar object. I changed the way it saves patterns/ranges so that they can be shared more easily now. I also changed the $base. You can now use I left in the Sadly didn't have enough time to look into the Objective C repo, but this should get us a step closer. |
Objective C and C++ don't inherit now, right? So it should be safe to set the default for |
Sorta, I'm going to see if VS Code will pull Objective-C and Objective-C++. If they only pull C++ and C then we're going to have a problem. I'm going to talk to Alex tomorrow |
Other languages (Objective-C, Objective-C++) include the C and C++ syntax
What is the issue?
These other languages assume the C and C++ syntax use this thing
$base
that says "re-include every single pattern, and (if inside another language) only re-include all of that other languages patterns". Objective-C++ makes the assumption that basically every C++ namespace/struct/function/class/if/else etc uses$base
inside of it.Why is this a bad assumption?
This is unfixable because of the Objective-C++ and Objective-C dependency.
Importing C++ is a bad assumption for Objective-C++ in particular because there are C++ constructs that are not allowed in Objective-C++ (Objective-C++ is not a superset of C++). Including the entire C++ language as the highest-priority group is requiring that the C++ syntax be incomplete for the Objective-C++ syntax to be correct.
$base
is harmful even within C++Because of the Objective C++ dependency, we are knowingly having to include incorrect patterns within C++, which is stopping us from adding support for major features like highlighting of variables and types.
What is the solution?
It is easy to make the Objective-C++ syntax not depend on C++, by importing the valid pieces of C++ syntax into Objective-C++. This would mean C++ improvements would never affect Objective-C++, and it means we can finally start using C++ inside of markup.
The text was updated successfully, but these errors were encountered: