diff options
| author | Alasdair Armstrong | 2017-10-12 18:21:01 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-10-12 18:21:01 +0100 |
| commit | a5fa2f549896e4e8a7262a71ffd377066b07a67c (patch) | |
| tree | bc8fb218af3ee86bef70b2ad4d188cfbec6bdd80 /src/ast_util.ml | |
| parent | d6688a7669c057b27f9c2adb8341ca853a3746df (diff) | |
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.
Diffstat (limited to 'src/ast_util.ml')
| -rw-r--r-- | src/ast_util.ml | 7 |
1 files changed, 7 insertions, 0 deletions
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) |
