From d40b634c237de25574ebd1bbf64b9a7a81253f2b Mon Sep 17 00:00:00 2001 From: Son Ho Date: Wed, 1 Dec 2021 13:30:36 +0100 Subject: Merge statements and expressions into statements --- src/CfimAst.ml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/CfimAst.ml') diff --git a/src/CfimAst.ml b/src/CfimAst.ml index d2bf9181..9acf40ff 100644 --- a/src/CfimAst.ml +++ b/src/CfimAst.ml @@ -50,22 +50,17 @@ type statement = (** Continue to (outer) loop. The loop identifier works the same way as for [Break] *) | Nop -[@@deriving show] - -type expression = - | Statement of statement - | Sequence of expression * expression + | Sequence of statement * statement | Switch of operand * switch_targets - | Loop of expression + | Loop of statement [@@deriving show] -(* TODO: merge with statement *) and switch_targets = - | If of expression * expression (** Gives the "if" and "else" blocks *) - | SwitchInt of integer_type * (scalar_value * expression) list * expression + | If of statement * statement (** Gives the "if" and "else" blocks *) + | SwitchInt of integer_type * (scalar_value * statement) list * statement (** The targets for a switch over an integer are: - - the list `(matched value, expression to execute)` - - the "otherwise" expression. + - the list `(matched value, statement to execute)` + - the "otherwise" statement. Also note that we precise the type of the integer (uint32, int64, etc.) which we switch on. *) [@@deriving show] @@ -77,6 +72,6 @@ type fun_def = { divergent : bool; arg_count : int; locals : var list; - body : expression; + body : statement; } [@@deriving show] -- cgit v1.2.3