]> git.lizzy.rs Git - micro.git/commit
Overall syntax highlighting improvements for C++ (#1858)
authorMasFlam <masterflamaster46@gmail.com>
Mon, 14 Sep 2020 04:06:47 +0000 (06:06 +0200)
committerGitHub <noreply@github.com>
Mon, 14 Sep 2020 04:06:47 +0000 (00:06 -0400)
commit8df921cf96b2685a36be8782f933fdc03204642f
tree25299d72ca37dc089b3c1b766d685d151f02bd0b
parent067f08c56ed8d0bab498b4484a14d8d77cdcb354
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)
runtime/syntax/cpp.yaml