(grammar, raw_node_info)
Converts raw node information to a Node or Leaf instance.
Converts raw node information to a Node or Leaf instance.
Converts raw node information to a Node or Leaf instance .
def pattern_convert(grammar, raw_node_info):
    """Converts raw node information to a Node or Leaf instance."""
    type, value, context, children = raw_node_info
    if children or type in grammar.number2symbol:
        return pytree.Node(type, children, context=context)
    else:
        return pytree.Leaf(type, value, context=context)
def pattern_convert ( grammar , raw_node_info ) : type , value , context , children = raw_node_info if children or type in grammar . number2symbol : return pytree . Node ( type , children , context = context ) else : return pytree . Leaf ( type , value , context = context )