Skip to content

Commit

Permalink
snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed Sep 17, 2024
1 parent d9e3642 commit a5ad8fc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions jscomp/syntax/src/res_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ let suppress_fragile_match_warning_attr =
] )
let make_braces_attr loc = (Location.mkloc "res.braces" loc, Parsetree.PStr [])
let template_literal_attr = (Location.mknoloc "res.template", Parsetree.PStr [])
let makePatVariantSpreadAttr =
let make_pat_variant_spread_attr =
(Location.mknoloc "res.patVariantSpread", Parsetree.PStr [])

let tagged_template_literal_attr =
Expand Down Expand Up @@ -1083,7 +1083,7 @@ let rec parse_pattern ?(alias = true) ?(or_ = true) p =
Parser.next p;
let ident = parse_value_path p in
let loc = mk_loc start_pos ident.loc.loc_end in
Ast_helper.Pat.type_ ~loc ~attrs:(makePatVariantSpreadAttr :: attrs) ident
Ast_helper.Pat.type_ ~loc ~attrs:(make_pat_variant_spread_attr :: attrs) ident
| Hash -> (
Parser.next p;
if p.Parser.token == DotDotDot then (
Expand Down
2 changes: 1 addition & 1 deletion jscomp/syntax/src/res_parsetree_viewer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ let has_await_attribute attrs =
| _ -> false)
attrs

let hasResPatVariantSpreadAttribute attrs =
let has_res_pat_variant_spread_attribute attrs =
List.exists
(function
| {Location.txt = "res.patVariantSpread"}, _ -> true
Expand Down
2 changes: 1 addition & 1 deletion jscomp/syntax/src/res_parsetree_viewer.mli
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ val process_function_attributes :
Parsetree.attributes -> function_attributes_info

val has_await_attribute : Parsetree.attributes -> bool
val hasResPatVariantSpreadAttribute : Parsetree.attributes -> bool
val has_res_pat_variant_spread_attribute : Parsetree.attributes -> bool

type if_condition_kind =
| If of Parsetree.expression
Expand Down
3 changes: 2 additions & 1 deletion jscomp/syntax/src/res_printer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,8 @@ and print_pattern ~state (p : Parsetree.pattern) cmt_tbl =
Doc.group (Doc.concat [variant_name; args_doc])
| Ppat_type ident ->
let prefix =
if ParsetreeViewer.hasResPatVariantSpreadAttribute p.ppat_attributes
if
ParsetreeViewer.has_res_pat_variant_spread_attribute p.ppat_attributes
then ""
else "#"
in
Expand Down

0 comments on commit a5ad8fc

Please sign in to comment.