compiler: Accept numeric literals with leading zeroes.
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 25 Aug 2015 21:17:47 +0000 (21:17 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 25 Aug 2015 21:17:47 +0000 (21:17 +0000)
commit387b37c1acab0791f19cfced1e345543855d764e
tree51e3958a1fe1dce71f49ef708a9b04152b34b6c8
parent60c47c007366840f15fe17913d0592c2819b7c99
compiler: Accept numeric literals with leading zeroes.

    When a numeric literal with leading zeroes was seen in the parser, it
    would only be accepted if it were a valid hex or octal literal.  Any
    invalid numeric literal would be split up into multiple tokens: the
    valid hex/octal literal followed by the rest of the characters.
    Instead, when scanning a numeric literal with leading zeroes, always
    accept the number and give an appropriate error if the accepted number
    does not fit in the expected base.

    Fixes golang/go#11532, golang/go#11533.

    Reviewed-on: https://go-review.googlesource.com/13791

From-SVN: r227193
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/lex.cc