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
diff --git a/test/ConstantsDemo.thrift b/test/ConstantsDemo.thrift
index 1cdc98a..3af9f93 100644
--- a/test/ConstantsDemo.thrift
+++ b/test/ConstantsDemo.thrift
@@ -5,6 +5,13 @@
   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