diff --git a/sql/exprs.go b/sql/exprs.go index bac0690d..bbbeaa75 100644 --- a/sql/exprs.go +++ b/sql/exprs.go @@ -149,6 +149,19 @@ func (p *parser) parseIdioms() (mul Idents, err error) { } +func (p *parser) parseParam() (*Ident, error) { + + _, lit, err := p.shouldBe(IDENT, PARAM) + if err != nil { + return nil, &ParseError{Found: lit, Expected: []string{"name"}} + } + + val, err := p.declare(IDENT, lit) + + return val.(*Ident), err + +} + // -------------------------------------------------- // // -------------------------------------------------- diff --git a/sql/let.go b/sql/let.go index 3e2f62c2..cf0e1ce8 100644 --- a/sql/let.go +++ b/sql/let.go @@ -26,7 +26,7 @@ func (p *parser) parseLetStatement() (stmt *LetStatement, err error) { // always be an identifier, specifying a // variable name to set. - stmt.Name, err = p.parseIdent() + stmt.Name, err = p.parseParam() if err != nil { return nil, err }