From 98a15cf36ae79e3815e6d1495e4c90b1bdb1038e Mon Sep 17 00:00:00 2001 From: Ben S Date: Fri, 5 Dec 2014 20:51:08 +0000 Subject: [PATCH] Skip over empty function/module definitions --- rust.mm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust.mm b/rust.mm index d9c3aee..0adc403 100644 --- a/rust.mm +++ b/rust.mm @@ -276,6 +276,14 @@ SInt32 skipToEndOfFunction(BBLMTextIterator &iter) if (braceLevel < 1) return length; break; + case ';': + // If the definition just ends with a semicolon, then it's + // either a function in a trait definition, or a C function + // definition in an extern, neither of which we want in the + // function list. + if (braceLevel < 1) return 0; + break; + case '(': parenLevel++; break; @@ -315,6 +323,13 @@ SInt32 scanForSymbol(BBLMTextIterator &iter, if ((wordLen = skipWord(iter))) { UInt32 funLen = skipToEndOfFunction(iter); + + // Skip over trait method definitions and extern functions + if (funLen == 0) + { + return 0; + } + UInt32 tokenOffset, funIndex; UInt32 nameLen; BBLMProcInfo info;