Enable using dollar symbol when defining a param variable
This commit is contained in:
parent
b901c78bd1
commit
33ba4d5de3
2 changed files with 14 additions and 1 deletions
13
sql/exprs.go
13
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
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
//
|
||||
// --------------------------------------------------
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue