Skip to content

Commit ff3d947

Browse files
committed
Added optimize_ast
1 parent 6b63bd4 commit ff3d947

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

peglib.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,6 +2284,13 @@ struct AstOptimizer
22842284
const std::vector<std::string> filters_;
22852285
};
22862286

2287+
template <typename T>
2288+
static std::shared_ptr<T> optimize_ast(
2289+
std::shared_ptr<T> ast,
2290+
const std::vector<std::string>& filters = {}) {
2291+
return AstOptimizer(true, filters).optimize(ast);
2292+
}
2293+
22872294
struct EmptyType {};
22882295
typedef AstBase<EmptyType> Ast;
22892296

0 commit comments

Comments
 (0)