benlaan / sqlformat

.NET SQL Parser and Formatter Tool and SSMS Plugin
http://sqlformat.benlaan.com
BSD 3-Clause "New" or "Revised" License
73 stars 27 forks source link

Support of literal values as dedicated literal types #9

Open dnnancy opened 11 years ago

dnnancy commented 11 years ago

It would be ideal that the literal values in SQL script are parsed as dedicated literal types, such as StringLiteral, NumberLiteral, BooleanLiteral, etc. Currently they seem to be all parsed as IdentifierExpression.

For instance, with the following script:

select fielda 
from table1 t1
where t1.fieldd = 10.0 or t1.fieldc = 'abc'

Ideally, 10.0 and 'abc' can be parsed as NumberLiteral and StringLiteral, and so on.