mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 11:55:30 +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]* "
|
||||
);
|
||||
|
||||
parser.enable_ast();
|
||||
parser.enable_ast(true);
|
||||
|
||||
auto expr = argv[1];
|
||||
shared_ptr<Ast> ast;
|
||||
|
15
peglib.h
15
peglib.h
@ -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…
Reference in New Issue
Block a user