From: Prashanth Mundkur Date: Fri, 15 May 2009 17:07:29 +0000 (-0700) Subject: fix missing support for floats in json_conv codegen X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2418444561a55a0140c9324dac0b34712ae49bf5;p=xenclient%2Ftoolstack.git fix missing support for floats in json_conv codegen --- diff --git a/gen/json_conv/codegen.ml b/gen/json_conv/codegen.ml index e22725f..d0020d7 100644 --- a/gen/json_conv/codegen.ml +++ b/gen/json_conv/codegen.ml @@ -27,6 +27,7 @@ let base_to_str = function | B_string -> "Json_conv.string" | B_int -> "Json_conv.int" | B_int64 -> "Json_conv.int64" + | B_float -> "Json_conv.float" | B_bool -> "Json_conv.bool" | B_ident s -> s @@ -61,7 +62,7 @@ module Var_env = struct let base_to_stem = function | B_string -> "str" | B_int -> "int" | B_int64 -> "int64" - | B_bool -> "bool" | B_ident s -> s + | B_bool -> "bool" | B_float -> "float" | B_ident s -> s let complex_type_to_stem = function | C_base b -> base_to_stem b | C_option _ -> "opt" | C_list _ -> "lst" diff --git a/gen/json_conv/parser.mly b/gen/json_conv/parser.mly index ab904dc..8eed7ad 100644 --- a/gen/json_conv/parser.mly +++ b/gen/json_conv/parser.mly @@ -103,6 +103,7 @@ base: | "string" -> B_string | "int" -> B_int | "int64" -> B_int64 + | "float" -> B_float | "bool" -> B_bool | s -> B_ident s } diff --git a/gen/json_conv/syntax.ml b/gen/json_conv/syntax.ml index 8cf0d0d..31b9aa9 100644 --- a/gen/json_conv/syntax.ml +++ b/gen/json_conv/syntax.ml @@ -26,6 +26,7 @@ type base_type = | B_string | B_int | B_int64 + | B_float | B_bool | B_ident of string