Add another nesting test
@@ -540,6 +540,83 @@ func a b =
)
)
+=====================================
+Nested case are all closed?
+=====================================
+
+func a b =
+ case a of
+ Nothing ->
+ case b of
+ 1 ->
+ ""
+ 2 ->
+ ""
+ 3 ->
+ case b of
+ 1 ->
+ ""
+ 2 ->
+ ""
+ 3 ->
+ case b of
+ 1 ->
+ ""
+ 2 ->
+ ""
+ 3 ->
+ ""
+
+---
+
+
+(file
+ (value_declaration
+ (function_declaration_left
+ (lower_case_identifier)
+ (lower_pattern (lower_case_identifier))
+ (lower_pattern (lower_case_identifier))
+ )
+ (eq)
+ (case_of_expr
+ (case)
+ (value_expr (value_qid (lower_case_identifier)))
+ (of)
+ (case_of_branch
+ (pattern (union_pattern (upper_case_qid (upper_case_identifier))))
+ (arrow)
+ (case_of_expr
+ (case)
+ (value_expr (value_qid (lower_case_identifier)))
+ (of)
+ (case_of_branch
+ (pattern (number_constant_expr (number_literal)))
+ (arrow)
+ (string_constant_expr (open_quote) (close_quote))
+ )
+ (case_of_branch
+ (pattern (number_constant_expr (number_literal)))
+ (arrow)
+ (string_constant_expr (open_quote) (close_quote))
+ )
+ (case_of_branch
+ (pattern (number_constant_expr (number_literal)))
+ (arrow)
+ (case_of_expr (case) (value_expr (value_qid (lower_case_identifier))) (of)
+ (case_of_branch (pattern (number_constant_expr (number_literal))) (arrow) (string_constant_expr (open_quote) (close_quote)))
+ (case_of_branch (pattern (number_constant_expr (number_literal))) (arrow) (string_constant_expr (open_quote) (close_quote)))
+ (case_of_branch (pattern (number_constant_expr (number_literal))) (arrow) (case_of_expr (case)
+ (value_expr (value_qid (lower_case_identifier))) (of)
+ (case_of_branch (pattern (number_constant_expr (number_literal))) (arrow) (string_constant_expr (open_quote) (close_quote)))
+ (case_of_branch (pattern (number_constant_expr (number_literal))) (arrow) (string_constant_expr (open_quote) (close_quote)))
+ (case_of_branch (pattern (number_constant_expr (number_literal))) (arrow) (string_constant_expr (open_quote) (close_quote))))))
+ )
+ )
+ )
+ )
+ )
+)
+
=====================================
