diff options
| author | Hugo Herbelin | 2020-03-05 23:12:28 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-03-10 09:15:37 +0100 |
| commit | ec2f7507daaa5d3fa7ba365e542351457a237f43 (patch) | |
| tree | 8dd9ec49614abc93d14a894532b4491cef79f387 /plugins/syntax | |
| parent | fea01ea28b9fdfd9fb5be91aba982710f55c3aba (diff) | |
Fixing little bug in parsing decimal numbers in R.
Diffstat (limited to 'plugins/syntax')
| -rw-r--r-- | plugins/syntax/r_syntax.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/syntax/r_syntax.ml b/plugins/syntax/r_syntax.ml index f6fbdaa958..fa824a88ee 100644 --- a/plugins/syntax/r_syntax.ml +++ b/plugins/syntax/r_syntax.ml @@ -134,7 +134,7 @@ let r_of_rawnum ?loc (sign,n) = | '+' -> Bigint.of_string (String.sub e 2 (String.length e - 2)) | '-' -> Bigint.(neg (of_string (String.sub e 2 (String.length e - 2)))) | _ -> Bigint.of_string (String.sub e 1 (String.length e - 1)) in - Bigint.(sub e (of_int (String.length f))) in + Bigint.(sub e (of_int (String.length (String.concat "" (String.split_on_char '_' f))))) in if Bigint.is_strictly_pos e then rmult n (izr (pow10 e)) else if Bigint.is_strictly_neg e then rdiv n (izr (pow10 (neg e))) else n (* e = 0 *) |
