[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2017-11-01 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r148288455
  
--- Diff: compiler/cpp/src/thrift/generate/t_swift_generator.cc ---
@@ -245,22 +297,30 @@ class t_swift_generator : public t_oop_generator {
  */
 void t_swift_generator::init_generator() {
   // Make output directory
-  MKDIR(get_out_dir().c_str());
+  string module = get_real_swift_module(program_);
+  string out_dir = get_out_dir();
+  string module_path = out_dir;
+  string name = capitalize(program_name_);
+  if (namespaced_ and !module.empty()) {
--- End diff --

I just noticed that this broke Windows build.
It seems that VC++ does not support alternative keywords in our settings.
 Can you replace`and` with `&&` ? We'll see if it fixes the build.


---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2017-10-28 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r147555627
  
--- Diff: compiler/cpp/src/thrift/generate/t_swift_generator.cc.old ---
@@ -0,0 +1,3249 @@
+/*
--- End diff --

Can you remove this one if it's no longer used ?


---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2017-10-28 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r147555608
  
--- Diff: compiler/cpp/src/thrift/generate/t_swift_generator.cc ---
@@ -95,19 +110,20 @@ class t_swift_generator : public t_oop_generator {
   void generate_xception(t_struct* txception);
   void generate_service(t_service* tservice);
 
-  void print_const_value(ostream& out,
- string name,
- t_type* type,
- t_const_value* value,
- bool defval = false,
- bool is_property = false);
+  // void print_const_value(ostream& out,
+  //string name,
+  //t_type* type,
+  //t_const_value* value,
+  //bool defval = false,
+  //bool is_property = false);
--- End diff --

Can you remove commented out code, if useless ? Otherwise please put a 
comment as to why we need to keep it as a comment.


---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-12-20 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r93366730
  
--- Diff: lib/swift/Sources/TProtocolError.swift ---
@@ -0,0 +1,146 @@
+/*
+* 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.
+*/
+
+import Foundation
+
+public struct TProtocolError : TError {
+  public init() { }
+
+  public enum Code : TErrorCode {
+case unknown
+case invalidData
+case negativeSize
+case sizeLimit(limit: Int, got: Int)
+case badVersion(expected: String, got: String)
+case notImplemented
+case depthLimit
+
+public var thriftErrorCode: Int {
+  switch self {
+  case .unknown:return 0
+  case .invalidData:return 1
+  case .negativeSize:   return 2
+  case .sizeLimit:  return 3
+  case .badVersion: return 4
+  case .notImplemented: return 5
+  case .depthLimit: return 6
+  }
+
+}
+public var description: String {
+  switch self {
+  case .unknown:return "Unknown TProtocolError"
+  case .invalidData:return "Invalid Data"
+  case .negativeSize:   return "Negative Size"
+  case .sizeLimit(let limit, let got):
+return "Message exceeds size limit of \(limit) (received: \(got)"
+  case .badVersion(let expected, let got):
+return "Bad Version. (Expected: \(expected), Got: \(got)"
+  case .notImplemented: return "Not Implemented"
+  case .depthLimit: return "Depth Limit"
+  }
+}
+  }
+  
+  public enum ExtendedErrorCode : TErrorCode {
+case unknown
+case missingRequiredField(fieldName: String)
+case unexpectedType(type: TType)
+case mismatchedProtocol(expected: String, got: String)
+public var thriftErrorCode: Int {
+  switch self {
+  case .unknown:  return 1001
+  case .missingRequiredField: return 1002
+  case .unexpectedType:   return 1003
+  case .mismatchedProtocol:   return 1003
--- End diff --

The last two values seems in conflict.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-12-20 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r93367768
  
--- Diff: compiler/cpp/src/thrift/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2553 @@
+/*
--- End diff --

Assigning simple "--gen swift" to this one sounds good to me, given the 
Swift 2.x situation and this beeing pure Swift implementation.

In general, though, removing is hard.
The most natural course of action would be to keep current one as an 
generator switch like "swift:cocoa".

For completely replacement, we need ordinal considerations for any breaking 
changes.
How hard it is to migrate existing users' code ?
It seems to me that anyone who extended library code (inheritance etc) 
would be in a huge trouble.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-11-13 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r87716435
  
--- Diff: lib/swift/README.md ---
@@ -0,0 +1,217 @@
+Thrift Swift Library
+=
+
+License
+---
+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.
+
+Brought to you by [FiscalNote, Inc](http://www.fiscalnote.com/)
--- End diff --

If required by Apache sure, though my company would like a mention 
somewhere if possible, since they agreed to allow me build this on company time.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-11-13 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r87716418
  
--- Diff: lib/swift/Sources/LinuxHelper.swift ---
@@ -0,0 +1,34 @@
+//
+//  LinuxHelper.swift
+//  Thrift
+//
+//  Created by Christopher Simpson on 8/22/16.
+//
+//
--- End diff --

Will update


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-11-13 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r87716408
  
--- Diff: compiler/cpp/src/thrift/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2553 @@
+/*
--- End diff --

While I don't disagree, I can potentially see future problems arising when 
I try to introduce namespacing via modules.  
Additionally, Swift 2.x won't be supported by Apple any longer after 2.x 
next year, so that might make a good case to axe the old one and just call this 
the canonical `Swift` generator, thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-11-13 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r87710760
  
--- Diff: lib/swift/README.md ---
@@ -0,0 +1,217 @@
+Thrift Swift Library
+=
+
+License
+---
+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.
+
+Brought to you by [FiscalNote, Inc](http://www.fiscalnote.com/)
--- End diff --

Can this line be removed ?

@jfarrell I couldn't find reference but is it problematic to put a company 
name into patches or doc ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-11-13 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r87710735
  
--- Diff: lib/swift/Sources/LinuxHelper.swift ---
@@ -0,0 +1,34 @@
+//
+//  LinuxHelper.swift
+//  Thrift
+//
+//  Created by Christopher Simpson on 8/22/16.
+//
+//
--- End diff --

Wrong file header ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-11-13 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r87710644
  
--- Diff: compiler/cpp/src/thrift/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2553 @@
+/*
--- End diff --

This particular file shares more than half of its content with existing 
t_swift_generator.cc.
While we can certainly do this, alternative would be to add a flag into 
existing one.
See Node.js generator where we have separate `lib/nodejs` directory but 
single t_js_generator.cc with `gen_node_` field.

As the difference is often new separate method calls, such a merging might 
not introduce much of a clutter.
What do you think ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-11-13 Thread nsuke
Github user nsuke commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r87710725
  
--- Diff: lib/swift/Package.swift ---
@@ -0,0 +1,12 @@
+//let package = Package(
--- End diff --

A file header would be nice.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-10-10 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r82631304
  
--- Diff: compiler/cpp/src/thrift/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2458 @@
+/*
+ * 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 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include "t_oop_generator.h"
--- End diff --

Fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-24 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r80368318
  
--- Diff: compiler/cpp/src/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2458 @@
+/*
+ * 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 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include "t_oop_generator.h"
+#include "platform.h"
+
+using std::map;
+using std::ostream;
+using std::ofstream;
+using std::ostringstream;
+using std::set;
+using std::string;
+using std::stringstream;
+using std::vector;
+
+static const string endl = "\n"; // avoid ostream << std::endl flushes
+
+/**
+ * Swift 3 code generator.
+ *
+ * Designed from the Swift/Cocoa code generator(s)
+ */
+class t_swift_3_generator : public t_oop_generator {
+public:
+  t_swift_3_generator(t_program* program,
+const map& parsed_options,
+const string& option_string)
+: t_oop_generator(program) {
+(void)option_string;
+map::const_iterator iter;
+
+log_unexpected_ = false;
+async_clients_ = false;
+debug_descriptions_ = false;
+no_strict_ = false;
+
+for( iter = parsed_options.begin(); iter != parsed_options.end(); 
++iter) {
+  if( iter->first.compare("log_unexpected") == 0) {
+log_unexpected_ = true;
+  } else if( iter->first.compare("async_clients") == 0) {
+async_clients_ = true;
+  } else if( iter->first.compare("no_strict") == 0) {
+no_strict_ = true;
+  } else if( iter->first.compare("debug_descriptions") == 0) {
+debug_descriptions_ = true;
+  } else {
+throw "unknown option swift:" + iter->first;
+  }
+}
+
+out_dir_base_ = "gen-swift";
+  }
+
+  /**
+   * Init and close methods
+   */
+
+  void init_generator();
+  void close_generator();
+
+  void generate_consts(vector consts);
+
+  /**
+   * Program-level generation functions
+   */
+
+  void generate_typedef(t_typedef* ttypedef);
+  void generate_enum(t_enum* tenum);
+  void generate_struct(t_struct* tstruct);
+  void generate_xception(t_struct* txception);
+  void generate_service(t_service* tservice);
+
+  void print_const_value(ostream& out,
+ string name,
+ t_type* type,
+ t_const_value* value,
+ bool defval = false,
+ bool is_property = false);
+  void render_const_value(ostream& out,
+  t_type* type,
+  t_const_value* value);
+
+  void generate_swift_struct(ofstream& out,
+ t_struct* tstruct,
+ bool is_private,
+ bool is_result);
+  void generate_swift_struct_init(ofstream& out,
+  t_struct* tstruct,
+  bool all,
+  bool is_private);
+
+  void generate_swift_struct_implementation(ofstream& out,
+t_struct* tstruct,
+bool is_result,
+bool is_private);
+  void generate_swift_struct_hashable_extension(ofstream& out,
+t_struct* tstruct,
+bool is_private);
+  void generate_swift_struct_equatable_extension(ofstream& out,
+ t_struct* tstruct,
+ bool is_private);
+  void 

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-24 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r80368238
  
--- Diff: lib/swift/Sources/TMultiplexedProtocol.swift ---
@@ -0,0 +1,47 @@
+/*
+* 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.
+*/
+
+public class TMultiplexedProtocol: 
TWrappedProtocol {
+  public let separator = ":"
+
+  public var serviceName = ""
+  
+  public convenience init(on transport: TTransport, serviceName: String) {
+self.init(on: transport)
+self.serviceName = serviceName
+  }
+
+  override public func writeMessageBegin(name: String,
+ type messageType: TMessageType,
+ sequenceID: Int32) throws {
+switch messageType {
+case .call, .oneway:
+  var serviceFunction = serviceName
+  serviceFunction += serviceName == "" ? "" : separator
+  serviceFunction += name
+  return try super.writeMessageBegin(name: serviceFunction,
+ type: messageType,
+ sequenceID: sequenceID)
+default:
--- End diff --

That would require redundantly duplicated code.  Semantically this is just 
"If call or oneway, pad the message call, otherwise forward it through"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-24 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r80365498
  
--- Diff: compiler/cpp/src/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2458 @@
+/*
+ * 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 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include "t_oop_generator.h"
+#include "platform.h"
+
+using std::map;
+using std::ostream;
+using std::ofstream;
+using std::ostringstream;
+using std::set;
+using std::string;
+using std::stringstream;
+using std::vector;
+
+static const string endl = "\n"; // avoid ostream << std::endl flushes
+
+/**
+ * Swift 3 code generator.
+ *
+ * Designed from the Swift/Cocoa code generator(s)
+ */
+class t_swift_3_generator : public t_oop_generator {
+public:
+  t_swift_3_generator(t_program* program,
+const map& parsed_options,
+const string& option_string)
+: t_oop_generator(program) {
+(void)option_string;
+map::const_iterator iter;
+
+log_unexpected_ = false;
+async_clients_ = false;
+debug_descriptions_ = false;
+no_strict_ = false;
+
+for( iter = parsed_options.begin(); iter != parsed_options.end(); 
++iter) {
+  if( iter->first.compare("log_unexpected") == 0) {
+log_unexpected_ = true;
+  } else if( iter->first.compare("async_clients") == 0) {
+async_clients_ = true;
+  } else if( iter->first.compare("no_strict") == 0) {
+no_strict_ = true;
+  } else if( iter->first.compare("debug_descriptions") == 0) {
+debug_descriptions_ = true;
+  } else {
+throw "unknown option swift:" + iter->first;
+  }
+}
+
+out_dir_base_ = "gen-swift";
+  }
+
+  /**
+   * Init and close methods
+   */
+
+  void init_generator();
+  void close_generator();
+
+  void generate_consts(vector consts);
+
+  /**
+   * Program-level generation functions
+   */
+
+  void generate_typedef(t_typedef* ttypedef);
+  void generate_enum(t_enum* tenum);
+  void generate_struct(t_struct* tstruct);
+  void generate_xception(t_struct* txception);
+  void generate_service(t_service* tservice);
+
+  void print_const_value(ostream& out,
+ string name,
+ t_type* type,
+ t_const_value* value,
+ bool defval = false,
+ bool is_property = false);
+  void render_const_value(ostream& out,
+  t_type* type,
+  t_const_value* value);
+
+  void generate_swift_struct(ofstream& out,
+ t_struct* tstruct,
+ bool is_private,
+ bool is_result);
+  void generate_swift_struct_init(ofstream& out,
+  t_struct* tstruct,
+  bool all,
+  bool is_private);
+
+  void generate_swift_struct_implementation(ofstream& out,
+t_struct* tstruct,
+bool is_result,
+bool is_private);
+  void generate_swift_struct_hashable_extension(ofstream& out,
+t_struct* tstruct,
+bool is_private);
+  void generate_swift_struct_equatable_extension(ofstream& out,
+ t_struct* tstruct,
+ bool is_private);
+  void 

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-24 Thread ChristopherRogers
Github user ChristopherRogers commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r80357625
  
--- Diff: lib/swift/Sources/TMultiplexedProtocol.swift ---
@@ -0,0 +1,47 @@
+/*
+* 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.
+*/
+
+public class TMultiplexedProtocol: 
TWrappedProtocol {
+  public let separator = ":"
+
+  public var serviceName = ""
+  
+  public convenience init(on transport: TTransport, serviceName: String) {
+self.init(on: transport)
+self.serviceName = serviceName
+  }
+
+  override public func writeMessageBegin(name: String,
+ type messageType: TMessageType,
+ sequenceID: Int32) throws {
+switch messageType {
+case .call, .oneway:
+  var serviceFunction = serviceName
+  serviceFunction += serviceName == "" ? "" : separator
+  serviceFunction += name
+  return try super.writeMessageBegin(name: serviceFunction,
+ type: messageType,
+ sequenceID: sequenceID)
+default:
--- End diff --

I would omit `default` and instead explicitly list the remaining cases for 
switch statements like this where the compiler can prove that all cases were 
exhausted.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-24 Thread ChristopherRogers
Github user ChristopherRogers commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r80357489
  
--- Diff: lib/swift/Sources/TProtocol.swift ---
@@ -0,0 +1,182 @@
+/*
+* 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.
+*/
+
+import Foundation
+//
+
+public enum TMessageType: Int32 {
+  case call = 1
+  case reply = 2
+  case exception = 3
+  case oneway = 4
+}
+
+public enum TType: Int32 {
+  case stop = 0
+  case void = 1
+  case bool = 2
+  case byte = 3
--- End diff --

'byte' is deprecated in the IDL, so I would go with 'i8' instead. 
Relatedly, the read/write methods need to use `Int8` instead of `UInt8`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-24 Thread ChristopherRogers
Github user ChristopherRogers commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r80355496
  
--- Diff: compiler/cpp/src/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2458 @@
+/*
+ * 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 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include "t_oop_generator.h"
+#include "platform.h"
+
+using std::map;
+using std::ostream;
+using std::ofstream;
+using std::ostringstream;
+using std::set;
+using std::string;
+using std::stringstream;
+using std::vector;
+
+static const string endl = "\n"; // avoid ostream << std::endl flushes
+
+/**
+ * Swift 3 code generator.
+ *
+ * Designed from the Swift/Cocoa code generator(s)
+ */
+class t_swift_3_generator : public t_oop_generator {
+public:
+  t_swift_3_generator(t_program* program,
+const map& parsed_options,
+const string& option_string)
+: t_oop_generator(program) {
+(void)option_string;
+map::const_iterator iter;
+
+log_unexpected_ = false;
+async_clients_ = false;
+debug_descriptions_ = false;
+no_strict_ = false;
+
+for( iter = parsed_options.begin(); iter != parsed_options.end(); 
++iter) {
+  if( iter->first.compare("log_unexpected") == 0) {
+log_unexpected_ = true;
+  } else if( iter->first.compare("async_clients") == 0) {
+async_clients_ = true;
+  } else if( iter->first.compare("no_strict") == 0) {
+no_strict_ = true;
+  } else if( iter->first.compare("debug_descriptions") == 0) {
+debug_descriptions_ = true;
+  } else {
+throw "unknown option swift:" + iter->first;
+  }
+}
+
+out_dir_base_ = "gen-swift";
+  }
+
+  /**
+   * Init and close methods
+   */
+
+  void init_generator();
+  void close_generator();
+
+  void generate_consts(vector consts);
+
+  /**
+   * Program-level generation functions
+   */
+
+  void generate_typedef(t_typedef* ttypedef);
+  void generate_enum(t_enum* tenum);
+  void generate_struct(t_struct* tstruct);
+  void generate_xception(t_struct* txception);
+  void generate_service(t_service* tservice);
+
+  void print_const_value(ostream& out,
+ string name,
+ t_type* type,
+ t_const_value* value,
+ bool defval = false,
+ bool is_property = false);
+  void render_const_value(ostream& out,
+  t_type* type,
+  t_const_value* value);
+
+  void generate_swift_struct(ofstream& out,
+ t_struct* tstruct,
+ bool is_private,
+ bool is_result);
+  void generate_swift_struct_init(ofstream& out,
+  t_struct* tstruct,
+  bool all,
+  bool is_private);
+
+  void generate_swift_struct_implementation(ofstream& out,
+t_struct* tstruct,
+bool is_result,
+bool is_private);
+  void generate_swift_struct_hashable_extension(ofstream& out,
+t_struct* tstruct,
+bool is_private);
+  void generate_swift_struct_equatable_extension(ofstream& out,
+ t_struct* tstruct,
+ bool is_private);
+  void 

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-24 Thread ChristopherRogers
Github user ChristopherRogers commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r80357106
  
--- Diff: compiler/cpp/src/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2458 @@
+/*
+ * 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 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include "t_oop_generator.h"
+#include "platform.h"
+
+using std::map;
+using std::ostream;
+using std::ofstream;
+using std::ostringstream;
+using std::set;
+using std::string;
+using std::stringstream;
+using std::vector;
+
+static const string endl = "\n"; // avoid ostream << std::endl flushes
+
+/**
+ * Swift 3 code generator.
+ *
+ * Designed from the Swift/Cocoa code generator(s)
+ */
+class t_swift_3_generator : public t_oop_generator {
+public:
+  t_swift_3_generator(t_program* program,
+const map& parsed_options,
+const string& option_string)
+: t_oop_generator(program) {
+(void)option_string;
+map::const_iterator iter;
+
+log_unexpected_ = false;
+async_clients_ = false;
+debug_descriptions_ = false;
+no_strict_ = false;
+
+for( iter = parsed_options.begin(); iter != parsed_options.end(); 
++iter) {
+  if( iter->first.compare("log_unexpected") == 0) {
+log_unexpected_ = true;
+  } else if( iter->first.compare("async_clients") == 0) {
+async_clients_ = true;
+  } else if( iter->first.compare("no_strict") == 0) {
+no_strict_ = true;
+  } else if( iter->first.compare("debug_descriptions") == 0) {
+debug_descriptions_ = true;
+  } else {
+throw "unknown option swift:" + iter->first;
+  }
+}
+
+out_dir_base_ = "gen-swift";
+  }
+
+  /**
+   * Init and close methods
+   */
+
+  void init_generator();
+  void close_generator();
+
+  void generate_consts(vector consts);
+
+  /**
+   * Program-level generation functions
+   */
+
+  void generate_typedef(t_typedef* ttypedef);
+  void generate_enum(t_enum* tenum);
+  void generate_struct(t_struct* tstruct);
+  void generate_xception(t_struct* txception);
+  void generate_service(t_service* tservice);
+
+  void print_const_value(ostream& out,
+ string name,
+ t_type* type,
+ t_const_value* value,
+ bool defval = false,
+ bool is_property = false);
+  void render_const_value(ostream& out,
+  t_type* type,
+  t_const_value* value);
+
+  void generate_swift_struct(ofstream& out,
+ t_struct* tstruct,
+ bool is_private,
+ bool is_result);
+  void generate_swift_struct_init(ofstream& out,
+  t_struct* tstruct,
+  bool all,
+  bool is_private);
+
+  void generate_swift_struct_implementation(ofstream& out,
+t_struct* tstruct,
+bool is_result,
+bool is_private);
+  void generate_swift_struct_hashable_extension(ofstream& out,
+t_struct* tstruct,
+bool is_private);
+  void generate_swift_struct_equatable_extension(ofstream& out,
+ t_struct* tstruct,
+ bool is_private);
+  void 

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-24 Thread ChristopherRogers
Github user ChristopherRogers commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r80355989
  
--- Diff: compiler/cpp/src/generate/t_swift_3_generator.cc ---
@@ -0,0 +1,2458 @@
+/*
+ * 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 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include "t_oop_generator.h"
+#include "platform.h"
+
+using std::map;
+using std::ostream;
+using std::ofstream;
+using std::ostringstream;
+using std::set;
+using std::string;
+using std::stringstream;
+using std::vector;
+
+static const string endl = "\n"; // avoid ostream << std::endl flushes
+
+/**
+ * Swift 3 code generator.
+ *
+ * Designed from the Swift/Cocoa code generator(s)
+ */
+class t_swift_3_generator : public t_oop_generator {
+public:
+  t_swift_3_generator(t_program* program,
+const map& parsed_options,
+const string& option_string)
+: t_oop_generator(program) {
+(void)option_string;
+map::const_iterator iter;
+
+log_unexpected_ = false;
+async_clients_ = false;
+debug_descriptions_ = false;
+no_strict_ = false;
+
+for( iter = parsed_options.begin(); iter != parsed_options.end(); 
++iter) {
+  if( iter->first.compare("log_unexpected") == 0) {
+log_unexpected_ = true;
+  } else if( iter->first.compare("async_clients") == 0) {
+async_clients_ = true;
+  } else if( iter->first.compare("no_strict") == 0) {
+no_strict_ = true;
+  } else if( iter->first.compare("debug_descriptions") == 0) {
+debug_descriptions_ = true;
+  } else {
+throw "unknown option swift:" + iter->first;
+  }
+}
+
+out_dir_base_ = "gen-swift";
+  }
+
+  /**
+   * Init and close methods
+   */
+
+  void init_generator();
+  void close_generator();
+
+  void generate_consts(vector consts);
+
+  /**
+   * Program-level generation functions
+   */
+
+  void generate_typedef(t_typedef* ttypedef);
+  void generate_enum(t_enum* tenum);
+  void generate_struct(t_struct* tstruct);
+  void generate_xception(t_struct* txception);
+  void generate_service(t_service* tservice);
+
+  void print_const_value(ostream& out,
+ string name,
+ t_type* type,
+ t_const_value* value,
+ bool defval = false,
+ bool is_property = false);
+  void render_const_value(ostream& out,
+  t_type* type,
+  t_const_value* value);
+
+  void generate_swift_struct(ofstream& out,
+ t_struct* tstruct,
+ bool is_private,
+ bool is_result);
+  void generate_swift_struct_init(ofstream& out,
+  t_struct* tstruct,
+  bool all,
+  bool is_private);
+
+  void generate_swift_struct_implementation(ofstream& out,
+t_struct* tstruct,
+bool is_result,
+bool is_private);
+  void generate_swift_struct_hashable_extension(ofstream& out,
+t_struct* tstruct,
+bool is_private);
+  void generate_swift_struct_equatable_extension(ofstream& out,
+ t_struct* tstruct,
+ bool is_private);
+  void 

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-13 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78584053
  
--- Diff: lib/swift/Sources/TApplicationError.swift ---
@@ -0,0 +1,157 @@
+/*
+* 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.
+*/
+
+
+public struct TApplicationError : TError {
+  public enum Code : TErrorCode {
+case unknown
+case unknownMethod(methodName: String?)
+case invalidMessageType
+case wrongMethodName(methodName: String?)
+case badSequenceId
+case missingResult(methodName: String?)
+case internalError
+case protocolError
+case invalidTransform
+case invalidProtocol
+case unsupportedClientType
+
+
+/// Initialize a TApplicationError with a Thrift error code
+/// Normally this would be achieved with RawRepresentable however
+/// by doing this we can allow for associated properties on enum cases 
for
+/// case specific context data in a Swifty, type-safe manner.
+///
+/// - parameter thriftErrorCode: Integer TApplicationError(exception) 
error code.  
+///  Default to 0 (.unknown)
+public init(thriftErrorCode: Int) {
+  switch thriftErrorCode {
+  case 1:  self = .unknownMethod(methodName: nil)
+  case 2:  self = .invalidMessageType
+  case 3:  self = .wrongMethodName(methodName: nil)
+  case 4:  self = .badSequenceId
+  case 5:  self = .missingResult(methodName: nil)
+  case 6:  self = .internalError
+  case 7:  self = .protocolError
+  case 8:  self = .invalidProtocol
+  case 9:  self = .invalidTransform
+  case 10: self = .unsupportedClientType
+  default: self = .unknown
+  }
+}
+public var thriftErrorCode: Int {
+  switch self {
+  case .unknown:return 0
+  case .unknownMethod:  return 1
+  case .invalidMessageType: return 2
+  case .wrongMethodName:return 3
+  case .badSequenceId:  return 4
+  case .missingResult:  return 5
+  case .internalError:  return 6
+  case .protocolError:  return 7
+  case .invalidProtocol:return 8
+  case .invalidTransform:   return 9
+  case .unsupportedClientType:  return 10
+  }
+}
+
+public var description: String {
+  /// Output "for #methodName" if method is not nil else empty
+  let methodUnwrap: (String?) -> String =  { method in
+return "\(method == nil ? "" : " for \(method ?? "")")"
+  }
+  switch self {
+  case .unknown:  return "Unknown 
TApplicationError"
+  case .unknownMethod(let method):return "Unknown 
Method\(methodUnwrap(method))"
+  case .invalidMessageType:   return "Invalid Message Type"
+  case .wrongMethodName(let method):  return "Wrong Method 
Name\(methodUnwrap(method))"
+  case .badSequenceId:return "Bad Sequence ID"
+  case .missingResult(let method):return "Missing 
Result\(methodUnwrap(method))"
+  case .internalError:return "Internal Error"
+  case .protocolError:return "Protocol Error"
+  case .invalidProtocol:  return "Invalid Protocol"
+  case .invalidTransform: return "Invalid Transform"
+  case .unsupportedClientType:return "Unsupported Client Type"
+  }
+}
+  }
+
+  public init() { }
+  
+  public init(thriftErrorCode code: Int, message: String?=nil) {
--- End diff --

I'll do another styling sweep here soon.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure 

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-13 Thread SirWellington
Github user SirWellington commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78503326
  
--- Diff: lib/swift/Sources/TApplicationError.swift ---
@@ -0,0 +1,157 @@
+/*
+* 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.
+*/
+
+
+public struct TApplicationError : TError {
+  public enum Code : TErrorCode {
+case unknown
+case unknownMethod(methodName: String?)
+case invalidMessageType
+case wrongMethodName(methodName: String?)
+case badSequenceId
+case missingResult(methodName: String?)
+case internalError
+case protocolError
+case invalidTransform
+case invalidProtocol
+case unsupportedClientType
+
+
+/// Initialize a TApplicationError with a Thrift error code
+/// Normally this would be achieved with RawRepresentable however
+/// by doing this we can allow for associated properties on enum cases 
for
+/// case specific context data in a Swifty, type-safe manner.
+///
+/// - parameter thriftErrorCode: Integer TApplicationError(exception) 
error code.  
+///  Default to 0 (.unknown)
+public init(thriftErrorCode: Int) {
+  switch thriftErrorCode {
+  case 1:  self = .unknownMethod(methodName: nil)
+  case 2:  self = .invalidMessageType
+  case 3:  self = .wrongMethodName(methodName: nil)
+  case 4:  self = .badSequenceId
+  case 5:  self = .missingResult(methodName: nil)
+  case 6:  self = .internalError
+  case 7:  self = .protocolError
+  case 8:  self = .invalidProtocol
+  case 9:  self = .invalidTransform
+  case 10: self = .unsupportedClientType
+  default: self = .unknown
+  }
+}
+public var thriftErrorCode: Int {
+  switch self {
+  case .unknown:return 0
+  case .unknownMethod:  return 1
+  case .invalidMessageType: return 2
+  case .wrongMethodName:return 3
+  case .badSequenceId:  return 4
+  case .missingResult:  return 5
+  case .internalError:  return 6
+  case .protocolError:  return 7
+  case .invalidProtocol:return 8
+  case .invalidTransform:   return 9
+  case .unsupportedClientType:  return 10
+  }
+}
+
+public var description: String {
+  /// Output "for #methodName" if method is not nil else empty
+  let methodUnwrap: (String?) -> String =  { method in
+return "\(method == nil ? "" : " for \(method ?? "")")"
+  }
+  switch self {
+  case .unknown:  return "Unknown 
TApplicationError"
+  case .unknownMethod(let method):return "Unknown 
Method\(methodUnwrap(method))"
+  case .invalidMessageType:   return "Invalid Message Type"
+  case .wrongMethodName(let method):  return "Wrong Method 
Name\(methodUnwrap(method))"
+  case .badSequenceId:return "Bad Sequence ID"
+  case .missingResult(let method):return "Missing 
Result\(methodUnwrap(method))"
+  case .internalError:return "Internal Error"
+  case .protocolError:return "Protocol Error"
+  case .invalidProtocol:  return "Invalid Protocol"
+  case .invalidTransform: return "Invalid Transform"
+  case .unsupportedClientType:return "Unsupported Client Type"
+  }
+}
+  }
+
+  public init() { }
+  
+  public init(thriftErrorCode code: Int, message: String?=nil) {
--- End diff --

Might wanna space out the `String?=nil` to `String? = nil`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-11 Thread fumoboy007
Github user fumoboy007 commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78313579
  
--- Diff: lib/swift/Sources/LinuxHelper.swift ---
@@ -0,0 +1,42 @@
+//
+//  LinuxHelper.swift
+//  Thrift
+//
+//  Created by Christopher Simpson on 8/22/16.
+//
+//
+
+import Foundation
+import CoreFoundation
+
+#if os(Linux)
+/// Extensions for Linux for incomplete Foundation API's.
+/// swift-corelibs-foundation is not yet 1:1 with OSX/iOS Foundation
+
+extension URLSession {
+  // Current one uses NSURLRequest which doesn't currently bridge
+  @discardableResult
+  open func dataTask(with request: URLRequest, completionHandler: 
@escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask {
--- End diff --

I’m not too sure how the tagging/branching works in the Swift repo, but I 
see that the 
[commit](https://github.com/apple/swift-corelibs-foundation/commit/cffa65a1f933ddb29b7d3d21cd1756caeddc238f)
 is in `swift-3.0-branch` (as well as `master`) and is included in the 
`swift-3.0-GM-CANDIDATE` tag.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-11 Thread apocolipse
Github user apocolipse commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78313057
  
--- Diff: lib/swift/Sources/LinuxHelper.swift ---
@@ -0,0 +1,42 @@
+//
+//  LinuxHelper.swift
+//  Thrift
+//
+//  Created by Christopher Simpson on 8/22/16.
+//
+//
+
+import Foundation
+import CoreFoundation
+
+#if os(Linux)
+/// Extensions for Linux for incomplete Foundation API's.
+/// swift-corelibs-foundation is not yet 1:1 with OSX/iOS Foundation
+
+extension URLSession {
+  // Current one uses NSURLRequest which doesn't currently bridge
+  @discardableResult
+  open func dataTask(with request: URLRequest, completionHandler: 
@escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask {
--- End diff --

@fumoboy007 Which tag was that added in?  I'm attempting to have this match 
up with GM (its been tricky the past few weeks -_-)
I don't mind floating it since on the Darwin side, this stuff is all good 
to go where its hard to update swift, whereas the linux side its a little 
easier to update Swift to snapshots to ensure a solid library build.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-11 Thread fumoboy007
Github user fumoboy007 commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78312854
  
--- Diff: lib/swift/Sources/LinuxHelper.swift ---
@@ -0,0 +1,42 @@
+//
+//  LinuxHelper.swift
+//  Thrift
+//
+//  Created by Christopher Simpson on 8/22/16.
+//
+//
+
+import Foundation
+import CoreFoundation
+
+#if os(Linux)
+/// Extensions for Linux for incomplete Foundation API's.
+/// swift-corelibs-foundation is not yet 1:1 with OSX/iOS Foundation
+
+extension URLSession {
+  // Current one uses NSURLRequest which doesn't currently bridge
+  @discardableResult
+  open func dataTask(with request: URLRequest, completionHandler: 
@escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask {
--- End diff --

Not necessary anymore I think: 
https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSURLSession/NSURLSession.swift#L423


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-11 Thread fumoboy007
Github user fumoboy007 commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78312577
  
--- Diff: lib/swift/Sources/TStruct.swift ---
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+
+
+/// Protocol for Generated Structs to conform to
+/// Dictionary maps field names to internal IDs and uses Reflection
+/// to iterate through all fields.  
+/// `writeFieldValue(_:name:type:id:)` calls `TSerializable.write(to:)` 
internally
+/// giving a nice recursive behavior for nested TStructs, TLists, TMaps, 
and TSets
+public protocol TStruct : TSerializable {
+  static var fieldIds: [String: Int32] { get }
+  static var structName: String { get }
+}
+
+public extension TStruct {
+  public static var fieldIds: [String: (id: Int32, type: TType)] { return 
[:] }
+  public static var thriftType: TType { return .struct }
+  
+  public func write(to proto: TProtocol) throws {
+// Write struct name first
+try proto.writeStructBegin(name: Self.structName)
+
+try self.forEach { name, value, id in
+  // Write to protocol
+  try proto.writeFieldValue(value, name: name,
+type: value.thriftType, id: id)
+}
+try proto.writeFieldStop()
+try proto.writeStructEnd()
+  }
+  
+  public var hashValue: Int {
+let prime = 31
+var result = 1
+self.forEach { _, value, _ in
+  result = prime * result + (value.hashValue)
--- End diff --

`&*`, `&+`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-11 Thread fumoboy007
Github user fumoboy007 commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78312532
  
--- Diff: lib/swift/Sources/TSet.swift ---
@@ -0,0 +1,175 @@
+/*
+ * 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.
+ */
+
+import Foundation
+
+public struct TSet : SetAlgebra, 
Hashable, Collection, ExpressibleByArrayLiteral, TSerializable {
+  /// Typealias for Storage type
+  typealias Storage = Set
+  
+  
+  /// Internal Storage used for TSet (Set\)
+  internal var storage : Storage
+  
+  
+  /// Mark: Collection
+  
+  public typealias Indices = Storage.Indices
+  public typealias Index = Storage.Index
+  public typealias IndexDistance = Storage.IndexDistance
+  public typealias SubSequence = Storage.SubSequence
+  
+  
+  public var indices: Indices { return storage.indices }
+  
+  // Must implement isEmpty even though both SetAlgebra and Collection 
provide it due to their conflciting default implementations
+  public var isEmpty: Bool { return storage.isEmpty }
+  
+  public func distance(from start: Index, to end: Index) -> IndexDistance {
+return storage.distance(from: start, to: end)
+  }
+  
+  public func index(_ i: Index, offsetBy n: IndexDistance) -> Index {
+return storage.index(i, offsetBy: n)
+  }
+  
+  public func index(_ i: Index, offsetBy n: IndexDistance, limitedBy 
limit: Index) -> Index? {
+return storage.index(i, offsetBy: n, limitedBy: limit)
+  }
+  
+  public subscript (position: Storage.Index) -> Element? {
+return storage[position]
+  }
+  
+  /// Mark: SetAlgebra
+  internal init(storage: Set) {
+self.storage = storage
+  }
+  
+  public func contains(_ member: Element) -> Bool {
+return storage.contains(member)
+  }
+  
+  public mutating func insert(_ newMember: Element) -> (inserted: Bool, 
memberAfterInsert: Element) {
+return storage.insert(newMember)
+  }
+  
+  public mutating func remove(_ member: Element) -> Element? {
+return storage.remove(member)
+  }
+  
+  public func union(_ other: TSet) -> TSet {
+return TSet(storage: storage.union(other.storage))
+  }
+  
+  public mutating func formIntersection(_ other: TSet) {
+return storage.formIntersection(other.storage)
+  }
+  
+  public mutating func formSymmetricDifference(_ other: TSet) {
+return storage.formSymmetricDifference(other.storage)
+  }
+  
+  public mutating func formUnion(_ other: TSet) {
+return storage.formUnion(other.storage)
+  }
+  
+  public func intersection(_ other: TSet) -> TSet {
+return TSet(storage: storage.intersection(other.storage))
+  }
+  
+  public func symmetricDifference(_ other: TSet) -> TSet {
+return TSet(storage: storage.symmetricDifference(other.storage))
+  }
+  
+  public mutating func update(with newMember: Element) -> Element? {
+return storage.update(with: newMember)
+  }
+  
+  /// Mark: IndexableBase
+  
+  public var startIndex: Index { return storage.startIndex }
+  public var endIndex: Index { return storage.endIndex }
+  public func index(after i: Index) -> Index {
+return storage.index(after: i)
+  }
+
+  public func formIndex(after i: inout Storage.Index) {
+storage.formIndex(after: )
+  }
+  
+  public subscript(bounds: Range) -> SubSequence {
+return storage[bounds]
+  }
+
+  
+  /// Mark: Hashable
+  public var hashValue : Int {
+let prime = 31
+var result = 1
+for element in storage {
+  result = prime * result + element.hashValue
--- End diff --

`&*`, `&+`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is 

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-11 Thread fumoboy007
Github user fumoboy007 commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78312512
  
--- Diff: lib/swift/Sources/TMap.swift ---
@@ -0,0 +1,182 @@
+/*
+ * 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.
+ */
+
+public struct TMap: 
Collection, ExpressibleByDictionaryLiteral, Hashable, TSerializable {
+  typealias Storage = Dictionary
+  public typealias Element = Storage.Element
+  public typealias Index = Storage.Index
+  public typealias IndexDistance = Storage.IndexDistance
+  public typealias Indices = Storage.Indices
+  public typealias SubSequence = Storage.SubSequence
+  internal var storage = Storage()
+  
+  /// Mark: Be Like Dictionary
+  
+  public func indexForKey(_ key: Key) -> Index? {
+return storage.index(forKey: key)
+  }
+  
+  public mutating func updateValue(_ value: Value, forKey key: Key) -> 
Value? {
+return updateValue(value, forKey: key)
+  }
+  
+  public mutating func removeAtIndex(_ index: DictionaryIndex) 
-> (Key, Value) {
+return removeAtIndex(index)
+  }
+  
+  public mutating func removeValueForKey(_ key: Key) -> Value? {
+return storage.removeValue(forKey: key)
+  }
+  
+  public init(minimumCapacity: Int) {
+storage = Storage(minimumCapacity: minimumCapacity)
+  }
+  
+  public subscript (key: Key) -> Value? {
+get {
+  return storage[key]
+}
+set {
+  storage[key] = newValue
+}
+  }
+  
+  /// Mark: Collection
+  
+  public var indices: Indices {
+return storage.indices
+  }
+  
+  public func distance(from start: Index, to end: Index) -> IndexDistance {
+return storage.distance(from: start, to: end)
+  }
+  
+  public func index(_ i: Index, offsetBy n: IndexDistance) -> Index {
+return storage.index(i, offsetBy: n)
+  }
+  
+  public func index(_ i: Index, offsetBy n: IndexDistance, limitedBy 
limit: Index) -> Index? {
+return storage.index(i, offsetBy: n, limitedBy: limit)
+  }
+  
+  public subscript(position: Index) -> Element {
+return storage[position]
+  }
+  
+  /// Mark: IndexableBase
+  
+  public var startIndex: Index { return storage.startIndex }
+  public var endIndex: Index { return storage.endIndex }
+  public func index(after i: Index) -> Index {
+return storage.index(after: i)
+  }
+  
+  public func formIndex(after i: inout Index) {
+storage.formIndex(after: )
+  }
+  
+  public subscript(bounds: Range) -> SubSequence {
+return storage[bounds]
+  }
+  
+  /// Mark: DictionaryLiteralConvertible
+  
+  public init(dictionaryLiteral elements: (Key, Value)...) {
+storage = Storage()
+for (key, value) in elements {
+  storage[key] = value
+}
+  }
+
+  /// Mark: Hashable
+  
+  public var hashValue: Int {
+let prime = 31
+var result = 1
+for (key, value) in storage {
+  result = prime * result + key.hashValue
--- End diff --

`&*`, `&+`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-11 Thread fumoboy007
Github user fumoboy007 commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78312455
  
--- Diff: lib/swift/Sources/TApplicationError.swift ---
@@ -0,0 +1,157 @@
+/*
+* 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.
+*/
+
+
+public struct TApplicationError : TError {
+  public enum Code : TErrorCode {
+case unknown
+case unknownMethod(methodName: String?)
+case invalidMessageType
+case wrongMethodName(methodName: String?)
+case badSequenceId
+case missingResult(methodName: String?)
+case internalError
+case protocolError
+case invalidTransform
+case invalidProtocol
+case unsupportedClientType
+
+
+/// Initialize a TApplicationError with a Thrift error code
+/// Normally this would be achieved with RawRepresentable however
+/// by doing this we can allow for associated properties on enum cases 
for
+/// case specific context data in a Swifty, type-safe manner.
+///
+/// - parameter thriftErrorCode: Integer TApplicationError(exception) 
error code.  
+///  Default to 0 (.unknown)
+public init(thriftErrorCode: Int) {
+  switch thriftErrorCode {
+  case 1:  self = .unknownMethod(methodName: nil)
+  case 2:  self = .invalidMessageType
+  case 3:  self = .wrongMethodName(methodName: nil)
+  case 4:  self = .badSequenceId
+  case 5:  self = .missingResult(methodName: nil)
+  case 6:  self = .internalError
+  case 7:  self = .protocolError
+  case 8:  self = .invalidProtocol
+  case 9:  self = .invalidTransform
+  case 10: self = .unsupportedClientType
+  default: self = .unknown
+  }
+}
+public var thriftErrorCode: Int {
+  switch self {
+  case .unknown:return 0
+  case .unknownMethod:  return 1
+  case .invalidMessageType: return 2
+  case .wrongMethodName:return 3
+  case .badSequenceId:  return 4
+  case .missingResult:  return 5
+  case .internalError:  return 6
+  case .protocolError:  return 7
+  case .invalidProtocol:return 8
+  case .invalidTransform:   return 9
+  case .unsupportedClientType:  return 10
+  }
+}
+
+public var description: String {
+  /// Output "for #methodName" if method is not nil else empty
+  let methodUnwrap: (String?) -> String =  { method in
+return "\(method == nil ? "" : " for \(method ?? "")")"
+  }
+  switch self {
+  case .unknown:  return "Unknown 
TApplicationError"
+  case .unknownMethod(let method):return "Unknown 
Method\(methodUnwrap(method))"
+  case .invalidMessageType:   return "Invalid Message Type"
+  case .wrongMethodName(let method):  return "Wrong Method 
Name\(methodUnwrap(method))"
+  case .badSequenceId:return "Bad Sequence ID"
+  case .missingResult(let method):return "Missing 
Result\(methodUnwrap(method))"
+  case .internalError:return "Internal Error"
+  case .protocolError:return "Protocol Error"
+  case .invalidProtocol:  return "Invalid Protocol"
+  case .invalidTransform: return "Invalid Transform"
+  case .unsupportedClientType:return "Unsupported Client Type"
+  }
+}
+  }
+
+  public init() { }
+  
+  public init(thriftErrorCode code: Int, message: String?=nil) {
+self.error = Code(thriftErrorCode: code)
+self.message = message
+  }
+  
+  public var error: Code = .unknown
+  public var message: String? = nil
+  public static var defaultCase: Code { return .unknown }
+}
+
+extension TApplicationError : TSerializable {
+  public 

[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-11 Thread fumoboy007
Github user fumoboy007 commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1084#discussion_r78312489
  
--- Diff: lib/swift/Sources/TList.swift ---
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+
+public struct TList : RandomAccessCollection, 
MutableCollection, ExpressibleByArrayLiteral, TSerializable, Hashable {
+  typealias Storage = Array
+  public typealias Indices = Storage.Indices
+
+  internal var storage = Storage()
+  public init() { }
+  public init(arrayLiteral elements: Element...) {
+self.storage = Storage(storage)
+  }
+
+  /// Mark: Hashable
+  public var hashValue : Int {
+let prime = 31
+var result = 1
+for element in storage {
+  result = prime * result + element.hashValue
--- End diff --

`&*`, `&+`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift pull request #1084: THRIFT-3773 Swift 3 Native Library

2016-09-09 Thread apocolipse
GitHub user apocolipse opened a pull request:

https://github.com/apache/thrift/pull/1084

THRIFT-3773 Swift 3 Native Library

Here is my implementation of the Thrift library for Swift 3.0, pure swift.  
There is no Objective-C requirement here. 
For implementation and design details, please refer to comments here:
https://issues.apache.org/jira/browse/THRIFT-3773?jql=text%20~%20%22swift%22
And to the README here:
https://github.com/apocolipse/thrift/tree/master/lib/swift

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apocolipse/thrift master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/thrift/pull/1084.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1084


commit 295b81ca504c3542bdf49e949cbbcb6493e1e3f1
Author: Chris Simpson 
Date:   2016-06-28T04:09:06Z

Initial 3.0 commit, copy over swift generator and update makefiles to build

commit 3faf93e9daab54351a74c5f5ea91002b95b1b7cb
Author: Chris Simpson 
Date:   2016-06-28T04:13:41Z

Removed PromiseKit option

commit a55b69a90daf6bdc1c6e0658a04c44d647ab090a
Author: Chris Simpson 
Date:   2016-06-28T17:50:15Z

Swifty Enums and function signatures

commit 0d77f8f5e6fe6b2c25af33508ddc83fbd5a5ea4a
Author: Chris Simpson 
Date:   2016-07-01T05:54:35Z

Add in lib, updated code gen

commit 105b14b0d0fbbe132de6e6db4fb153637d8ab1a6
Author: Chris Simpson 
Date:   2016-07-20T18:00:29Z

Merge branch 'master' of github.com:apache/thrift

commit cf5e1a01d82e1cee73754ffd01d9838a3bd2e7f9
Author: Chris Simpson 
Date:   2016-08-19T18:12:47Z

meh

commit 59d2d6263a5a524a5aab348ff3475fd9ed6af553
Author: Chris Simpson 
Date:   2016-08-19T18:12:51Z

Merge branch 'master' of github.com:apache/thrift

commit 6faca578da091f8ab4fe0358d26019a8665028cf
Author: Chris Simpson 
Date:   2016-08-24T19:55:47Z

Error and fileprivate

commit d8166d9a820f9d830b35b7b857cb8b8d9364521a
Author: Chris Simpson 
Date:   2016-08-25T19:08:17Z

Fix for TEnum's and constant enum value rendering

commit b0755f6d6c6e76b4a1982938df77a17aead91d1b
Author: Chris Simpson 
Date:   2016-08-25T20:50:32Z

Merge branch 'master' of https://github.com/apache/thrift

commit 8d3436f83d826c5e83066954b9eb55609ece1651
Author: Chris Simpson 
Date:   2016-09-07T19:33:21Z

Working compiler

commit 286c7a951393ee78c04405355cd1b5010fb94df9
Author: Chris Simpson 
Date:   2016-09-09T18:03:46Z

Add sources

commit fcec22a5c456be82fffa1009ea3f99b84ad4a8b8
Author: Chris Simpson 
Date:   2016-09-09T18:47:33Z

Working Library

commit 1398375fca765a7552fba3908095362f4054fe64
Author: Chris Simpson 
Date:   2016-09-09T18:48:12Z

Merge branch 'master' of https://github.com/apache/thrift




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---