Skip to content

xonsh/peg-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ce857ce · Jan 23, 2025
Aug 5, 2024
Nov 13, 2024
Aug 5, 2024
Aug 5, 2024
Apr 4, 2023
Jan 23, 2025
Jun 2, 2024
Jan 23, 2025
Nov 28, 2024
Jan 23, 2025
Nov 13, 2024
Nov 28, 2024
Jun 19, 2024
Nov 13, 2024
Oct 16, 2024
Jun 7, 2024
Dec 24, 2024
Nov 28, 2024
Apr 4, 2023
Aug 5, 2024
Nov 13, 2024
May 29, 2024
Nov 14, 2024
Apr 4, 2023
Jan 23, 2025
Nov 28, 2024
Jul 20, 2024
May 20, 2024

Repository files navigation

xonsh-parser

Xonsh parser using CPython's PEGen grammar

build codecov PyPI version


Documentation: https://jnoortheen.github.io/xonsh-parser/

Source Code: https://github.com/jnoortheen/xonsh-parser

Benchmarks: https://xonsh.github.io/peg-parser/dev/bench/


Development

Setup environment

  • You can use any PEP-621 supported tools like PDM, Hatch ... to manage the development environment and production build.
# install development deps
pip install -e ".[dev,test,docs]"
# setup linters,formatters etc.,
pre-commit install
  • We use Taskfile to manage development tasks.
task test

# to watch for changes and run tests
task test --watch -- -x --ff

# release a new version
task release

Workflow

  1. Explore the PEG grammar notations from the following pages
    a. https://we-like-parsers.github.io/pegen/
    b. https://devguide.python.org/internals/parser/
  2. Edit the xonsh.gram while adding any new actions to subheader.py
  3. Test the new changes with task test as the parser.py will get autogenerated
  4. You can force regeneration with task generate -f

License

This project is licensed under the terms of the MIT license.

Credits