def parse_string(str: String): from stilus.parser import Parser try: parser = Parser(str, {}) result = parser.list() except BaseException: result = Literal(str) return result
def test_parser_list(): parser = Parser("color: red\n", {}) list = parser.list() assert len(list) == 1 assert list.nodes[0] == Ident("color", null, False, lineno=1, column=1)