Skip to content

Commit

Permalink
fix identifer escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Feb 18, 2020
1 parent 52085b0 commit c765eeb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion v5/pkg/tsl/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ func (l *Listener) GetTree() (n Node, err error) {

// ExitColumnIdentifier is called when exiting the ColumnIdentifier production.
func (l *Listener) ExitColumnIdentifier(c *parser.ColumnIdentifierContext) {
l.exitLiteral(IdentOp, c.ColumnName().GetText())
s := c.ColumnName().GetText()

// Identifier can be encapsulted by '`...`', '"..."', or '[...]'
if s[0] == '`' || s[0] == '"' || s[0] == '[' {
s = s[1 : len(s)-1]
}

l.exitLiteral(IdentOp, s)
}

// ExitNumberLiteral is called when exiting the NumberLiteral production.
Expand Down

0 comments on commit c765eeb

Please sign in to comment.