From bc1ab16adcade3ecb6a8ee8339be4cf26c762b2f Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 26 Apr 2015 18:40:45 +0300 Subject: [PATCH] cql3: convert reserved_type_names() in grammar --- cql3/Cql.g | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cql3/Cql.g b/cql3/Cql.g index cad29a49f8..b689924f3c 100644 --- a/cql3/Cql.g +++ b/cql3/Cql.g @@ -99,19 +99,20 @@ struct uninitialized { std::vector<::shared_ptr> _bind_variables; -#if 0 - public static final Set reservedTypeNames = new HashSet() - {{ - add("byte"); - add("smallint"); - add("complex"); - add("enum"); - add("date"); - add("interval"); - add("macaddr"); - add("bitstring"); - }}; -#endif + // Can't use static variable, since it needs to be defined out-of-line + static const std::unordered_set& _reserved_type_names() { + static std::unordered_set s = { + "byte", + "smallint", + "complex", + "enum", + "date", + "interval", + "macaddr", + "bitstring", + }; + return s; + } shared_ptr new_bind_variables(shared_ptr name) {