colis-anr / morbig

A static parser for POSIX Shell
Other
192 stars 8 forks source link

Split CST and derivings (with an OCaml splitter) #128

Closed Niols closed 3 years ago

Niols commented 3 years ago

Same as #126 except the splitter has been rewritten in OCaml. This does not make the compilation faster or clearer. It does allow for a better documentation of the process (in particular, the regexp can be split and documented in tiny bits). More importantly, it fixes the compilation on Windows, which we will see once we integrate the new CI (see #127).

We have to choose between this PR, #126 or none of the two if we don't validate the concept. @yurug, WDYT?

Niols commented 3 years ago

The other idea that I had in the meantime was to write a tiny custom PPX just for the compilation of this CST file. This would avoid a textual manipulation of the type definitions and make this part of the code more robust. I can give it a try and open yet another PR. We'd have to choose between the approaches:

  1. Textual manipulations by a Shell script (#126)
  2. Textual manipulations by an OCaml executable (this PR #128)
  3. Parsetree manipulations by an OCaml executable (future work)
  4. Any other idea.

What do you think would be preferable? I would say 2. is better than 1., but maybe 3. is better than both and I should just do that?

yurug commented 3 years ago

@Niols Can you please rebase your branch on top of master to check that the new CI is green?

Gitlab offers a rebase button but Github, unfortunately, does not.

Niols commented 3 years ago

Just rebased master into this PR. I had already checked the CI so it should be all green unless I did something very wrong!

Niols commented 3 years ago

All green!