[m-rev.] for review: Make base_string_to_int check overflow/underflow for all bases.

Peter Wang novalazy at gmail.com
Mon Feb 16 12:16:43 AEDT 2015


On Sun, 15 Feb 2015 16:01:15 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
> 
> 
> Hi Peter,
> 
> Given that this change adds new test cases, you should probably coordinate
> when you commit it with Zoltan, since he is restructuring the test suite
> at the moment.

I can wait.  Zoltan?

> On Fri, 13 Feb 2015, Peter Wang wrote:
> 
> > Make base_string_to_int check for overflow and underflow when converting
> > from strings in all bases, not only base 10.
> >
> > Previously it was stated that "numbers not in base 10 are assumed to
> > denote bit patterns and are not checked for overflow."  Though not a
> > safe assumption in general, in Mercury source files it is useful to be
> > able to write values with the high bit set, e.g. 0x80000000 on 32-bit
> > machines, that would be greater than max_int if interpreted as a
> > positive integer.
> >
> > The changed behaviour of base_string_to_int would reject such literals
> > from Mercury sources, so additional changes are required to maintain
> > that usage.  However, unlike before, the compiler will report an
> > error if some non-zero bits of the literal would be discarded.
> >
> > library/string.m:
> > 	Enable overflow/underflow checking for base_string_to_int for
> > 	any base.
> >
> > 	Update documentation.
> >
> > library/lexer.m:
> > 	Allow `big_integer' token functor to represent non-base 10
> > 	literals as well.
> >
> > library/term.m:
> > 	Add `big_integer' term functor.
> 
> Adding big_integer in term.m will potentially break existing code
> that uses that module.  Please add something to the NEWS file informing
> users about this aspect change.

Right.

> > diff --git a/library/lexer.m b/library/lexer.m
> > index b7c2a28..cbf755b 100644
> > --- a/library/lexer.m
> > +++ b/library/lexer.m
> > @@ -30,7 +30,10 @@
> >     --->    name(string)
> >     ;       variable(string)
> >     ;       integer(int)
> > -    ;       big_integer(string) % does not fit in int
> > +    ;       big_integer(int, string)
> > +                                % An integer that is too big for `int'. The
> > +                                % arguments are the base (2, 8, 10, 16) and
> > +                                % digits of the literal.
> 
> Is there any good reason for why the base argument is an int and not a enum
> whose functors correspond to the valid bases, e.g.
> 
>       :- type big_integer_base
>          --->    binary
>          ;       octal
>          ;       decimal
>          ;       hexadecimal.
> 
> 
> Ditto for the version in term.m.
> 

No good reason.  I was a bit worried about duplicating the type
in lexer and term.

I also considered using `integer' in place of the string representation.
What do you think?

> 
> > diff --git a/tests/invalid/invalid_int.err_exp2 b/tests/invalid/invalid_int.err_exp2
> > new file mode 100644
> > index 0000000..4bf4dc0
> > --- /dev/null
> > +++ b/tests/invalid/invalid_int.err_exp2
> > @@ -0,0 +1,6 @@
> > +invalid_int.m:021: Error: integer literal is too big
> > +invalid_int.m:021:   `0b10000000000000000000000000000000000000000000000000000000000000000'.
> > +invalid_int.m:026: Error: integer literal is too big
> > +invalid_int.m:026:   `0o2000000000000000000000'.
> > +invalid_int.m:032: Error: integer literal is too big `0x10000000000000000'.
> > +invalid_int.m:037: Error: integer literal is too big `9223372036854775808'.
> 
> There seem to be some rubbish characters in the expected error there.

Fixed.

Interdiff follows, for review.

Peter

diff --git a/NEWS b/NEWS
index 9a8a016..9f8b18b 100644
--- a/NEWS
+++ b/NEWS
@@ -152,7 +152,7 @@ Changes to the Mercury standard library:
    - month_to_int0/1
    - same_date/1
 
