diff options
| author | Pierre-Marie Pédrot | 2020-03-10 13:56:10 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-03-10 13:56:10 +0100 |
| commit | f1188b9a3f32eef7657bb46026447718f6fb6055 (patch) | |
| tree | 8dd9ec49614abc93d14a894532b4491cef79f387 /plugins/syntax | |
| parent | fea01ea28b9fdfd9fb5be91aba982710f55c3aba (diff) | |
| parent | ec2f7507daaa5d3fa7ba365e542351457a237f43 (diff) | |
Merge PR #11763: Fixing an amusing small bug in parsing decimal numbers in R
Reviewed-by: ppedrot
Reviewed-by: proux01
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 *) |
