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

Remove multiline tokens #194

Closed hnrgrgr closed 8 years ago

hnrgrgr commented 8 years ago

This PR removes all multiline tokens, and it introduces all EOL token explicit. This allows to greatly simplify the the lexer and the "printer", while not adding so much complexity in IndentBlock.

AltGr commented 8 years ago

Thanks a lot, and sorry for the delay!

I merged the branch at eol_lexer ; however, I could notice a bug by trying on ocp-indent-tests -- it seems related to comments at EOL.

let vmpp_snapshot_lock_failed = addMessage "VMPP_SNAPSHOT_LOCK_FAILED" 3L (*'The snapshot phase is already executing for this protection policy. Please try again later'*)                              
let vmpp_snapshot_succeeded = addMessage "VMPP_SNAPSHOT_SUCCEEDED" 5L (*'Successfully performed the snapshot phase of the protection policy'*)

gets indented as

let vmpp_snapshot_lock_failed = addMessage "VMPP_SNAPSHOT_LOCK_FAILED" 3L (*'The snapshot phase is already executing for this protection policy. Please try again later'*)                              
                                                                            let vmpp_snapshot_succeeded = addMessage "VMPP_SNAPSHOT_SUCCEEDED" 5L (*'Successfully performed the snapshot phase of the protection policy'*)
AltGr commented 8 years ago

Thanks!