summaryrefslogtreecommitdiff
path: root/test/ConstantsDemo.thrift
diff options
context:
space:
mode:
authorMark Slee <mcslee@apache.org>2007-07-27 22:14:41 +0000
committerMark Slee <mcslee@apache.org>2007-07-27 22:14:41 +0000
commitd0767c579673c868d1ae15e5979a9301ac1347d7 (patch)
treef877b2b08a1778f3b885e03fa6d2b158501ad381 /test/ConstantsDemo.thrift
parenta46438e11d506433ec7c995ad7d11003ca7d87de (diff)
downloadthrift-d0767c579673c868d1ae15e5979a9301ac1347d7.tar.gz
Fix Thrift compiler to support reuse of enums and constants in later constants
Summary: So for example, you can make a constant map of enum values to string identifiers. Reviewed By: dreiss Test Plan: ConstantsDemo.thrift in the test folder git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665181 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/ConstantsDemo.thrift')
-rw-r--r--test/ConstantsDemo.thrift7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ConstantsDemo.thrift b/test/ConstantsDemo.thrift
index 1cdc98ab6..3af9f9325 100644
--- a/test/ConstantsDemo.thrift
+++ b/test/ConstantsDemo.thrift
@@ -5,6 +5,13 @@ struct thing {
2: i32 goodbye
}
+enum constants {
+ ONE = 1,
+ TWO = 2
+}
+
+const map<i32,string> GEN_ENUM_NAMES = {ONE : "HOWDY", TWO: PARTNER}
+
const i32 hex_const = 0x0001F
const i32 GEN_ME = -3523553