예제 #1
0
def parse_string(str: String):
    from stilus.parser import Parser

    try:
        parser = Parser(str, {})
        result = parser.list()
    except BaseException:
        result = Literal(str)
    return result
예제 #2
0
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)