From ec2f7507daaa5d3fa7ba365e542351457a237f43 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 5 Mar 2020 23:12:28 +0100 Subject: Fixing little bug in parsing decimal numbers in R. --- plugins/syntax/r_syntax.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/syntax') 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 *) -- cgit v1.2.3