File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ let string_of_number v =
205205 then s2
206206 else Printf. sprintf " %.18g" v
207207
208+ exception Not_an_ident
208209let is_ident =
209210 let l = Array. init 256 (fun i ->
210211 let c = Char. chr i in
@@ -218,10 +219,12 @@ let is_ident =
218219 try
219220 for i = 0 to String. length s - 1 do
220221 let code = l.(Char. code(s.[i])) in
221- if i = 0 then assert (code = 1 ) else assert (code > = 1 )
222+ if i = 0
223+ then (if code <> 1 then raise Not_an_ident )
224+ else (if code < 1 then raise Not_an_ident )
222225 done ;
223226 true
224- with _ -> false
227+ with Not_an_ident -> false
225228
226229module IdentSet = Set. Make (struct type t = ident let compare = compare_ident end )
227230module IdentMap = Map. Make (struct type t = ident let compare = compare_ident end )
You can’t perform that action at this time.
0 commit comments