mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 20:05:31 +00:00
Removed optional parameter from enable_ast().
This commit is contained in:
parent
79c6b7ce9b
commit
46470071f3
@ -49,7 +49,7 @@ int main(int argc, const char** argv)
|
|||||||
" ~_ <- [ \t\r\n]* "
|
" ~_ <- [ \t\r\n]* "
|
||||||
);
|
);
|
||||||
|
|
||||||
parser.enable_ast();
|
parser.enable_ast(true);
|
||||||
|
|
||||||
auto expr = argv[1];
|
auto expr = argv[1];
|
||||||
shared_ptr<Ast> ast;
|
shared_ptr<Ast> ast;
|
||||||
|
15
peglib.h
15
peglib.h
@ -148,7 +148,13 @@ private:
|
|||||||
/*
|
/*
|
||||||
* Semantic values
|
* Semantic values
|
||||||
*/
|
*/
|
||||||
struct SemanticValue {
|
struct SemanticValue
|
||||||
|
{
|
||||||
|
any val;
|
||||||
|
const char* name;
|
||||||
|
const char* s;
|
||||||
|
size_t n;
|
||||||
|
|
||||||
SemanticValue()
|
SemanticValue()
|
||||||
: s(nullptr), n(0) {}
|
: s(nullptr), n(0) {}
|
||||||
|
|
||||||
@ -168,11 +174,6 @@ struct SemanticValue {
|
|||||||
std::string str() const {
|
std::string str() const {
|
||||||
return std::string(s, n);
|
return std::string(s, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
any val;
|
|
||||||
const char* name;
|
|
||||||
const char* s;
|
|
||||||
size_t n;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SemanticValues : protected std::vector<SemanticValue>
|
struct SemanticValues : protected std::vector<SemanticValue>
|
||||||
@ -2057,7 +2058,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
peg& enable_ast(bool optimize_nodes = true) {
|
peg& enable_ast(bool optimize_nodes) {
|
||||||
ast_end(optimize_nodes);
|
ast_end(optimize_nodes);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user