From c5184b5d6605dce21a74aee4105284d4d83f1019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Mon, 12 Jul 2010 09:25:36 +0200 Subject: [PATCH] Booleans can be used in a switch --- compiler/heptagon/parsing/hept_parser.mly | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/heptagon/parsing/hept_parser.mly b/compiler/heptagon/parsing/hept_parser.mly index 043b7e7..9d30eda 100644 --- a/compiler/heptagon/parsing/hept_parser.mly +++ b/compiler/heptagon/parsing/hept_parser.mly @@ -341,10 +341,14 @@ escapes: ; switch_handler: - | constructor loc_vars DO equs + | constructor_or_bool loc_vars DO equs { { w_name = $1; w_block = mk_block $2 $4 } } ; +constructor_or_bool: + | BOOL { Name(if $1 then "true" else "false") } + | constructor { $1 } + switch_handlers: | switch_handler { [$1] }