Skip to content

Commit

Permalink
Fix parsing ml files
Browse files Browse the repository at this point in the history
  • Loading branch information
romanschejbal committed Nov 21, 2019
1 parent c949007 commit dfd42fc
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/reason-parser/reason_pprint_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6500,14 +6500,13 @@ let printer = object(self:'self)
(self#core_type vd.pval_type)
in
let primDecl =
if vd.pval_prim = [(vd.pval_name).txt]
then lblBefore
else
(let frstHalf = makeList ~postSpace:true [lblBefore; atom "="] in
let sndHalf =
makeSpacedBreakableInlineList
(List.map self#constant_string vd.pval_prim) in
label ~space:true frstHalf sndHalf)
match vd.pval_prim with
| [""] -> lblBefore
| _ when vd.pval_prim = [vd.pval_name.txt] -> lblBefore
| _ ->
let frstHalf = makeList ~postSpace:true [lblBefore; atom "="] in
let sndHalf = makeSpacedBreakableInlineList (List.map self#constant_string vd.pval_prim) in
label ~space:true frstHalf sndHalf
in
match vd.pval_attributes with
| [] -> primDecl
Expand Down

0 comments on commit dfd42fc

Please sign in to comment.