Commit graph

8 commits

Author SHA1 Message Date
MasFlam
e0dc018f66
Fix some left-over details in C++ syntax highlighting (#1865)
- move type cast keywords into operators, since that's their syntactic function
- fix a single dot being matched as a constant.number
- add the missing caret operator
2020-09-17 23:19:41 -04:00
MasFlam
8df921cf96
Overall syntax highlighting improvements for C++ (#1858)
* Overall syntax highlighting improvements for C++
Most of these changes are based on the information on cppreference.com;
specifically from here: https://en.cppreference.com/w/cpp/keyword
- made `identifier` actually match any identifier
- add ~ as an operator
- add `static_assert` as a keyword (statement)
- add keywords that are interchangeable with operators as operators
- add keywords `sizeof`, `alignof` and `typeid` as operators
- add the quasi-keywords `asm`, `fortran` and `final`, `override`
- add the keyword `nullptr`
- add `_Pragma` as a preprocessor keyword
- add C++20 (concepts and modules) -related keywords
- add casting keywords
- add the keyword (specifier) `noexcept`
- remove `nothrow` (because it's not any more special than `vector` is)
- add `wchar_t` and `charXX_t` types
- add cv type keywords as `type.keyword`s
- move some fitting keywords into `type.keywords`
(mostly because they appear in/near type signatures etc.)
I didn't include coroutine-related language features,
primarily because there is no good source of information
about them other than the ISO C++ standard.

* Further changes to C++ syntax highlighting
- reverted the changes to the `identifier` regex, since most
colorschemes color it the same as `type`s and/or `statement`s
- fix the 2nd `type` regex (the word boundaries were in only two pipe-options)
- move `nullptr` back into `constant.bool`,
since it looks better in-editor this way (imo)
- add `?` as an operator
- add regexes that match all the correct number literals, and nothing else
(see https://en.cppreference.com/w/cpp/language/floating_literal)
(that is, if I haven't made a mistake)
2020-09-14 00:06:47 -04:00
Ján Priner
ddc887f6e4
Highlight multicharacter escape sequences in C and C++ string literals (#1761) 2020-07-08 00:17:48 -04:00
Zachary Yedidia
47ef864295 Add skip statements to all strings 2017-03-29 09:45:16 -04:00
Zachary Yedidia
299712ead3 Add support for skipping and remove need for lookbehind 2017-03-27 20:53:08 -04:00
Zachary Yedidia
87f54be13a Add support for lookbehind in region regexes
Use the 'regexp2' library for lookahead and lookbehind in region
start and end regular expressions to support things like closing quotes
that aren't preceded by backslashes.
2017-03-22 19:03:06 -04:00
Zachary Yedidia
54bb99d758 Improve new syntax files and fix a region glitch 2017-03-21 15:07:39 -04:00
Zachary Yedidia
2fcb40d5a9 Use new syntax highlighting engine from zyedidia/highlight
This changes all the syntax files in the runtime directory and also
changes how syntax highlighting is done from inside micro.
2017-02-26 11:14:35 -05:00