Removed optional parameter from enable_ast().

pull/3/head
yhirose 9 years ago
parent 79c6b7ce9b
commit 46470071f3
  1. 2
      example/calc3.cc
  2. 15
      peglib.h

@ -49,7 +49,7 @@ int main(int argc, const char** argv)
" ~_ <- [ \t\r\n]* "
);
parser.enable_ast();
parser.enable_ast(true);
auto expr = argv[1];
shared_ptr<Ast> ast;

@ -148,7 +148,13 @@ private:
/*
* Semantic values
*/
struct SemanticValue {
struct SemanticValue
{
any val;
const char* name;
const char* s;
size_t n;
SemanticValue()
: s(nullptr), n(0) {}
@ -168,11 +174,6 @@ struct SemanticValue {
std::string str() const {
return std::string(s, n);
}
any val;
const char* name;
const char* s;
size_t n;
};
struct SemanticValues : protected std::vector<SemanticValue>
@ -2057,7 +2058,7 @@ public:
return *this;
}
peg& enable_ast(bool optimize_nodes = true) {
peg& enable_ast(bool optimize_nodes) {
ast_end(optimize_nodes);
return *this;
}

Loading…
Cancel
Save