OCamlPro / ocp-indent

Indentation tool for OCaml, to be used from editors like Emacs and Vim.
http://www.typerex.org/ocp-indent.html
Other
200 stars 63 forks source link

Identifier "TEST" is not indented correctly #310

Open wildptr opened 3 years ago

wildptr commented 3 years ago

Running ocp-indent on the following piece of code

          let inst =
            match op with
            | OP_TEST ->
              TEST (r1, o2)
            | _ -> CMP (r1, o2)
          in

yields

          let inst =
            match op with
            | OP_TEST ->
        TEST (r1, o2)
           | _ -> CMP (r1, o2)
        in

which is totally messed up. However, constructor names other than TEST do not seem to trigger this weird behavior.

ocp-indent --version: 1.8.1

wildptr commented 3 years ago

I see that ocp-indent recognizes "TEST" as a preprocessor directive here. It would be nice if we add a configuration option that allows the user to turn off recognition of preprocessor directives when no preprocessor is being used.

yminsky commented 3 years ago

I think the support of TEST should just be deleted. This is a hangover from the bad-old camlp4 days.