package reason

  1. Overview
  2. Docs
Reason: Syntax & Toolchain for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

reason-3.12.0.tbz
sha256=63d950affbe203701a3d4c076a2750b56211bae7017cd8f59da508efb09a1afe
sha512=3ed24f4567dcf2ef2c05cec45fae18da2b9a78dab098a8e97e6430aaed4c8e3f659c7a5ccab88bce498c4b3d3cd54b01e72b2be4fefdf9f3bfcc2c8eb7fd86d4

doc/reason/Reason_toolchain/index.html

Module Reason_toolchainSource

* Provides a simple interface to the most common parsing entrypoints required * by editor/IDE toolchains, preprocessors, and pretty printers. * * The form of this entrypoint includes more than what the standard OCaml * toolchain (oprof/ocamldoc) expects, but is still compatible. * * implementation_with_comments and interface_with_comments includes * additional information (about comments) suitable for building pretty * printers, editor, IDE and VCS integration. * * The comments include the full text of the comment (typically in between the * "(*" and the "*)", as well as location information for that comment. * * WARNING: The "end" location is one greater than the actual final position! * (for both associatedTextLoc and commentLoc). * * Currently, the location information for comments is of the form: * * (associatedTextLoc) * * But we should quickly change it to be of the form: * * (associatedTextLoc, commentLoc) * * Where the commentLoc is the actual original location of the comment, * and the associatedTextLoc records the location in the file that the * comment is attached to. If associatedTextLoc and commentLoc are the * same, then the comment is "free floating" in that it only attaches to itself. * The Reason pretty printer will try its best to interleave those comments * in the containing list etc. But if associatedTextLoc expands beyond * the commentLoc it means the comment and the AST that is captured by * the associatedTextLoc are related - where "related" is something * this reason_toolchain decides (but in short it handles "end of line * comments"). Various pretty printers can decide how to preserve this * relatedness. Ideally, it would preserve end of line comments, but in the * short term, it might merely use that relatedness to correctly attach * end of line comments to the "top" of the AST node. * * let lst = * * ; (* Comment *) * ----commentLoc----- * ---associatedTextLoc---- * * * Ideally that would be formatted as: * * let lst = * * ; (* Comment *) * * Or: * * let lst = ; (* Comment *) * * * But a shorter term solution would use that associatedTextLoc to at least * correctly attach the comment to the correct node, even if not "end of line". * * (* Comment *) * let lst = ;

Sourcemodule Comment = Reason_comment
Sourceval setup_lexbuf : bool -> string -> Lexing.lexbuf
Sourceval left_expand_comment : bool -> string -> int -> char * bool * int
Sourceval right_expand_comment : bool -> string -> int -> char * bool * int
Sourcemodule ML : sig ... end
Sourcemodule RE : sig ... end
OCaml

Innovation. Community. Security.