Cleaned up debug code
parent
7e221aa7a1
commit
eb109c4dc5
1
gtsam.h
1
gtsam.h
|
@ -10,6 +10,7 @@
|
||||||
* Comments can use either C++ or C style
|
* Comments can use either C++ or C style
|
||||||
* Static methods are not supported
|
* Static methods are not supported
|
||||||
* Methods must start with a lowercase letter
|
* Methods must start with a lowercase letter
|
||||||
|
* Classes must start with an uppercase letter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Point2 {
|
class Point2 {
|
||||||
|
|
|
@ -170,15 +170,8 @@ Module::Module(const string& interfacePath,
|
||||||
string interfaceFile = interfacePath + "/" + moduleName + ".h";
|
string interfaceFile = interfacePath + "/" + moduleName + ".h";
|
||||||
string contents = file_contents(interfaceFile);
|
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
|
// and parse contents
|
||||||
parse_info<const char*> info = parse(contents.c_str(), module_p, skip_p);
|
parse_info<const char*> info = parse(contents.c_str(), module_p, space_p);
|
||||||
if(!info.full) {
|
if(!info.full) {
|
||||||
printf("parsing stopped at \n%.20s\n",info.stop);
|
printf("parsing stopped at \n%.20s\n",info.stop);
|
||||||
throw ParseFailed(info.length);
|
throw ParseFailed(info.length);
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#include <boost/spirit/include/classic_core.hpp>
|
#include <boost/spirit/include/classic_core.hpp>
|
||||||
#include <boost/spirit/include/classic_push_back_actor.hpp>
|
#include <boost/spirit/include/classic_push_back_actor.hpp>
|
||||||
#include <boost/spirit/include/classic_confix.hpp>
|
|
||||||
#include <CppUnitLite/TestHarness.h>
|
#include <CppUnitLite/TestHarness.h>
|
||||||
#include <wrap/utilities.h>
|
#include <wrap/utilities.h>
|
||||||
|
|
||||||
|
@ -103,31 +102,6 @@ TEST( spirit, constMethod_p ) {
|
||||||
EXPECT(parse("double norm() const;", constMethod_p, space_p).full);
|
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<string> 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); }
|
int main() { TestResult tr; return TestRegistry::runAllTests(tr); }
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************************* */
|
|
||||||
|
|
|
@ -63,8 +63,3 @@ bool assert_equal(const std::string& expected, const std::string& actual);
|
||||||
* emit a header at the top of generated files
|
* emit a header at the top of generated files
|
||||||
*/
|
*/
|
||||||
void emit_header_comment(std::ofstream& ofs, const std::string& delimiter);
|
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);
|
|
||||||
|
|
Loading…
Reference in New Issue