Esempio n. 1
0
 def _parse_rule_gets(rule_text: str, **types: Type) -> List[GetConstraints]:
     rule_visitor = _RuleVisitor(resolve_type=lambda name: types[name])
     rule_visitor.visit(ast.parse(rule_text))
     return rule_visitor.gets
Esempio n. 2
0
 def _parse_rule_gets(rule_text: str,
                      **types: Type) -> List[AwaitableConstraints]:
     rule_visitor = _RuleVisitor(resolve_type=lambda name: types[name],
                                 source_file_name="parse_rules.py")
     rule_visitor.visit(ast.parse(rule_text))
     return rule_visitor.awaitables