Skip to content

Commit

Permalink
[feature] libbase/jsonLex.ml: anormal float extension
Browse files Browse the repository at this point in the history
  • Loading branch information
OpaOnWindowsNow committed Apr 4, 2012
1 parent 3aec545 commit b0fead4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libbase/jsonLex.ml
@@ -1,5 +1,5 @@
(*
Copyright © 2011 MLstate
Copyright © 2011, 2012 MLstate
This file is part of OPA.
Expand Down Expand Up @@ -55,7 +55,12 @@ let rec get_token = lexer
| ':' -> JP.COLON
| ',' -> JP.COMMA
| t_int -> JP.INT (int_of_string (Ulexing.utf8_lexeme lexbuf))

| "NaN"
| "Infinity"
| "-Infinity"
| t_number -> JP.FLOAT (float_of_string (Ulexing.utf8_lexeme lexbuf))

| "true" -> JP.TRUE
| "false" -> JP.FALSE
| "null" -> JP.NIL
Expand Down

0 comments on commit b0fead4

Please sign in to comment.