From a5fa2f549896e4e8a7262a71ffd377066b07a67c Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Thu, 12 Oct 2017 18:21:01 +0100 Subject: Fixes pattern matching exact values ([:'n:]) on integer literals Also improves flow typing in assert statements for ASL parser This patch does currently introduce a few test failures, probably due to the new way literals are handled in case statements, which needs to be investigated and fixed if possible. --- src/ast_util.ml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ast_util.ml') diff --git a/src/ast_util.ml b/src/ast_util.ml index 2db41ce6..e6217526 100644 --- a/src/ast_util.ml +++ b/src/ast_util.ml @@ -210,6 +210,13 @@ let quant_items : typquant -> quant_item list = function | TypQ_aux (TypQ_tq qis, _) -> qis | TypQ_aux (TypQ_no_forall, _) -> [] +let quant_kopts typq = + let qi_kopt = function + | QI_aux (QI_id kopt, _) -> [kopt] + | QI_aux _ -> [] + in + quant_items typq |> List.map qi_kopt |> List.concat + let rec map_exp_annot f (E_aux (exp, annot)) = E_aux (map_exp_annot_aux f exp, f annot) and map_exp_annot_aux f = function | E_block xs -> E_block (List.map (map_exp_annot f) xs) -- cgit v1.2.3