diff options
author | Jens Geyer <jensg@apache.org> | 2015-04-26 15:24:59 +0200 |
---|---|---|
committer | Jens Geyer <jensg@apache.org> | 2015-04-26 17:47:43 +0200 |
commit | 5ec2121cf283e8d708d22ab3e66c9c7103ecbaf0 (patch) | |
tree | 652d2c56e7e3895ab9eac5114d504bf3cabfbbe3 /test/ConstantsDemo.thrift | |
parent | 71f2d8a7140329f0f2fc339d84e50d9b27bf478c (diff) | |
download | thrift-5ec2121cf283e8d708d22ab3e66c9c7103ecbaf0.tar.gz |
THRIFT-233 IDL doesn't support negative hex literals
Client: Compiler general
Patch: mreve <aadymek@gmail.com>
This closes #461
Update hexconstant regex in thriftl.ll
As it is now, the parser doesn't allow hex constant values to be negative (it throws a 'bad syntax' error).The change updates the regex and the part that parses the hex value from the string read from the IDL file to support negative values.
Add test to ConstantsDemo.thrift
Before the change, "make install" would break with negative hex constant in ConstantsDemo.thrift. Now it compiles.
Diffstat (limited to 'test/ConstantsDemo.thrift')
-rw-r--r-- | test/ConstantsDemo.thrift | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ConstantsDemo.thrift b/test/ConstantsDemo.thrift index 7d971e60f..9a71ac8b4 100644 --- a/test/ConstantsDemo.thrift +++ b/test/ConstantsDemo.thrift @@ -40,6 +40,7 @@ const myIntType myInt = 3 //const map<enumconstants,string> GEN_ENUM_NAMES = {ONE : "HOWDY", TWO: "PARTNER"} const i32 hex_const = 0x0001F +const i32 negative_hex_constant = -0x0001F const i32 GEN_ME = -3523553 const double GEn_DUB = 325.532 |