diff options
author | Hugo Heuzard <hugo.heuzard@gmail.com> | 2015-04-18 23:07:32 -0400 |
---|---|---|
committer | Damien Doligez <damien.doligez@inria.fr> | 2015-12-03 17:20:48 +0100 |
commit | 9eca3e45191ef52ce519e2d5bb4688da62bf7496 (patch) | |
tree | 4719ba4c43165a582d78527c0fa477cfada6925b /parsing/parsetree.mli | |
parent | 1c9e418b92a2f71aa39d5e70d154c52e49daeb55 (diff) | |
download | ocaml-9eca3e45191ef52ce519e2d5bb4688da62bf7496.tar.gz |
Parse arbitrary precision integers ..
.. and allow any letter in [g-zG-Z] as modifier (previously 'l','L','n')
Also allow modifier for floats
This give more freedom to ppx rewritters (what about a ppx for zarith)
Checks are performed when translating from Parsetree to Typedtree.
Invalid_literal is raised if the modifier is not recognized ([lLn]?)
Integer_overflow is raised as before.
Lexer: use g-zG-Z for integer literal modifier
Lexer: Allow modifier on float
Clean wrt previous commits
Lexer: use named substring
Cleanup
typo
doc
fix after rebase
rebase on trunk
Update typecore.ml
Fix printast.ml
Diffstat (limited to 'parsing/parsetree.mli')
-rw-r--r-- | parsing/parsetree.mli | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/parsing/parsetree.mli b/parsing/parsetree.mli index 95dbd4f83c..8f9083dd5d 100644 --- a/parsing/parsetree.mli +++ b/parsing/parsetree.mli @@ -14,6 +14,12 @@ open Asttypes +type constant = + PConst_int of string * char option + | PConst_char of char + | PConst_string of string * string option + | PConst_float of string * char option + (** {2 Extension points} *) type attribute = string loc * payload @@ -833,6 +839,6 @@ type toplevel_phrase = and directive_argument = | Pdir_none | Pdir_string of string - | Pdir_int of int + | Pdir_int of string * char option | Pdir_ident of Longident.t | Pdir_bool of bool |