The idea is to provide a complement to ocp-indent to decide which token should be separated by whitespace and which should not. For now it is based only on lexing information, which make the code simple but also does not always provide enough information to have a nice formatting.
The project itself is formatted with ocamlformat, and in the there is a diff of what this changes compared to ocamlformat, on the main source file.
I think this approach could be improved by having a hybrid ast-token stream datastructure. Something where you work on a stream of token but you can query the AST context of a given token.
I am not sure what the issue is for semantic action and ocamlformat, it should work without big issues provided the actions are valid expressions which they usually are. There is some work to be done to extract them and give them to ocamlformat but I would expect this to not be too hard.
But yes this would also work without issue, and you don’t need to have valid expressions, just no lexical errors
Some people like using ocp-indent which only affect indentation.
The reasons for this are various, sometimes its just taste, or an old codebase that has never been indented. Another upside to this approach is that you can format even with syntax errors, because you only needs the lexer. This is nice when writing code, you can format as you go instead of having to fix the syntax every time.
That being said I like ocamlformat better, but I have coworkers who disagree and I was trying to improve their workflow.