aboutsummaryrefslogtreecommitdiff
path: root/interp/numTok.mli
blob: 46223c5fafb978e58607429f65fb798495870255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
type t = {
  int : string;  (** \[0-9\]+ *)
  frac : string;  (** empty or \[0-9\]+ *)
  exp : string  (** empty or \[eE\]\[+-\]?\[0-9\]+ *)
}

val equal : t -> t -> bool

(** [int s] amounts to [\{ int = s; frac = ""; exp = "" \}] *)
val int : string -> t

val to_string : t -> string

val of_string : string -> t option

(** Precondition: the first char on the stream is a digit (\[0-9\]).
    Precondition: at least two extra chars after the numeral to parse. *)
val parse : char Stream.t -> t