parseNumericLit reads a numeric literal token and returns a LiteralValue.
()
| 247 | |
| 248 | // parseNumericLit reads a numeric literal token and returns a LiteralValue. |
| 249 | func (p *Parser) parseNumericLit() (*ast.LiteralValue, error) { |
| 250 | if !p.isNumericLiteral() { |
| 251 | return nil, p.expectedError("numeric literal") |
| 252 | } |
| 253 | value := p.currentToken.Token.Value |
| 254 | litType := "int" |
| 255 | if strings.ContainsAny(value, ".eE") { |
| 256 | litType = "float" |
| 257 | } |
| 258 | p.advance() |
| 259 | return &ast.LiteralValue{Value: value, Type: litType}, nil |
| 260 | } |
| 261 | |
| 262 | // parseForSystemTimeClause parses the FOR SYSTEM_TIME clause that follows a table reference. |
| 263 | // The caller has already consumed FOR. |
no test coverage detected