Js_parser.Comment_attachment
module Ast = Flow_ast
class +'a trailing_comments_remover : after_pos:Loc.position -> object ... end
type trailing_and_remover_result = {
trailing : Loc.t Flow_ast.Comment.t list;
remove_trailing : 'a. 'a ->
(Loc.t trailing_comments_remover -> 'a -> 'a) ->
'a;
}
val trailing_and_remover_after_last_loc :
Parser_env.env ->
trailing_and_remover_result
val trailing_and_remover_after_last_line :
Parser_env.env ->
trailing_and_remover_result
val trailing_and_remover : Parser_env.env -> trailing_and_remover_result
val id_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Identifier.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Identifier.t
val expression_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Expression.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Expression.t
val block_remove_trailing :
Parser_env.env ->
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Statement.Block.t) ->
Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Statement.Block.t
val type_params_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.TypeParams.t option ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.TypeParams.t option
val type_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.t
val type_annotation_hint_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.annotation_or_hint ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.annotation_or_hint
val component_renders_annotation_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t)
Js_parser.Flow_ast_mapper.Ast.Type.component_renders_annotation ->
(Loc.t, Loc.t)
Js_parser.Flow_ast_mapper.Ast.Type.component_renders_annotation
val return_annotation_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Function.ReturnAnnot.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Function.ReturnAnnot.t
val function_params_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Function.Params.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Function.Params.t
val component_params_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t)
Js_parser.Flow_ast_mapper.Ast.Statement.ComponentDeclaration.Params.t ->
(Loc.t, Loc.t)
Js_parser.Flow_ast_mapper.Ast.Statement.ComponentDeclaration.Params.t
val component_type_params_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Component.Params.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Component.Params.t
val predicate_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Predicate.t option ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Predicate.t option
val object_key_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Expression.Object.Property.key ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Expression.Object.Property.key
val generic_type_remove_trailing :
Parser_env.env ->
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Generic.t) ->
Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Generic.t
val generic_type_list_remove_trailing :
Parser_env.env ->
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Generic.t) list ->
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Generic.t) list
val class_implements_remove_trailing :
Parser_env.env ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Class.Implements.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Class.Implements.t
val string_literal_remove_trailing :
Parser_env.env ->
(Loc.t * Loc.t Js_parser.Flow_ast_mapper.Ast.StringLiteral.t) ->
Loc.t * Loc.t Js_parser.Flow_ast_mapper.Ast.StringLiteral.t
val statement_add_comments :
(Loc.t, Loc.t) Flow_ast.Statement.t ->
(Loc.t, unit) Flow_ast.Syntax.t option ->
(Loc.t, Loc.t) Flow_ast.Statement.t
class +'a comment_bounds_collector : loc:Loc.t -> object ... end
val comment_bounds :
Loc.t ->
'a ->
(Loc.t comment_bounds_collector -> 'a -> 'b) ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Js_parser__Flow_ast.Comment.t') option
val comment_bounds_without_trailing_line_comment :
('a * ('b * Ast.Comment.t') option) ->
'a * ('b * Ast.Comment.t') option
val collect_without_trailing_line_comment :
< comment_bounds : 'a * ('b * Ast.Comment.t') option.. > ->
'a * ('b * Ast.Comment.t') option
val statement_comment_bounds :
(Loc.t, Loc.t) Flow_ast.Statement.t ->
Loc.t Flow_ast.Comment.t option * Loc.t Flow_ast.Comment.t option
val object_property_comment_bounds :
(Loc.t, Loc.t) Ast.Expression.Object.property ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val object_type_property_comment_bounds :
(Loc.t, Loc.t) Ast.Type.Object.property ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val object_pattern_property_comment_bounds :
Loc.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Pattern.Object.property ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val function_param_comment_bounds :
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Function.Param.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val function_rest_param_comment_bounds :
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Function.RestParam.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val function_this_param_comment_bounds :
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Function.ThisParam.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val function_type_param_comment_bounds :
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Function.Param.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val function_type_rest_param_comment_bounds :
(Loc.t
* (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Function.RestParam.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val function_type_this_param_comment_bounds :
(Loc.t
* (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Function.ThisParam.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val component_param_comment_bounds :
(Loc.t
* (Loc.t, Loc.t)
Js_parser.Flow_ast_mapper.Ast.Statement.ComponentDeclaration.Param.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val component_rest_param_comment_bounds :
(Loc.t
* (Loc.t, Loc.t)
Js_parser.Flow_ast_mapper.Ast.Statement.ComponentDeclaration.RestParam.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val component_type_param_comment_bounds :
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Component.Param.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val component_type_rest_param_comment_bounds :
(Loc.t
* (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.Component.RestParam.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val array_element_comment_bounds :
Loc.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Expression.Array.element ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val array_pattern_element_comment_bounds :
Loc.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Pattern.Array.element ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val expression_or_spread_comment_bounds :
Loc.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Expression.expression_or_spread ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val call_type_arg_comment_bounds :
Loc.t ->
(Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Expression.CallTypeArg.t ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val type_param_comment_bounds :
(Loc.t * (Loc.t, Loc.t) Js_parser.Flow_ast_mapper.Ast.Type.TypeParam.t') ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Ast.Comment.t') option
val function_body_comment_bounds :
(Loc.t, Loc.t) Ast.Function.body ->
(Loc.t * Js_parser__Flow_ast.Comment.t') option
* (Loc.t * Js_parser__Flow_ast.Comment.t') option