Пример #1
0
/*
ParseBlock method allows root level statements, which does not allow css properties.
*/
func (parser *Parser) ParseBlock() *ast.Block {
	debug("ParseBlock")
	parser.expect(ast.T_BRACE_OPEN)
	var block = ast.NewBlock()
	block.Stmts = parser.ParseStmts()
	parser.expect(ast.T_BRACE_CLOSE)
	return block
}
Пример #2
0
func NewContext() *Context {
	return &Context{
		GlobalBlock: ast.NewBlock(),
		Mixins:      &symtable.SymTable{},
		Functions:   &symtable.SymTable{},
		Stack:       &Stack{},
	}
}