-+ We have added a new module, psqueue, that implements a priority search
+* We have added a new module, psqueue, that implements a priority search
   queue ADT.  This is a blend between a priority queue and a map.  This was
   contributed by Matthias Güdemann.
 
@@ -160,6 +160,14 @@ Changes to the Mercury standard library:
 
   - all_true_in_range/3
 
+* The lexer module now returns non-base 10 integer literals in the string
+  representation, if the integer is too large for an `int'. The big_integer
+  constructor gained an additional base argument.
+
+* We have added a constructor big_integer/2 to the term.const type.
+
+* The parser module passes through big_integer tokens as big_integer terms.
+
 Changes to the Mercury compiler:
 
 * We have enabled stricter checking of non-ground final insts to reject more
diff --git a/compiler/prog_util.m b/compiler/prog_util.m
index bcf6c10..23b52de 100644
--- a/compiler/prog_util.m
+++ b/compiler/prog_util.m
@@ -140,7 +140,8 @@
     % represented by an unsigned integer of the same width as `int', and `Int'
     % is the signed integer with the same bit pattern as that unsigned value.
     %
-:- pred source_string_to_int(int::in, string::in, int::out) is semidet.
+:- pred source_string_to_int(integer_base::in, string::in, int::out)
+    is semidet.
 
 %-----------------------------------------------------------------------------%
 
@@ -712,18 +713,26 @@ det_make_functor_cons_id(Functor, Arity, ConsId) :-
         unexpected($module, $pred, "make_functor_cons_id failed")
     ).
 
+source_string_to_int(base_10, String, Int) :-
+    base_string_to_int(10, String, Int).
 source_string_to_int(Base, String, Int) :-
-    ( Base = 10 ->
-        base_string_to_int(Base, String, Int)
-    ;
-        integer.from_base_string(Base, String, Integer),
-        ( Integer > integer(max_int) ->
-            NegInteger = Integer + integer(min_int) + integer(min_int),
-            integer.to_int(NegInteger, Int),
-            Int < 0
-        ;
-            integer.to_int(Integer, Int)
-        )
+    (
+        Base = base_2,
+        BaseInt = 2
+    ;
+        Base = base_8,
+        BaseInt = 8
+    ;
+        Base = base_16,
+        BaseInt = 16
+    ),
+    integer.from_base_string(BaseInt, String, Integer),
+    ( Integer > integer(max_int) ->
+        NegInteger = Integer + integer(min_int) + integer(min_int),
+        integer.to_int(NegInteger, Int),
+        Int < 0
+    ;
+        integer.to_int(Integer, Int)
     ).
 
 %-----------------------------------------------------------------------------%

diff --git a/library/lexer.m b/library/lexer.m
index cbf755b..98f7d59 100644
--- a/library/lexer.m
+++ b/library/lexer.m
@@ -30,10 +30,10 @@
     --->    name(string)
     ;       variable(string)
     ;       integer(int)
-    ;       big_integer(int, string)
+    ;       big_integer(integer_base, string)
                                 % An integer that is too big for `int'. The
-                                % arguments are the base (2, 8, 10, 16) and
-                                % digits of the literal.
+                                % arguments are the base and digits of the
+                                % literal.
     ;       float(float)
     ;       string(string)      % "...."
     ;       implementation_defined(string) % $name
@@ -60,6 +60,12 @@
                                 % integer_dot/1 tokens to integer/1
                                 % tokens before returning them.
 
+:- type integer_base
+    --->    base_2
+    ;       base_8
+    ;       base_10
+    ;       base_16.
+
     % For every token, we record the line number of the line on
     % which the token occurred.
     %
@@ -170,17 +176,18 @@ token_to_string(Token, String) :-
         string.append_list(["integer `", IntString, "'"], String)
     ;
         Token = big_integer(Base, IntString),
-        ( Base = 10 ->
-            string.append_list(["integer `", IntString, "'"], String)
-        ; Base = 16 ->
-            string.append_list(["integer `0x", IntString, "'"], String)
-        ; Base = 8 ->
-            string.append_list(["integer `0o", IntString, "'"], String)
-        ; Base = 2 ->
+        (
+            Base = base_2,
             string.append_list(["integer `0b", IntString, "'"], String)
         ;
-            unexpected($module, $pred,
-                "big_integer with base " ++ from_int(Base))
+            Base = base_8,
+            string.append_list(["integer `0o", IntString, "'"], String)
+        ;
+            Base = base_10,
+            string.append_list(["integer `", IntString, "'"], String)
+        ;
+            Base = base_16,
+            string.append_list(["integer `0x", IntString, "'"], String)
         )
     ;
         Token = float(Float),
@@ -2001,14 +2008,14 @@ get_binary_2(Stream, Chars, Token, !IO) :-
         Token = io_error(Error)
     ;
         Result = eof,
-        rev_char_list_to_int(Chars, 2, Token)
+        rev_char_list_to_int(Chars, base_2, Token)
     ;
         Result = ok,
         ( char.is_binary_digit(Char) ->
             get_binary_2(Stream, [Char | Chars], Token, !IO)
         ;
             io.putback_char(Stream, Char, !IO),
-            rev_char_list_to_int(Chars, 2, Token)
+            rev_char_list_to_int(Chars, base_2, Token)
         )
     ).
 
@@ -2022,12 +2029,12 @@ string_get_binary_2(String, Len, Posn1, Token, Context, !Posn) :-
         ;
             string_ungetchar(String, !Posn),
             grab_string(String, Posn1, BinaryString, !Posn),
-            conv_string_to_int(BinaryString, 2, Token),
+            conv_string_to_int(BinaryString, base_2, Token),
             string_get_context(Posn1, Context, !Posn)
         )
     ;
         grab_string(String, Posn1, BinaryString, !Posn),
-        conv_string_to_int(BinaryString, 2, Token),
+        conv_string_to_int(BinaryString, base_2, Token),
         string_get_context(Posn1, Context, !Posn)
     ).
 
@@ -2080,14 +2087,14 @@ get_octal_2(Stream, Chars, Token, !IO) :-
         Token = io_error(Error)
     ;
         Result = eof,
-        rev_char_list_to_int(Chars, 8, Token)
+        rev_char_list_to_int(Chars, base_8, Token)
     ;
         Result = ok,
         ( char.is_octal_digit(Char) ->
             get_octal_2(Stream, [Char | Chars], Token, !IO)
         ;
             io.putback_char(Stream, Char, !IO),
-            rev_char_list_to_int(Chars, 8, Token)
+            rev_char_list_to_int(Chars, base_8, Token)
         )
     ).
 
@@ -2101,12 +2108,12 @@ string_get_octal_2(String, Len, Posn1, Token, Context, !Posn) :-
         ;
             string_ungetchar(String, !Posn),
             grab_string(String, Posn1, BinaryString, !Posn),
-            conv_string_to_int(BinaryString, 8, Token),
+            conv_string_to_int(BinaryString, base_8, Token),
             string_get_context(Posn1, Context, !Posn)
         )
     ;
         grab_string(String, Posn1, BinaryString, !Posn),
-        conv_string_to_int(BinaryString, 8, Token),
+        conv_string_to_int(BinaryString, base_8, Token),
         string_get_context(Posn1, Context, !Posn)
     ).
 
@@ -2159,14 +2166,14 @@ get_hex_2(Stream, Chars, Token, !IO) :-
         Token = io_error(Error)
     ;
         Result = eof,
-        rev_char_list_to_int(Chars, 16, Token)
+        rev_char_list_to_int(Chars, base_16, Token)
     ;
         Result = ok,
         ( char.is_hex_digit(Char) ->
             get_hex_2(Stream, [Char | Chars], Token, !IO)
         ;
             io.putback_char(Stream, Char, !IO),
-            rev_char_list_to_int(Chars, 16, Token)
+            rev_char_list_to_int(Chars, base_16, Token)
         )
     ).
 
@@ -2180,12 +2187,12 @@ string_get_hex_2(String, Len, Posn1, Token, Context, !Posn) :-
         ;
             string_ungetchar(String, !Posn),
             grab_string(String, Posn1, BinaryString, !Posn),
-            conv_string_to_int(BinaryString, 16, Token),
+            conv_string_to_int(BinaryString, base_16, Token),
             string_get_context(Posn1, Context, !Posn)
         )
     ;
         grab_string(String, Posn1, BinaryString, !Posn),
-        conv_string_to_int(BinaryString, 16, Token),
+        conv_string_to_int(BinaryString, base_16, Token),
         string_get_context(Posn1, Context, !Posn)
     ).
 
@@ -2199,7 +2206,7 @@ get_number(Stream, Chars, Token, !IO) :-
         Token = io_error(Error)
     ;
         Result = eof,
-        rev_char_list_to_int(Chars, 10, Token)
+        rev_char_list_to_int(Chars, base_10, Token)
     ;
         Result = ok,
         ( char.is_digit(Char) ->
@@ -2210,7 +2217,7 @@ get_number(Stream, Chars, Token, !IO) :-
             get_float_exponent(Stream, [Char | Chars], Token, !IO)
         ;
             io.putback_char(Stream, Char, !IO),
-            rev_char_list_to_int(Chars, 10, Token)
+            rev_char_list_to_int(Chars, base_10, Token)
         )
     ).
 
@@ -2229,12 +2236,12 @@ string_get_number(String, Len, Posn0, Token, Context, !Posn) :-
         ;
             string_ungetchar(String, !Posn),
             grab_string(String, Posn0, NumberString, !Posn),
-            conv_string_to_int(NumberString, 10, Token),
+            conv_string_to_int(NumberString, base_10, Token),
             string_get_context(Posn0, Context, !Posn)
         )
     ;
         grab_string(String, Posn0, NumberString, !Posn),
-        conv_string_to_int(NumberString, 10, Token),
+        conv_string_to_int(NumberString, base_10, Token),
         string_get_context(Posn0, Context, !Posn)
     ).
 
@@ -2250,7 +2257,7 @@ get_int_dot(Stream, Chars, Token, !IO) :-
     ;
         Result = eof,
         io.putback_char(Stream, '.', !IO),
-        rev_char_list_to_int(Chars, 10, Token)
+        rev_char_list_to_int(Chars, base_10, Token)
     ;
         Result = ok,
         ( char.is_digit(Char) ->
@@ -2261,7 +2268,7 @@ get_int_dot(Stream, Chars, Token, !IO) :-
             % guarantees one character of pushback. So instead, we return
             % an `integer_dot' token; the main loop of get_token_list_2 will
             % handle this appropriately.
-            rev_char_list_to_int(Chars, 10, Token0),
+            rev_char_list_to_int(Chars, base_10, Token0),
             ( Token0 = integer(Int) ->
                 Token = integer_dot(Int)
             ;
@@ -2282,13 +2289,13 @@ string_get_int_dot(String, Len, Posn0, Token, Context, !Posn) :-
             string_ungetchar(String, !Posn),
             string_ungetchar(String, !Posn),
             grab_string(String, Posn0, NumberString, !Posn),
-            conv_string_to_int(NumberString, 10, Token),
+            conv_string_to_int(NumberString, base_10, Token),
             string_get_context(Posn0, Context, !Posn)
         )
     ;
         string_ungetchar(String, !Posn),
         grab_string(String, Posn0, NumberString, !Posn),
-        conv_string_to_int(NumberString, 10, Token),
+        conv_string_to_int(NumberString, base_10, Token),
         string_get_context(Posn0, Context, !Posn)
     ).
 
@@ -2480,7 +2487,8 @@ string_get_float_exponent_3(String, Len, Posn0, Token, Context, !Posn) :-
 %
 % Utility routines.
 
-:- pred rev_char_list_to_int(list(char)::in, int::in, token::out) is det.
+:- pred rev_char_list_to_int(list(char)::in, integer_base::in, token::out)
+    is det.
 
 rev_char_list_to_int(RevChars, Base, Token) :-
     ( rev_char_list_to_string(RevChars, String) ->
@@ -2489,15 +2497,23 @@ rev_char_list_to_int(RevChars, Base, Token) :-
         Token = error("invalid character in int")
     ).
 
-:- pred conv_string_to_int(string::in, int::in, token::out) is det.
+:- pred conv_string_to_int(string::in, integer_base::in, token::out) is det.
 
 conv_string_to_int(String, Base, Token) :-
-    ( string.base_string_to_int(Base, String, Int) ->
+    BaseInt = base_to_int(Base),
+    ( string.base_string_to_int(BaseInt, String, Int) ->
         Token = integer(Int)
     ;
         Token = big_integer(Base, String)
     ).
 
+:- func base_to_int(integer_base) = int.
+
+base_to_int(base_2) = 2.
+base_to_int(base_8) = 8.
+base_to_int(base_10) = 10.
+base_to_int(base_16) = 16.
+
 :- pred rev_char_list_to_float(list(char)::in, token::out) is det.
 
 rev_char_list_to_float(RevChars, Token) :-
diff --git a/library/parser.m b/library/parser.m
index 108b89d..f2f2a45 100644
--- a/library/parser.m
+++ b/library/parser.m
@@ -373,7 +373,7 @@ parse_left_term(MaxPriority, TermKind, OpPriority, Term, !PS) :-
                 IntToken = integer(X),
                 NegX = 0 - X
             ;
-                IntToken = big_integer(10, BigString),
+                IntToken = big_integer(base_10, BigString),
                 decimal_max_int_plus_1(int.bits_per_int, BigString),
                 NegX = int.min_int
             )
@@ -661,8 +661,21 @@ parse_simple_term_2(integer(Int), Context, _, Term, !PS) :-
     get_term_context(!.PS, Context, TermContext),
     Term = ok(term.functor(term.integer(Int), [], TermContext)).
 
-parse_simple_term_2(big_integer(Base, String), Context, _, Term, !PS) :-
+parse_simple_term_2(big_integer(Base0, String), Context, _, Term, !PS) :-
     get_term_context(!.PS, Context, TermContext),
+    (
+        Base0 = base_2,
+        Base = base_2
+    ;
+        Base0 = base_8,
+        Base = base_8
+    ;
+        Base0 = base_10,
+        Base = base_10
+    ;
+        Base0 = base_16,
+        Base = base_16
+    ),
     Term = ok(term.functor(term.big_integer(Base, String), [], TermContext)).
 
 parse_simple_term_2(float(Float), Context, _, Term, !PS) :-
diff --git a/library/term.m b/library/term.m
index 7269bd3..a582851 100644
--- a/library/term.m
+++ b/library/term.m
@@ -51,13 +51,19 @@
 :- type const
     --->    atom(string)
     ;       integer(int)
-    ;       big_integer(int, string)
+    ;       big_integer(integer_base, string)
             % An integer that is too big for `int'. The arguments are the base
-            % (2, 8, 10, 16) and digits of the literal.
+            % and digits of the literal.
     ;       string(string)
     ;       float(float)
     ;       implementation_defined(string).
 
+:- type integer_base
+    --->    base_2
+    ;       base_8
+    ;       base_10
+    ;       base_16.
+
 :- type generic
     --->    generic.
 
diff --git a/library/term_io.m b/library/term_io.m
index 014282c..61928fd 100644
--- a/library/term_io.m
+++ b/library/term_io.m
@@ -181,7 +181,7 @@
 
     % Return the prefix for integer literals of the given base.
     %
-:- func integer_literal_base_prefix(int) = string.
+:- func integer_literal_base_prefix(integer_base) = string.
 
     % Convert a character to the corresponding octal escape code.
     %
@@ -579,18 +579,10 @@ term_io.format_constant_agt(term.string(S), _) =
 term_io.format_constant_agt(term.implementation_defined(N), _) =
     "$" ++ N.
 
-integer_literal_base_prefix(Base) = Prefix :-
-    ( Base = 10 ->
-        Prefix = ""
-    ; Base = 16 ->
-        Prefix = "0x"
-    ; Base = 8 ->
-        Prefix = "0o"
-    ; Base = 2 ->
-        Prefix = "0b"
-    ;
-        unexpected($module, $pred, "unsupported base")
-    ).
+integer_literal_base_prefix(base_2) = "0b".
+integer_literal_base_prefix(base_8) = "0o".
+integer_literal_base_prefix(base_10) = "".
+integer_literal_base_prefix(base_16) = "0x".
 
 %---------------------------------------------------------------------------%
 
diff --git a/tests/hard_coded/lexer_bigint.exp b/tests/hard_coded/lexer_bigint.exp
index 69e4867..07ff71b 100644
--- a/tests/hard_coded/lexer_bigint.exp
+++ b/tests/hard_coded/lexer_bigint.exp
@@ -1,51 +1,51 @@
 integer(2147483646)
 integer(2147483647)
-big_integer(10, "2147483648")
+big_integer(base_10, "2147483648")
 name("-")
 integer(2147483647)
 name("-")
-big_integer(10, "2147483648")
+big_integer(base_10, "2147483648")
 name("-")
-big_integer(10, "2147483649")
-big_integer(2, "11111111111111111111111111111111")
-big_integer(8, "37777777777")
-big_integer(16, "ffffffff")
-big_integer(10, "9223372036854775807")
-big_integer(10, "9223372036854775808")
-big_integer(10, "9223372036854775809")
+big_integer(base_10, "2147483649")
+big_integer(base_2, "11111111111111111111111111111111")
+big_integer(base_8, "37777777777")
+big_integer(base_16, "ffffffff")
+big_integer(base_10, "9223372036854775807")
+big_integer(base_10, "9223372036854775808")
+big_integer(base_10, "9223372036854775809")
 name("-")
-big_integer(10, "9223372036854775807")
+big_integer(base_10, "9223372036854775807")
 name("-")
-big_integer(10, "9223372036854775808")
+big_integer(base_10, "9223372036854775808")
 name("-")
-big_integer(10, "9223372036854775809")
-big_integer(2, "1111111111111111111111111111111111111111111111111111111111111111")
-big_integer(8, "1777777777777777777777")
-big_integer(16, "ffffffffffffffff")
-big_integer(10, "999999999999999999999999987654321")
+big_integer(base_10, "9223372036854775809")
+big_integer(base_2, "1111111111111111111111111111111111111111111111111111111111111111")
+big_integer(base_8, "1777777777777777777777")
+big_integer(base_16, "ffffffffffffffff")
+big_integer(base_10, "999999999999999999999999987654321")
 
 integer(2147483646)
 integer(2147483647)
-big_integer(10, "2147483648")
+big_integer(base_10, "2147483648")
 name("-")
 integer(2147483647)
 name("-")
-big_integer(10, "2147483648")
+big_integer(base_10, "2147483648")
 name("-")
-big_integer(10, "2147483649")
-big_integer(2, "11111111111111111111111111111111")
-big_integer(8, "37777777777")
-big_integer(16, "ffffffff")
-big_integer(10, "9223372036854775807")
-big_integer(10, "9223372036854775808")
-big_integer(10, "9223372036854775809")
+big_integer(base_10, "2147483649")
+big_integer(base_2, "11111111111111111111111111111111")
+big_integer(base_8, "37777777777")
+big_integer(base_16, "ffffffff")
+big_integer(base_10, "9223372036854775807")
+big_integer(base_10, "9223372036854775808")
+big_integer(base_10, "9223372036854775809")
 name("-")
-big_integer(10, "9223372036854775807")
+big_integer(base_10, "9223372036854775807")
 name("-")
-big_integer(10, "9223372036854775808")
+big_integer(base_10, "9223372036854775808")
 name("-")
-big_integer(10, "9223372036854775809")
-big_integer(2, "1111111111111111111111111111111111111111111111111111111111111111")
-big_integer(8, "1777777777777777777777")
-big_integer(16, "ffffffffffffffff")
-big_integer(10, "999999999999999999999999987654321")
+big_integer(base_10, "9223372036854775809")
+big_integer(base_2, "1111111111111111111111111111111111111111111111111111111111111111")
+big_integer(base_8, "1777777777777777777777")
+big_integer(base_16, "ffffffffffffffff")
+big_integer(base_10, "999999999999999999999999987654321")
diff --git a/tests/hard_coded/lexer_bigint.exp2 b/tests/hard_coded/lexer_bigint.exp2
index fba7130..f5d7c9a 100644
--- a/tests/hard_coded/lexer_bigint.exp2
+++ b/tests/hard_coded/lexer_bigint.exp2
@@ -11,18 +11,18 @@ integer(4294967295)
 integer(4294967295)
 integer(4294967295)
 integer(9223372036854775807)
-big_integer(10, "9223372036854775808")
-big_integer(10, "9223372036854775809")
+big_integer(base_10, "9223372036854775808")
+big_integer(base_10, "9223372036854775809")
 name("-")
 integer(9223372036854775807)
 name("-")
-big_integer(10, "9223372036854775808")
+big_integer(base_10, "9223372036854775808")
 name("-")
-big_integer(10, "9223372036854775809")
-big_integer(2, "1111111111111111111111111111111111111111111111111111111111111111")
-big_integer(8, "1777777777777777777777")
-big_integer(16, "ffffffffffffffff")
-big_integer(10, "999999999999999999999999987654321")
+big_integer(base_10, "9223372036854775809")
+big_integer(base_2, "1111111111111111111111111111111111111111111111111111111111111111")
+big_integer(base_8, "1777777777777777777777")
+big_integer(base_16, "ffffffffffffffff")
+big_integer(base_10, "999999999999999999999999987654321")
 
 integer(2147483646)
 integer(2147483647)
@@ -37,15 +37,15 @@ integer(4294967295)
 integer(4294967295)
 integer(4294967295)
 integer(9223372036854775807)
-big_integer(10, "9223372036854775808")
-big_integer(10, "9223372036854775809")
+big_integer(base_10, "9223372036854775808")
+big_integer(base_10, "9223372036854775809")
 name("-")
 integer(9223372036854775807)
 name("-")
-big_integer(10, "9223372036854775808")
+big_integer(base_10, "9223372036854775808")
 name("-")
-big_integer(10, "9223372036854775809")
-big_integer(2, "1111111111111111111111111111111111111111111111111111111111111111")
-big_integer(8, "1777777777777777777777")
-big_integer(16, "ffffffffffffffff")
-big_integer(10, "999999999999999999999999987654321")
+big_integer(base_10, "9223372036854775809")
+big_integer(base_2, "1111111111111111111111111111111111111111111111111111111111111111")
+big_integer(base_8, "1777777777777777777777")
+big_integer(base_16, "ffffffffffffffff")
+big_integer(base_10, "999999999999999999999999987654321")
diff --git a/tests/invalid/invalid_int.err_exp2 b/tests/invalid/invalid_int.err_exp2
index 4bf4dc0..6c76867 100644
--- a/tests/invalid/invalid_int.err_exp2
+++ b/tests/invalid/invalid_int.err_exp2
@@ -1,6 +1,6 @@
(removed ANSI escape sequences)



More information about the reviews mailing list