Example #1
0
def test_function_definition():
    s = "foo(a, b,c)\n return a"
    styl = StylusParser()
    styl.parse(s)
    func = styl.stack[0]
    assert type(func) == AST.FunctionNode
    assert func.name == 'foo'
    assert func.args == ['a', 'b', 'c']
Example #2
0
def xtest_function_block():
    s = """add(x, y)
    x + y
"""
    styl = StylusParser()
    styl.parse(s)
Example #3
0
def test_block():
    s = "body\ndiv\n color red"
    styl = StylusParser()
    styl.parse(s)