Open julianjensen opened 4 months ago
Looks like it's intentional to match protobuf behavior.
Omission of negative integers was a bug, now fixed by https://github.com/pganalyze/libpg_query/pull/249, which was just merged
Thanks @aleclarson !
Makes sense that it was a part of upstream, will get this merged ASAP!
Issue
It appears that some constants are not correct in the AST output from the parser. I made a minimal example to illustrate the issues. No errors are thrown when running the example. In essence, integers are not present in the AST when the integer is
0
or negative. Boolean values are only present when the value istrue
but not whenfalse
.This example is a blank project that has only a single dependency:
It contains a single JavaScript file (
index.js
):Running this example, displays the following output:
As can be seen,
true
and positive integers look okay but other values show up as an empty object. I included the example from theREADME.md
to illustrate the issue in another simple context. It can be seen to fail here, as well.Expected
Expected
ival
andboolval
to hold correct values consistent with the values in the SQL source.Reproduction
My system is as follows: