Project

General

Profile

Revision bbfbc15a

View differences:

src/lustreSpec.ml
47 47

  
48 48

  
49 49
type constant =
50
  | Const_bool of bool
51 50
  | Const_int of int
52 51
  | Const_real of Num.num * int * string (* (a, b, c) means a * 10^-b. c is the original string *)
53 52
  | Const_array of constant list
src/tools/stateflow/parser-json/parser_json.ml
130 130
    let initial_value = json |> member "initial_value" |> to_string in
131 131
    match datatype with
132 132
    | "bool" -> (Tydec_bool, mkexpr location
133
                   (Expr_const (Const_bool
134
                                  (bool_of_string initial_value))))
133
                   (Expr_const (Const_tag
134
                                  ((fun s -> match s with
135
                                     | "true"  -> tag_true
136
                                     | "false" -> tag_false
137
                                     | _       ->
138
                                       failwith ("Invalid constant for
139
     boolean: " ^ s)) initial_value))))
135 140
    | "int"  -> (Tydec_int, mkexpr location
136 141
                   (Expr_const (Const_int (int_of_string
137 142
                                             initial_value))))

Also available in: Unified diff