Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro committed Aug 16, 2023
1 parent 5be09fb commit e4785d1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions jscomp/syntax/src/res_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,7 @@ and parseBracketAccess p expr startPos =
Parser.eatBreadcrumb p;
let rbracket = p.prevEndPos in
let arrayLoc = mkLoc lbracket rbracket in
let attr = (Location.mkloc "res.syntaxSugar" arrayLoc, Parsetree.PStr []) in
match p.token with
| Equal ->
Parser.leaveBreadcrumb p ExprArrayMutation;
Expand All @@ -2014,10 +2015,6 @@ and parseBracketAccess p expr startPos =
Location.mkloc (Longident.Ldot (Lident "Array", "set")) arrayLoc
in
let endPos = p.prevEndPos in
let attr =
( Location.mkloc "res.syntaxSugar" (mkLoc startPos endPos),
Parsetree.PStr [] )
in
let arraySet =
Ast_helper.Exp.apply ~loc:(mkLoc startPos endPos)
(Ast_helper.Exp.ident ~loc:arrayLoc arraySet ~attrs:[attr])
Expand All @@ -2027,10 +2024,6 @@ and parseBracketAccess p expr startPos =
arraySet
| _ ->
let endPos = p.prevEndPos in
let attr =
( Location.mkloc "res.syntaxSugar" (mkLoc startPos endPos),
Parsetree.PStr [] )
in
let e =
Ast_helper.Exp.apply ~loc:(mkLoc startPos endPos)
(Ast_helper.Exp.ident ~loc:arrayLoc ~attrs:[attr]
Expand Down

0 comments on commit e4785d1

Please sign in to comment.