diff options
| author | Pierre Roux | 2018-10-20 14:40:23 +0200 |
|---|---|---|
| committer | Pierre Roux | 2019-04-02 00:02:21 +0200 |
| commit | 552bb5aba750785d8f19aa7b333baa59e9199369 (patch) | |
| tree | df349e57ff8c34e2da48d8c786d2466426822511 /printing | |
| parent | 4dc3d04d0812005f221e88744c587de8ef0f38ee (diff) | |
Add parsing of decimal constants (e.g., 1.02e+01)
Rather than integers '[0-9]+', numeral constant can now be parsed
according to the regexp '[0-9]+ ([.][0-9]+)? ([eE][+-]?[0-9]+)?'.
This can be used in one of the two following ways:
- using the function `Notation.register_rawnumeral_interpreter` in an OCaml plugin
- using `Numeral Notation` with the type `decimal` added to `Decimal.v`
See examples of each use case in the next two commits.
Diffstat (limited to 'printing')
| -rw-r--r-- | printing/ppconstr.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml index 1c496efb8f..0ae3de7321 100644 --- a/printing/ppconstr.ml +++ b/printing/ppconstr.ml @@ -235,8 +235,8 @@ let tag_var = tag Tag.variable | t -> str " :" ++ pr_sep_com (fun()->brk(1,2)) (pr ltop) t let pr_prim_token = function - | Numeral (SPlus,n) -> str n - | Numeral (SMinus,n) -> str ("-"^n) + | Numeral (SPlus,n) -> str (NumTok.to_string n) + | Numeral (SMinus,n) -> str ("-"^NumTok.to_string n) | String s -> qs s let pr_evar pr id l = |
