diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-15 21:59:49 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-22 16:09:34 +0100 |
commit | 46320bfba89bf088dfe760ee1ff39658b5eb559f (patch) | |
tree | 1b39a95a1e18a6b22e6500eed11d20ef30973470 /mesonbuild/rewriter.py | |
parent | ccad493e85e46bf0e78cfac8b77b03b7be75a396 (diff) | |
download | meson-46320bfba89bf088dfe760ee1ff39658b5eb559f.zip meson-46320bfba89bf088dfe760ee1ff39658b5eb559f.tar.gz meson-46320bfba89bf088dfe760ee1ff39658b5eb559f.tar.bz2 |
Added Ast printer
Diffstat (limited to 'mesonbuild/rewriter.py')
-rw-r--r-- | mesonbuild/rewriter.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py index 1495d23..f025f23 100644 --- a/mesonbuild/rewriter.py +++ b/mesonbuild/rewriter.py @@ -23,7 +23,7 @@ # - move targets # - reindent? -from .ast import (AstInterpreter, AstVisitor) +from .ast import (AstInterpreter, AstVisitor, AstPrinter) from mesonbuild.mesonlib import MesonException from mesonbuild import mlog import sys, traceback @@ -35,7 +35,6 @@ def add_arguments(parser): help='Print the parsed AST.') def run(options): - print('This tool is highly experimental, use with care.') rewriter = AstInterpreter(options.sourcedir, '') try: rewriter.load_root_meson_file() @@ -43,8 +42,9 @@ def run(options): rewriter.parse_project() rewriter.run() - visitor = AstVisitor() + visitor = AstPrinter() rewriter.ast.accept(visitor) + print(visitor.result) except Exception as e: if isinstance(e, MesonException): mlog.exception(e) |