Skip to content

Commit

Permalink
sanitize floats that start with .
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfitz committed Feb 12, 2015
1 parent 92aa5ae commit c86d0a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions genrb.ml
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ let is_dynamic_iterator ctx e =
let gen_constant ctx p = function
| TInt i -> print ctx "%ld" i
| TFloat s ->
if (s.[0] == '.') then spr ctx "0";
spr ctx s;
if (s.[(String.length s)-1] == '.') then spr ctx "0"
| TString s -> print ctx "\"%s\"" (Ast.s_escape s)
Expand Down

0 comments on commit c86d0a6

Please sign in to comment.