package reason

  1. Overview
  2. Docs
module Basics : sig ... end
include module type of struct include Basics end
exception Error
type token = Basics.token =
  1. | WITH
  2. | WHILE
  3. | WHEN
  4. | VIRTUAL
  5. | VAL
  6. | UNDERSCORE
  7. | UIDENT of string
  8. | TYPE
  9. | TRY
  10. | TRUE
  11. | TO
  12. | TILDE
  13. | THEN
  14. | SWITCH
  15. | STRUCT
  16. | STRING of string * string option
  17. | STAR
  18. | SLASHGREATER
  19. | SIG
  20. | SHARPOP of string
  21. | SHARP
  22. | SEMISEMI
  23. | SEMI
  24. | RPAREN
  25. | REC
  26. | RBRACKET
  27. | RBRACE
  28. | QUOTE
  29. | QUESTION
  30. | PUB
  31. | PRI
  32. | PREFIXOP of string
  33. | PLUSEQ
  34. | PLUSDOT
  35. | PLUS
  36. | PERCENT
  37. | OR
  38. | OPTIONAL_NO_DEFAULT
  39. | OPEN
  40. | OF
  41. | OBJECT
  42. | NONREC
  43. | NEW
  44. | NATIVEINT of nativeint
  45. | MUTABLE
  46. | MODULE
  47. | MINUSGREATER
  48. | MINUSDOT
  49. | MINUS
  50. | LPAREN
  51. | LIDENTCOLONCOLON of string
  52. | LIDENT of string
  53. | LET
  54. | LESSSLASHIDENTGREATER of string
  55. | LESSSLASHGREATER
  56. | LESSSLASH
  57. | LESSMINUS
  58. | LESSIDENT of string
  59. | LESSGREATER
  60. | LESSDOTDOTGREATER
  61. | LESS
  62. | LBRACKETPERCENTPERCENT
  63. | LBRACKETPERCENT
  64. | LBRACKETLESS
  65. | LBRACKETGREATER
  66. | LBRACKETBAR
  67. | LBRACKETATATAT
  68. | LBRACKETATAT
  69. | LBRACKETAT
  70. | LBRACKET
  71. | LBRACELESS
  72. | LBRACE
  73. | LAZY
  74. | INT of string * char option
  75. | INITIALIZER
  76. | INHERIT
  77. | INFIXOP4 of string
  78. | INFIXOP3 of string
  79. | INFIXOP2 of string
  80. | INFIXOP1 of string
  81. | INFIXOP0 of string
  82. | INCLUDE
  83. | IN
  84. | IF
  85. | GREATERRBRACE
  86. | GREATER
  87. | FUNCTOR
  88. | FUNCTION
  89. | FUN
  90. | FOR
  91. | FLOAT of string * char option
  92. | FALSE
  93. | EXTERNAL
  94. | EXCEPTION
  95. | EQUALGREATER
  96. | EQUAL
  97. | EOL
  98. | EOF
  99. | END
  100. | ELSE
  101. | DOWNTO
  102. | DOTDOTDOT
  103. | DOTDOT
  104. | DOT
  105. | DONE
  106. | DO
  107. | CONSTRAINT
  108. | COMMENT of string * Location.t
  109. | COMMA
  110. | COLONGREATER
  111. | COLONEQUAL
  112. | COLONCOLONLIDENT of string
  113. | COLONCOLON
  114. | COLON
  115. | CLASS
  116. | CHAR of char
  117. | BEGIN
  118. | BARRBRACKET
  119. | BARBAR
  120. | BAR
  121. | BANG
  122. | BACKQUOTE
  123. | ASSERT
  124. | AS
  125. | AND
  126. | AMPERSAND
  127. | AMPERAMPER
val _eRR : exn

location.ml: ------------ let mkloc txt loc = txt ; loc let rhs_loc n = loc_start = Parsing.rhs_start_pos n; loc_end = Parsing.rhs_end_pos n; loc_ghost = false; let symbol_rloc () = loc_start = Parsing.symbol_start_pos (); loc_end = Parsing.symbol_end_pos (); loc_ghost = false;

let symbol_gloc () = loc_start = Parsing.symbol_start_pos (); loc_end = Parsing.symbol_end_pos (); loc_ghost = true;

ast_helper.ml: ------------ module Typ = struct val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type let mk ?(loc = !default_loc) ?(attrs = ) d = ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs .. end

parse_tree.mli -------------- and core_type = ptyp_desc: core_type_desc; ptyp_loc: Location.t; ptyp_attributes: attributes; (* ... [@id1] [@id2] *)

and core_type_desc = | Ptyp_any (* _ *) | Ptyp_var of string (* 'a *) | Ptyp_arrow of label * core_type * core_type (* T1 -> T2 (label = "") ~l:T1 -> T2 (label = "l") ?l:T1 -> T2 (label = "?l") *) | Ptyp_tuple of core_type list (* T1 * ... * Tn (n >= 2) *)

reason_parser.mly --------------- In general:

syntax variant pblah_desc: core_blah_desc pblah_loc: {txt, loc pblah_attributes: ...

}

/ \ / \ val mkblah: ~loc -> ~attributes -> core_blah_desc -> core_blah let mkblah = Blah.mk

* change the location state to be a ghost location or real location

Make a core_type from a as_loc(LIDENT). Useful for record type punning. type props = width: int, height: int; type state = nbrOfClicks: int; type component = props, state;

val neg_string : string -> string
val syntax_error : unit -> 'a
val not_expecting : Lexing.position -> Lexing.position -> string -> 'a
val check_variable : string list -> Location.t -> string -> unit

I believe that wrap_type_annotation will automatically generate the type arguments (type a) (type b) based on what was listed before the dot in a polymorphic type annotation that uses locally abstract types.

val arity_conflict_resolving_mapper : Migrate_parsetree.OCaml_404.Ast.Ast_mapper.mapper
val default_mapper_chain : unit -> Migrate_parsetree.OCaml_404.Ast.Ast_mapper.mapper list
val string_of_longident : Migrate_parsetree.OCaml_404.Ast.Longident.t -> string
val built_in_explicit_arity_constructors : string list
type object_record =
  1. | Object_open
  2. | Object_closed
  3. | Record
val only_labels : ('a * 'b list) list -> 'a list
module Tables : sig ... end
module MenhirInterpreter : sig ... end
module Incremental : sig ... end
OCaml

Innovation. Community. Security.