def color(parser, token): args = token.split_contents() is_simple = len(args) == 2 is_complex = len(args) == 4 and args[2] == 'in' is_valid = is_simple or is_complex validate_param_number(is_valid, args[0], "one or three arguments") return ColorNode(args[1], args[3] if is_complex else None)
def _set(parser, token): args = token.split_contents() is_valid = len(args) == 3 validate_param_number(is_valid, args[0], "two arguments") return SetNode(args[1], args[2])
def incr(parser, token): args = token.split_contents() is_valid = len(args) == 2 validate_param_number(is_valid, args[0], "one argument") return IncrNode(args[1])
def git_version(parser, token): args = token.split_contents() is_valid = len(args) == 1 validate_param_number(is_valid, args[0], "no arguments") return GitVersionNode()