def do_withmany(parser, token): args, kwargs = utils.split_args(token.contents) kwargs = utils.parse_arg(kwargs, parser) kwargs = [[k,v] for k,v in kwargs.items()] nodelist = parser.parse(('endwithmany',)) parser.delete_first_token() return WithManyNode(kwargs, nodelist)
def do_grab(parser, token): args, kwargs = utils.split_args(token.contents) varname = args[1] nodelist = parser.parse(('endgrab', 'end')) parser.delete_first_token() return GrabNode(varname, nodelist)
def do_let(parser, token): args, kwargs = utils.split_args(token.contents) kwargs = utils.parse_arg(kwargs, parser) kwargs = [[k,v] for k,v in kwargs.items()] return LetNode(kwargs)