Closed ddickstein closed 3 hours ago
Why is expression_item allowed to appear directly at the top level / in a structure? I might not be thinking of an edge case but ordinarily expressions should appear under value definitions.
expression_item
https://github.com/tree-sitter/tree-sitter-ocaml/blob/5f7a97e9757d8afe6c0b0b5dd8734cf59f35456e/grammars/ocaml/grammar.js#L104-L108
OCaml allows top level expressions. It's not considered to be a good practice, but it's valid code, so tree-sitter-ocaml has to parse it.
Why is
expression_item
allowed to appear directly at the top level / in a structure? I might not be thinking of an edge case but ordinarily expressions should appear under value definitions.https://github.com/tree-sitter/tree-sitter-ocaml/blob/5f7a97e9757d8afe6c0b0b5dd8734cf59f35456e/grammars/ocaml/grammar.js#L104-L108