Commit 143fb84c authored by Jacob Potter's avatar Jacob Potter

Assorted small fixes/cleanups

parent 805c1eda
...@@ -20,11 +20,9 @@ import djinni.ast.Record.DerivingType ...@@ -20,11 +20,9 @@ import djinni.ast.Record.DerivingType
import djinni.ast._ import djinni.ast._
import djinni.generatorTools._ import djinni.generatorTools._
import djinni.meta._ import djinni.meta._
import djinni.syntax.Error
import djinni.writer.IndentWriter import djinni.writer.IndentWriter
import scala.collection.mutable import scala.collection.mutable
import scala.collection.parallel.immutable
class ObjcppGenerator(spec: Spec) extends Generator(spec) { class ObjcppGenerator(spec: Spec) extends Generator(spec) {
...@@ -229,7 +227,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -229,7 +227,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
if (i.ext.objc) { if (i.ext.objc) {
// If it could be implemented in ObjC, we might have to unwrap a proxy object. // If it could be implemented in ObjC, we might have to unwrap a proxy object.
val objcExtSelf = objcppMarshal.helperClass("objc_proxy") val objcExtSelf = objcppMarshal.helperClass("objc_proxy")
w.w(s"if (auto cppPtr = dynamic_cast<${objcExtSelf}*>(cpp.get()))").braced { w.w(s"if (auto cppPtr = dynamic_cast<$objcExtSelf*>(cpp.get()))").braced {
w.wl("return cppPtr->Handle::get();") w.wl("return cppPtr->Handle::get();")
} }
} }
...@@ -277,7 +275,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -277,7 +275,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
w.wl(s"struct $helperClass") w.wl(s"struct $helperClass")
w.bracedSemi { w.bracedSemi {
w.wl(s"using CppType = $cppSelf;") w.wl(s"using CppType = $cppSelf;")
w.wl(s"using ObjcType = $noBaseSelf*;"); w.wl(s"using ObjcType = $noBaseSelf*;")
w.wl w.wl
w.wl(s"using Boxed = $helperClass;") w.wl(s"using Boxed = $helperClass;")
w.wl w.wl
......
...@@ -174,7 +174,6 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha ...@@ -174,7 +174,6 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha
env->ExceptionClear(); env->ExceptionClear();
env->DeleteLocalRef(cassert); env->DeleteLocalRef(cassert);
env->DeleteLocalRef(e);
jniThrowCppFromJavaException(env, e); jniThrowCppFromJavaException(env, e);
} }
......
# Record containing constants
constants = record { constants = record {
some_integer: i32; some_integer: i32;
some_string: string; some_string: string;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
/** Record containing constants */
struct Constants final { struct Constants final {
/** bool_constant has documentation. */ /** bool_constant has documentation. */
......
...@@ -6,6 +6,7 @@ package com.dropbox.djinni.test; ...@@ -6,6 +6,7 @@ package com.dropbox.djinni.test;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
/** Record containing constants */
public final class Constants { public final class Constants {
/** bool_constant has documentation. */ /** bool_constant has documentation. */
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "DBConstants.h" #import "DBConstants.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
/** Record containing constants */
@interface DBConstants : NSObject @interface DBConstants : NSObject
- (nonnull instancetype)initWithSomeInteger:(int32_t)someInteger - (nonnull instancetype)initWithSomeInteger:(int32_t)someInteger
someString:(nonnull NSString *)someString; someString:(nonnull NSString *)someString;
......
...@@ -17,7 +17,7 @@ public class AllTests extends TestSuite { ...@@ -17,7 +17,7 @@ public class AllTests extends TestSuite {
mySuite.addTestSuite(EnumTest.class); mySuite.addTestSuite(EnumTest.class);
mySuite.addTestSuite(PrimitivesTest.class); mySuite.addTestSuite(PrimitivesTest.class);
mySuite.addTestSuite(TokenTest.class); mySuite.addTestSuite(TokenTest.class);
mySuite.addTestSuite(DurationTest.class); mySuite.addTestSuite(DurationTest.class);
return mySuite; return mySuite;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment