mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-11-14 06:55:30 +00:00
Added optimize_ast
This commit is contained in:
parent
6b63bd48af
commit
ff3d947fd4
7
peglib.h
7
peglib.h
@ -2284,6 +2284,13 @@ private:
|
||||
const std::vector<std::string> filters_;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
static std::shared_ptr<T> optimize_ast(
|
||||
std::shared_ptr<T> ast,
|
||||
const std::vector<std::string>& filters = {}) {
|
||||
return AstOptimizer(true, filters).optimize(ast);
|
||||
}
|
||||
|
||||
struct EmptyType {};
|
||||
typedef AstBase<EmptyType> Ast;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user