Source

ocaml-lib / tokens.ml

Diff from to

tokens.ml

 (* predicate filtering PP_* tokens *)
 let is_PP = function PP_tilda | PP_space | PP_cut | PP_break _ | PP_newline -> true | _ -> false
 
-(* get the precision of a float number from its writing *)
-let prec_of_sfloat : string -> int =
-  fun s ->
-      let l = String.length s in
-      let i_dot =
-        try String.index s '.'
-        with Not_found -> try String.index s 'e' - 1
-        with Not_found -> l - 1 in
-      let i_e,p =
-        try
-          let i_e = String.index s 'e' in
-          i_e,
-          match s.[i_e+1] with
-          | '+' -> int_of_string (String.sub s (i_e+2) (l-(i_e+2)))
-          | _ -> int_of_string (String.sub s (i_e+1) (l-(i_e+1)))
-        with Not_found -> l, 0 in
-      p - (i_e - (i_dot+1))
-
 (* predicate for testing whether a symbol needs quotes *)
 let symbol_needs_quotes s =
   let is_ident = Str.string_match (Str.regexp "^[A-Za-z_][A-Za-z0-9_]*$") s 0 in
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.