From eb109c4dc55eb68abecf4c201d1385cb0b4fbdf2 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Thu, 1 Dec 2011 22:06:05 +0000 Subject: [PATCH] Cleaned up debug code --- gtsam.h | 1 + wrap/Module.cpp | 9 +-------- wrap/tests/testSpirit.cpp | 26 -------------------------- wrap/utilities.cpp | 5 ----- wrap/utilities.h | 5 ----- 5 files changed, 2 insertions(+), 44 deletions(-) diff --git a/gtsam.h b/gtsam.h index ed746c033..7e3a7eaa1 100644 --- a/gtsam.h +++ b/gtsam.h @@ -10,6 +10,7 @@ * Comments can use either C++ or C style * Static methods are not supported * Methods must start with a lowercase letter + * Classes must start with an uppercase letter */ class Point2 { diff --git a/wrap/Module.cpp b/wrap/Module.cpp index 922983de2..523e90793 100644 --- a/wrap/Module.cpp +++ b/wrap/Module.cpp @@ -170,15 +170,8 @@ Module::Module(const string& interfacePath, string interfaceFile = interfacePath + "/" + moduleName + ".h"; string contents = file_contents(interfaceFile); - // FIXME: Comment parser does not work for some reason - see confix parsers -// rule<> comment_p = str_p("/*") >> +anychar_p >> "*/"; -// rule<> skip_p = space_p | comment_p; -// rule<> skip_p = space_p | comment_p("//"); // FIXME: also doesn't work -// rule<> skip_p = space_p | comment_p("/*", "*/"); // FIXME: Doesn't compile - rule<> skip_p = space_p; - // and parse contents - parse_info info = parse(contents.c_str(), module_p, skip_p); + parse_info info = parse(contents.c_str(), module_p, space_p); if(!info.full) { printf("parsing stopped at \n%.20s\n",info.stop); throw ParseFailed(info.length); diff --git a/wrap/tests/testSpirit.cpp b/wrap/tests/testSpirit.cpp index 5310ecff6..9683a3372 100644 --- a/wrap/tests/testSpirit.cpp +++ b/wrap/tests/testSpirit.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -103,31 +102,6 @@ TEST( spirit, constMethod_p ) { EXPECT(parse("double norm() const;", constMethod_p, space_p).full); } -/* ************************************************************************* */ -TEST( spirit, comments ) { -// Rule name_p = lexeme_d[alpha_p >> *(alnum_p | '_')]; -// -// Rule argument_p = -// ((basisType_p[assign_a(arg.type)] | eigenType | classPtr_p | classRef_p) >> name_p[assign_a(arg.name)]) -// [push_back_a(args, arg)] -// [assign_a(arg,arg0)]; -// -// Rule void_p = str_p("void")[assign_a(method.returns_)]; - - vector all_strings; - string actual; -// Rule slash_comment_p = str_p("//"); -// Rule comments_p = anychar_p[assign_a(actual)] -// Rule comments_p = lexeme_d[*(anychar_p)[assign_a(actual)] - -// Rule line_p = (*anychar_p - comment_p("//"))[assign_a(actual)] >> !(comment_p("//") >> *anychar_p); // FAIL: matches everything -// Rule line_p = *anychar_p[assign_a(actual)] >> !(comment_p("//") >> *anychar_p); // FAIL: matches last letter -// Rule line_p = (*anychar_p - comment_p("//"))[assign_a(actual)] >> !(comment_p("//") >> *anychar_p); -// -// EXPECT(parse("not commentq // comment", line_p, eol_p).full); -// EXPECT(assert_equal(string("not comments "), actual)); -} - /* ************************************************************************* */ int main() { TestResult tr; return TestRegistry::runAllTests(tr); } /* ************************************************************************* */ diff --git a/wrap/utilities.cpp b/wrap/utilities.cpp index 9ccdfc919..fb2f0fdc6 100644 --- a/wrap/utilities.cpp +++ b/wrap/utilities.cpp @@ -76,8 +76,3 @@ void emit_header_comment(ofstream& ofs, const string& delimiter) { } /* ************************************************************************* */ -std::string strip_comments(const std::string& full_string) { - return full_string; /// PLACEHOLDER -} - -/* ************************************************************************* */ diff --git a/wrap/utilities.h b/wrap/utilities.h index 53f9c7414..b5de303b8 100644 --- a/wrap/utilities.h +++ b/wrap/utilities.h @@ -63,8 +63,3 @@ bool assert_equal(const std::string& expected, const std::string& actual); * emit a header at the top of generated files */ void emit_header_comment(std::ofstream& ofs, const std::string& delimiter); - -/** - * Removes comments denoted with '//' from a string - */ -std::string strip_comments(const std::string& full_string);