You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ca...@apache.org on 2013/06/09 14:28:55 UTC

git commit: THRIFT-1995: IDL can generate uncompilable ocde

Updated Branches:
  refs/heads/master c08926ae7 -> de07408e4


THRIFT-1995: IDL can generate uncompilable ocde

Patch: Carl Yeksigian


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/de07408e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/de07408e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/de07408e

Branch: refs/heads/master
Commit: de07408e43ac50c2b9f71ab26cf71ee517573763
Parents: c08926a
Author: Carl Yeksigian <ca...@apache.org>
Authored: Tue Jun 4 04:28:31 2013 -0400
Committer: Carl Yeksigian <ca...@apache.org>
Committed: Sun Jun 9 05:28:47 2013 -0700

----------------------------------------------------------------------
 compiler/cpp/src/thriftl.ll |  4 ++--
 test/Include.thrift         | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/de07408e/compiler/cpp/src/thriftl.ll
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/thriftl.ll b/compiler/cpp/src/thriftl.ll
index 0a04840..8accf4c 100644
--- a/compiler/cpp/src/thriftl.ll
+++ b/compiler/cpp/src/thriftl.ll
@@ -89,7 +89,7 @@ void unexpected_token(char* text) {
 intconstant   ([+-]?[0-9]+)
 hexconstant   ("0x"[0-9A-Fa-f]+)
 dubconstant   ([+-]?[0-9]*(\.[0-9]+)?([eE][+-]?[0-9]+)?)
-identifier    ([a-zA-Z_][\.a-zA-Z_0-9]*)
+identifier    ([a-zA-Z_](\.[a-zA-Z_0-9]|[a-zA-Z_0-9])*)
 whitespace    ([ \t\r\n]*)
 sillycomm     ("/*""*"*"*/")
 multicomm     ("/*"[^*]"/"*([^*/]|[^*]"/"|"*"[^/])*"*"*"*/")
@@ -97,7 +97,7 @@ doctext       ("/**"([^*/]|[^*]"/"|"*"[^/])*"*"*"*/")
 comment       ("//"[^\n]*)
 unixcomment   ("#"[^\n]*)
 symbol        ([:;\,\{\}\(\)\=<>\[\]])
-st_identifier ([a-zA-Z-][\.a-zA-Z_0-9-]*)
+st_identifier ([a-zA-Z-](\.[a-zA-Z_0-9-]|[a-zA-Z_0-9-])*)
 literal_begin (['\"])
 
 %%

http://git-wip-us.apache.org/repos/asf/thrift/blob/de07408e/test/Include.thrift
----------------------------------------------------------------------
diff --git a/test/Include.thrift b/test/Include.thrift
new file mode 100644
index 0000000..562319b
--- /dev/null
+++ b/test/Include.thrift
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+include "ThriftTest.thrift"
+
+struct IncludeTest {
+  1: required ThriftTest.Bools bools
+}
\ No newline at end of file