-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Hi,
I recently wrote a C++23 implementation of the parinfer algorithm which may be interesting to mention & link in the documentation, it is called cpparinfer and you can find it here [1]
This implementation could be useful to people who want to integrate parinfer into a C++ application or with a little bit of additional effort some other compiled langue. Of note is that I implemented the algorithm from scratch without trying to copy or even look at the original JavaScript implementation. As a result, cpparinfer works a bit differently from parinfer.js as it does not operate on the character-level, but first tokenizes the input, then indent mode and paren mode operate directly on that without having to do any kind of string manipulation.
cpparinfer implements (and passes ;-) all parinfer.js indent mode and paren mode test cases except those that cover features that are not implemented yet, which are (as far as I know) only custom paren-, and comment chars, returning tab stops, and smart mode. I will probably implement these later except for smart mode as it is not really clear to me whether smart mode is still an experimental feature or that is actually considered useful & stable.