Recent revs add support for command-line arguments when running leo/core/leoAst.py directly:
...leo-editor\leo\core>python leoAst.py -h
usage:
leoAst.py --help
leoAst.py [--fstringify | --fstringify-diff | --orange | --orange-diff] PATHS
leoAst.py --pytest ["-k ARGS"]
leoAst.py --unittest [ARGS]
positional arguments:
PATHS directory or list of files
optional arguments:
-h, --help show this help message and exit
--fstringify leonine fstringify
--fstringify-diff show fstringify diff
--orange leonine Black
--orange-diff show orange diff
--pytest "-k ARGS" run pytest
--unittest ARGS run unittest
As a result:
1. Anyone can experiment with the Token Order classes without having to install Leo itself.
2. There is little need to "repackage" leoAst.py as a separate package. People can download just this file using git. One less thing for Matt to do :-)
Please test and report any problems. All comments and suggestions welcome.
All tests (--unittest or --pytest) pass with Python 3.7. Some fail with python 3.8, due to new kinds of ast nodes.
Edward