Пример #1
0
def _unparse_visit_identifier(node: ParseTreeNode,
                              result: parse_primitives.ObjectToStringResult,
                              arg_map: parse_primitives.ObjectNodeArgMap):
    arg_name = node.value
    if not arg_map.is_argname_present(arg_name):
        raise UnparseError(f"Arg {arg_name} is not present")
    result.add_argname_tostring(arg_name)
Пример #2
0
 def unparser(arg_map: parse_primitives.ObjectNodeArgMap,
              result: parse_primitives.ObjectToStringResult):
     if allow_modifier:
         result.add_argname_tostring(WORD_PART_MODIFIER_ARG_NAME)
     else:
         result.add_string(symb)
     result.add_argname_tostring(WORD_PART_NEXT_ARG_NAME)
Пример #3
0
def CmdSeqUnparser(
    arg_map: parse_primitives.ObjectNodeArgMap,
    result: parse_primitives.ObjectToStringResult
):
    if arg_map.is_argname_present("ProgramArg"):
        result.add_argname_tostring("ProgramArg")
    if arg_map.is_argname_present("CompoundOp"):
        result.add_string(" ")
        result.add_argname_tostring("CompoundOp")