bashlex

Python parser for bash

GPLv3+ 16 个版本 Python >=2.7, !=3.0, !=3.1, !=3.2, !=3.3, !=3.4
Idan Kamara <i@idank.me>
安装
pip install bashlex
poetry add bashlex
pipenv install bashlex
conda install bashlex
描述

bashlex is a Python port of the parser used internally by GNU bash.

For the most part it's transliterated from C, the major differences are:

  1. it does not execute anything
  2. it is reentrant
  3. it generates a complete AST

See https://github.com/idank/bashlex/blob/master/README.md for more info.