Skip to content

A C++23 implementation that may be interesting to add to the documentation #217

@w0utert

Description

@w0utert

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.

[1] https://gitlab.com/w0utert/cpparinfer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions