Skip to content

Commit

Permalink
Merge pull request #2 from TGIshib/hex-bug
Browse files Browse the repository at this point in the history
Fixed bug with negative hex constants (2).
  • Loading branch information
TGIshib authored Jul 12, 2016
2 parents df5575d + f6f88e5 commit 247388a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/idl_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@ CheckedError Parser::Next() {
return NoError();
} else if (isdigit(static_cast<unsigned char>(c)) || c == '-') {
const char *start = cursor_ - 1;
if (c == '-' && *cursor_ == '0' && (cursor_[1] == 'x' || cursor_[1] == 'X')) {
++start;
++cursor_;
attribute_.append(&c, &c + 1);
c = '0';
}
if (c == '0' && (*cursor_ == 'x' || *cursor_ == 'X')) {
cursor_++;
while (isxdigit(static_cast<unsigned char>(*cursor_))) cursor_++;
Expand Down

0 comments on commit 247388a

Please sign in to comment.