From b90b83ab0f9fff33ad9cbdd3e47f23439cc4b81e Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 18 May 2010 14:22:11 -0400 Subject: [PATCH] renamed "ignored" flag to "process" in token definitions --- Parser.cc | 3 ++- TokenDefinition.cc | 6 +++--- TokenDefinition.h | 5 +++-- tmpl/parser.cc | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Parser.cc b/Parser.cc index 37b82b2..f9a8473 100644 --- a/Parser.cc +++ b/Parser.cc @@ -71,7 +71,7 @@ refptr Parser::buildTokenList() *tokenlist += " "; *tokenlist += "{ \"" + m_tokens[i]->getName() + "\", \"" + m_tokens[i]->getCString() + "\", " - + (m_tokens[i]->getIgnored() ? "true" : "false") + " }"; + + (m_tokens[i]->getProcessFlag() ? "true" : "false") + " }"; if (i < m_tokens.size() - 1) *tokenlist += ", \\\n"; } @@ -232,6 +232,7 @@ bool Parser::parseInputFile(char * buff, int size) if (ovector[8] >= 0 && ovector[9] >= 0 && ovector[9] - ovector[8] > 0) { + td->setProcessFlag(true); code = ""; /* FIXME: function definition */ gathering_code = true; } diff --git a/TokenDefinition.cc b/TokenDefinition.cc index 18e9c4c..6d320f2 100644 --- a/TokenDefinition.cc +++ b/TokenDefinition.cc @@ -51,7 +51,7 @@ static string c_escape(const string & orig) TokenDefinition::TokenDefinition() - : m_ignored(false) + : m_process(false) { } @@ -76,9 +76,9 @@ bool TokenDefinition::create(const string & name, { (*parts)[i] = trim((*parts)[i]); string & s = (*parts)[i]; - if (s == "i") + if (s == "p") { - m_ignored = true; + m_process = true; } else { diff --git a/TokenDefinition.h b/TokenDefinition.h index d7030c4..a953214 100644 --- a/TokenDefinition.h +++ b/TokenDefinition.h @@ -12,12 +12,13 @@ class TokenDefinition const std::string & definition, const std::string & flags); std::string getCString() const; std::string getName() const { return m_name; } - bool getIgnored() const { return m_ignored; } + bool getProcessFlag() const { return m_process; } + void setProcessFlag(bool p) { m_process = p; } protected: std::string m_name; std::string m_definition; - bool m_ignored; + bool m_process; }; #endif diff --git a/tmpl/parser.cc b/tmpl/parser.cc index e59c397..2b7625a 100644 --- a/tmpl/parser.cc +++ b/tmpl/parser.cc @@ -38,7 +38,7 @@ bool I_CLASSNAME::parse(istream & i) struct { const char * name; const char * definition; - bool ignored; + bool process; pcre * re; pcre_extra * re_extra; } tokens[] = {