Open vemoo opened 1 month ago
@vemoo I added a new test in this PR to verify the bug https://github.com/microsoft/SqlScriptDOM/pull/94 but my test passes. I'm not sure what I'm missing
the issue is not that there are no OptimizerHints
, it's that FirstTokenIndex
and LastTokenIndex
are -1
Using
Microsoft.SqlServer.TransactSql.ScriptDom
version161.9135.0
.For example:
gets parsed as:
where
OptimizerHint
ends up with-1
inFirstTokenIndex
andLastTokenIndex
.I think the issue here is that here
https://github.com/microsoft/SqlScriptDOM/blob/d84cc30809b29cc5497809c2b0432bf23c412c69/SqlScriptDom/Parser/TSql/TSql80.g#L6276-L6294
tokens get assigned to
vParent
and should be assigned tovHint
.Another example:
gets parsed as:
here
StatementList
is missing token indexes.