Skip to content

Commit

Permalink
fix: bug with 'and'
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Dec 17, 2012
1 parent c557575 commit 8dcf257
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/block.ml
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ let rec update_path t stream tok =

| AND ->
let unwind_to = function
| KLet | KLetIn | KBody(KLet|KLetIn) | KType | KModule
| KLet | KLetIn | KBody(KLet|KLetIn|KAnd(KLet|KLetIn))
| KType | KModule
| KWith(KType|KModule) | KAnd(KWith(KType|KModule)) -> true
| _ -> false
in let path = unwind unwind_to t.path in
Expand Down Expand Up @@ -664,7 +665,8 @@ let rec update_path t stream tok =
| EQUAL ->
let unwind_to = function
| KParen | KBrace | KBracket | KBracketBar | KBody _
| KExternal | KModule | KType | KLet | KLetIn -> true
| KExternal | KModule | KType | KLet | KLetIn
| KAnd(KModule|KType|KLet|KLetIn) -> true
| _ -> false
in let path = unwind unwind_to t.path in
(match path with
Expand Down
5 changes: 0 additions & 5 deletions tests/core-failing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ include struct
end


let _ =
let f x =
bla
and g x =
bli
let mem { ar; cmp } el =
let len = Array.length ar in
len > 0 &&
Expand Down
9 changes: 8 additions & 1 deletion tests/core-passing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,11 @@ let should_check_can_sell_and_marking regulatory_regime =
let _ =
invalid_arg
(sprintf "Dequeue.%s: index %i is not in [%d, %d]"
fname i (front_index buf) (back_index buf))
fname i (front_index buf) (back_index buf))

let _ =
let f x =
bla
and g x =
bli

0 comments on commit 8dcf257

Please sign in to comment.