Skip to content

Commit

Permalink
Little more meaningful message for parsing error (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsixface authored and filhodanuvem committed Nov 11, 2018
1 parent 94f6097 commit dd5d887
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions parser/parser.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package parser

import (
"errors"
"fmt"
"regexp"
"strconv"
Expand Down Expand Up @@ -495,13 +496,9 @@ func rValue() (NodeExpr, error) {
return n, nil
}

if look_ahead != lexical.T_LITERAL && look_ahead != lexical.T_NUMERIC {
return nil, throwSyntaxError(lexical.T_LITERAL, look_ahead)
}

lexeme := lexical.CurrentLexeme
if look_ahead != lexical.T_LITERAL {
return nil, throwSyntaxError(lexical.T_AND, look_ahead)
return nil, errors.New("Only Literals and Date are allowed in `where` clause")
}

// @todo inserts IS NULL!
Expand Down

0 comments on commit dd5d887

Please sign in to comment.