-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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-likes) Macro including single < breaks because it thinks it's a string #1964
Comments
I can't make any sense of this or these links. If there is a bug with a specific language syntax please tell us which and if you could provide a jsfiddle reproducing the issue that'd be great: Template you can use: |
Ping. |
@yyyc514 really sorry for the late reply. If you do: #include "ios/chrome/browser/ui/ui_util.h"
#import <UIKit/UIKit.h>
#include "base/logging.h"
#import "ios/chrome/browser/ui/uikit_ui_util.h"
#include "ui/base/device_form_factor.h"
#include "ui/gfx/ios/uikit_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
bool IsIPadIdiom() {
return ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET;
}
const CGFloat kPortraitWidth[INTERFACE_IDIOM_COUNT] = {
320, // IPHONE_IDIOM
768 // IPAD_IDIOM
};
bool IsHighResScreen() {
return [[UIScreen mainScreen] scale] > 1.0;
}
bool IsPortrait() {
UIInterfaceOrientation orient = GetInterfaceOrientation();
// If building with an SDK prior to iOS 8 don't worry about
// UIInterfaceOrientationUnknown because it wasn't defined.
#if !defined(__IPHONE_8_0) || __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_8_0
return UIInterfaceOrientationIsPortrait(orient);
#else
return UIInterfaceOrientationIsPortrait(orient) ||
orient == UIInterfaceOrientationUnknown;
#endif // SDK
}
bool IsLandscape() {
return UIInterfaceOrientationIsLandscape(GetInterfaceOrientation());
} For example, everything from |
Are you specifying the language? If so which language? |
@yyyc514 It's objectivec. |
Can you make a fiddle that shows the issue? I gave you a template above? |
@yyyc514 ah, sorry here's the fiddle: https://jsfiddle.net/8bvgu065/ |
Thanks so much. It's the The grammar needs to be fixed to look-ahead and make sure there is actually an end > and if not to not consider it a string. Also figuring out what is and isn't allowed inside a path string might help also... ie |
This probably has connections to the other C-like grammars also. (for someone wanting to work on a fix) |
The objectivec highlighting had a few bugs and was missing a few features: - Expressions including < was misidentified as a string like <stdio.h> (fixes highlightjs#1964). - Keywords like if, else, endif, etc. were not highlighted. - The escape sequences in string literals were not parsed. - Line continuations were not parsed. - Comments were not parsed. Fix all these and pull in the preprocessor test from cpp. (This is actually objectivec's first markup test. It probably could do with tests beyond just this feature.)
The objectivec highlighting had a few bugs and was missing a few features: - Expressions with < were misidentified as a string like <stdio.h> (fixes highlightjs#1964). - Keywords like if, else, endif, etc. were not highlighted. - The escape sequences in string literals were not parsed. - Line continuations were not parsed. - Comments were not parsed. Fix all these and pull in the preprocessor test from cpp. (This is actually objectivec's first markup test. It probably could do with tests beyond just this feature.)
The objectivec highlighting had a few bugs and was missing a few features: - Expressions with < were misidentified as a string like <stdio.h> (fixes highlightjs#1964). - Keywords like if, else, endif, etc. were not highlighted. - The escape sequences in string literals were not parsed. - Line continuations were not parsed. - Comments were not parsed. Fix all these by adapting cpp's preprocessor definition. Pull in the preprocessor test from cpp. (This is actually objectivec's first markup test. It probably could do with tests beyond just this feature.)
Looks like this is specific to objectivec. The objectivec syntax definition is separate from the cpp one, with a much simpler preprocessor definition. #2265 syncs this part up. |
The objectivec highlighting had a few bugs and was missing a few features: - Expressions with < were misidentified as a string like <stdio.h> (fixes highlightjs#1964). - Keywords like if, else, endif, etc. were not highlighted. - The escape sequences in string literals were not parsed. - Line continuations were not parsed. - Comments were not parsed. Fix all these by adapting cpp's preprocessor definition. Pull in the preprocessor test from cpp. (This is actually objectivec's first markup test. It probably could do with tests beyond just this feature.)
The objectivec highlighting had a few bugs and was missing a few features: - Expressions with < were misidentified as a string like <stdio.h> (fixes #1964). - Keywords like if, else, endif, etc. were not highlighted. - The escape sequences in string literals were not parsed. - Line continuations were not parsed. - Comments were not parsed. Fix all these by adapting cpp's preprocessor definition. Pull in the preprocessor test from cpp. (This is actually objectivec's first markup test. It probably could do with tests beyond just this feature.)
See https://chromium-review.googlesource.com/c/chromium/src/+/669484/4/ios/chrome/browser/ui/ui_util.mm and https://bugs.chromium.org/p/gerrit/issues/detail?id=7248
The text was updated successfully, but these errors were encountered: