__init__.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:cumin 作者: wikimedia 项目源码 文件源码
def grammar():
    """Define the query grammar for the external backend used for testing."""
    # Hosts selection: clustershell (,!&^[]) syntax is allowed: host10[10-42].domain
    hosts = pp.Word(pp.alphanums + '-_.,!&^[]')('hosts')

    # Final grammar, see the docstring for its BNF based on the tokens defined above
    # Groups are used to split the parsed results for an easy access
    full_grammar = pp.Forward()
    full_grammar << pp.Group(hosts) + pp.ZeroOrMore(pp.Group(hosts))  # pylint: disable=expression-not-assigned

    return full_grammar
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号