Closed Bug 1478738 Opened 8 years ago Closed 8 years ago

Searchfox doesn't understand C++14 digit separators yet

Categories

(Webtools :: Searchfox, enhancement)

enhancement
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Waldo, Assigned: kats)

References

()

Details

Searchfox prettyprints C++ text that contains C++14 digit separators -- that is, single quotes embedded within numbers -- as if the separators were really some sort of string delimiter, resulting in something like uint8_t a = 0b1100'1111; uint8_t b = 0b0111'1111; having all text from the first ' to the second ' be colored (currently) green. It instead should understand digit separators as merely another part of the surrounding numeric literal. Filing in the Searchfox component for now 'cause that's where I see this, but I could imagine it really residing in whatever sub-component Searchfox uses to determine the structure of C++ text, but I don't know what that component might actually be.
Do you have an example of this in m-c?
The URL field has an example from mfbt/Utf8.h
From a glance through the code it looks like the is_ident loop at [1] gets used to parse numbers too? In which case we might need to special case this c++14 syntax there. [1] https://github.com/mozsearch/mozsearch/blob/e014d6831c80b3d77b9647195a3e71f200b57374/tools/src/tokenize.rs#L255
Why does a clang-based tool reimplement C++ lexing?
The syntax highlighting code is independent of the c++ code indexer. One of the advantages of this is it can do syntax highlighting of C++ code that doesn't get built.
This is deployed now.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.