示例#1
0
文件: rules.go 项目: se77en/c6
func (parser *Parser) ParseInterpolation() ast.Expr {
	debug("ParseInterpolation")
	var startToken *ast.Token
	if startToken = parser.accept(ast.T_INTERPOLATION_START); startToken == nil {
		return nil
	}
	var expr = parser.ParseExpr(true)
	var endToken = parser.expect(ast.T_INTERPOLATION_END)
	return ast.NewInterpolation(expr, startToken, endToken)
}
示例#2
0
文件: rules.go 项目: se77en/c6
func (parser *Parser) ParseInterp() ast.Expr {
	var startTok = parser.expect(ast.T_INTERPOLATION_START)
	var innerExpr = parser.ParseExpr(true)
	var endTok = parser.expect(ast.T_INTERPOLATION_END)
	return ast.NewInterpolation(innerExpr, startTok, endTok)
}