bor
0.2.0
bor可以通过运行pip install bor
来安装。它需要 Python 3.8.0+ 才能运行。
bor目前支持class
和def
关键字。其他 Python 关键字将在未来版本中添加。
bor {keyword} {pattern}
默认情况下, bor在当前目录中运行。您可以使用特定的源文件或目录运行bor :
bor {keyword} {pattern} {source_file_or_directory}
默认情况下,如果bor在分析文件时遇到错误(语法、缩进错误等),它将停止工作。如果你想忽略错误,可以使用--ignore-error
或-i
参数。例如;
bor class Cat --ignore-error
Cat
在正则表达式中相当于^Cat$
bor class Cat
输出:
Cat at examples/test.py:18
.Cat
在正则表达式中相当于Cat$
bor class .Cat
输出:
Cat at examples/test.py:18
BlueCat at examples/test.py:26
get.
在正则表达式中相当于^get
bor def get. examples/test.py
输出:
get_value at examples/test.py:5
get_blue_value at examples/test.py:11
get_purple_value at examples/test.py:14
get_meow at examples/test.py:22
.cat.
在正则表达式中相当于cat+
bor def .cat.
输出:
catch_me_if_you_can at examples/test.py:8
am_i_blue_cat at examples/test.py:30
where_is_the_cat at examples/test.py:38