ecode icon indicating copy to clipboard operation
ecode copied to clipboard

Support modern C++ syntax for integer literals

Open Curculigo opened this issue 1 year ago • 1 comments

It will always treat ' as the beginning or ending of character literals.

https://en.cppreference.com/w/cpp/language/integer_literal

Curculigo avatar Jul 26 '24 16:07 Curculigo

This is currently not possible to implement safely. But... with LSP semantic highlighting enabled, LSP could potentially implement the correct semantic highlighting but clangd does not support this at least for the moment.

SpartanJ avatar Jul 27 '24 23:07 SpartanJ

Implemented the capability to add custom parsers to the syntax tokenizer and added an specific parser for C and C++ numbers which adds support for integer literals (and more). Implementation here. This is ~250 times faster than implementing it with regular expressions 🤯.

Example: Image

SpartanJ avatar Mar 28 '25 05:03 SpartanJ