From 982b14370f2132463ebe0666d329854a807fc269 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Sat, 9 Jan 2016 21:14:59 +0100 Subject: [PATCH 1/2] Ruby fix unbalanced braces causing issue with the YARD parser --- Source/Modules/ruby.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index f28ba9fd9..d21fe0fbb 100644 --- a/Source/Modules/ruby.cxx +++ b/Source/Modules/ruby.cxx @@ -1744,6 +1744,9 @@ public: Printf(f->def, "#else\n"); Printv(f->def, "SWIGINTERN VALUE\n", wname, "(int argc, VALUE *argv, VALUE self) {", NIL); Printf(f->def, "#endif\n"); + Printf(f->def, "#if 0\n"); + Printf(f->def, "} /* c-mode */\n"); + Printf(f->def, "#endif\n"); } else if (current == CONSTRUCTOR_INITIALIZE) { Printv(f->def, "SWIGINTERN VALUE\n", wname, "(int argc, VALUE *argv, VALUE self) {", NIL); if (!varargs) { From 2d094d7d9ffb14e25258025c3b44c001b466468f Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 10 Jan 2016 20:19:35 +0000 Subject: [PATCH 2/2] Alternative solution for Ruby unbalanced braces --- Source/Modules/ruby.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index d21fe0fbb..216d4ef27 100644 --- a/Source/Modules/ruby.cxx +++ b/Source/Modules/ruby.cxx @@ -1739,14 +1739,13 @@ public: /* Now write the wrapper function itself */ if (current == CONSTRUCTOR_ALLOCATE) { + Printv(f->def, "SWIGINTERN VALUE\n", NIL); Printf(f->def, "#ifdef HAVE_RB_DEFINE_ALLOC_FUNC\n"); - Printv(f->def, "SWIGINTERN VALUE\n", wname, "(VALUE self) {", NIL); + Printv(f->def, wname, "(VALUE self)\n", NIL); Printf(f->def, "#else\n"); - Printv(f->def, "SWIGINTERN VALUE\n", wname, "(int argc, VALUE *argv, VALUE self) {", NIL); - Printf(f->def, "#endif\n"); - Printf(f->def, "#if 0\n"); - Printf(f->def, "} /* c-mode */\n"); + Printv(f->def, wname, "(int argc, VALUE *argv, VALUE self)\n", NIL); Printf(f->def, "#endif\n"); + Printv(f->def, "{\n", NIL); } else if (current == CONSTRUCTOR_INITIALIZE) { Printv(f->def, "SWIGINTERN VALUE\n", wname, "(int argc, VALUE *argv, VALUE self) {", NIL); if (!varargs) {