Legend:
Library
Module
Module type
Parameter
Class
Class type
val is_prefixed : string ->string ->int -> bool
is_prefixed prefix i str checks if prefix is the prefix of str * starting from position i
val pick_while : ('a-> bool)->'a list->'a list * 'a list
* pick_while returns a tuple where first element is longest prefix (possibly empty) of the list of elements that satisfy p * and second element is the remainder of the list
val find_substring : string ->string ->int -> int
find_substring sub str i returns the smallest j >= i such that sub = str.[j..length sub - 1] raises Not_found if there is no such j behavior is not defined if sub is the empty string
val replace_string : string ->string ->string -> string
replace_string old_str new_str str replaces old_str to new_str in str
val split_by : ?keep_empty:bool ->(char -> bool)->string ->string list
Generate a suitable extension node for Merlin's consumption, for the purposes of reporting a syntax error - only used in recovery mode.
val potentially_conflicts_with : keyword:string ->string -> bool
Check to see if the string `s` is made up of `keyword` and zero or more trailing `_` characters.
val string_add_suffix : string -> string
Add/remove an appropriate suffix when mangling potential keywords
val string_drop_suffix : string -> string
What do these *_swap functions do? Here's an example: Reason code uses `!` for logical not, while ocaml uses `not`. So, for converting between reason and ocaml syntax, ocaml `not` converts to `!`, reason `!` converts to `not`.
In more complicated cases where a reserved keyword exists in one syntax but not the other, these functions translate any potentially conflicting identifier into the same identifier with a suffix attached, or remove the suffix when converting back. Two examples:
reason to ocaml:
pub: invalid in reason to begin with pub_: pub pub__: pub_
ocaml to reason:
pub: pub_ pub_: pub__ pub__: pub___
=====
reason to ocaml:
match: match_ match_: match__ match__: match___
ocaml to reason:
match: invalid in ocaml to begin with match_: match match__: match_
identifier_mapper maps all identifiers in an AST with a mapping function f this is used by swap_operator_mapper right below, to traverse the whole AST and swapping the symbols listed above.
val apply_mapper_to_structure :
Migrate_parsetree__Ast_404.Parsetree.structure_item list->Ast_404.Ast_mapper.mapper->Migrate_parsetree__Ast_404.Parsetree.structure_item list
val apply_mapper_to_signature :
Migrate_parsetree__Ast_404.Parsetree.signature_item list->Ast_404.Ast_mapper.mapper->Migrate_parsetree__Ast_404.Parsetree.signature_item list
val apply_mapper_to_type :
Migrate_parsetree__Ast_404.Parsetree.core_type->Ast_404.Ast_mapper.mapper->Migrate_parsetree__Ast_404.Parsetree.core_type
val apply_mapper_to_expr :
Migrate_parsetree__Ast_404.Parsetree.expression->Ast_404.Ast_mapper.mapper->Migrate_parsetree__Ast_404.Parsetree.expression
val apply_mapper_to_pattern :
Migrate_parsetree__Ast_404.Parsetree.pattern->Ast_404.Ast_mapper.mapper->Migrate_parsetree__Ast_404.Parsetree.pattern