Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Hongbo Zhang committed Jul 6, 2016
1 parent 0dcf843 commit 9a49b79
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 232 deletions.
15 changes: 7 additions & 8 deletions jscomp/syntax/ast_attributes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,21 @@ let process_method_attributes_rev (attrs : t) =


let process_attributes_rev (attrs : t) =
List.fold_left (fun (acc, st) attr ->
let tag = fst attr in
match tag.Location.txt, st with
List.fold_left (fun (st, acc) (({txt; loc}, _) as attr : attr) ->
match txt, st with
| "bs", (`Nothing | `Uncurry)
->
(acc, `Uncurry)
`Uncurry, acc
| "bs.this", (`Nothing | `Meth)
-> (acc, `Meth)
-> `Meth, acc
| "bs", `Meth
| "bs.this", `Uncurry
-> Location.raise_errorf
~loc:tag.Location.loc
~loc
"[@bs.this] and [@bs] can not be applied at the same time"
| _ , _ ->
(attr::acc , st)
) ([], `Nothing) attrs
st, attr::acc
) ( `Nothing, []) attrs


let bs_obj : attr
Expand Down
2 changes: 1 addition & 1 deletion jscomp/syntax/ast_attributes.mli
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ val process_method_attributes_rev :
(Parsetree.payload, Parsetree.payload) st * t

val process_attributes_rev :
t -> t * [ `Meth | `Nothing | `Uncurry ]
t -> [ `Meth | `Nothing | `Uncurry ] * t

val bs_obj : attr
val bs : attr
Expand Down

0 comments on commit 9a49b79

Please sign in to comment.