func (parser *Parser) ParseIdent() *ast.Ident { var tok = parser.next() if tok.Type != ast.T_IDENT { panic("Invalid token for ident.") } return ast.NewIdentWithToken(tok) }
func (parser *Parser) ParsePropertyNameToken() ast.Expr { if tok := parser.accept(ast.T_PROPERTY_NAME_TOKEN); tok != nil { return ast.NewIdentWithToken(tok) } var tok = parser.peek() if tok.Type == ast.T_INTERPOLATION_START { return parser.ParseInterpolation() } return nil }