MiSawa / xq

Pure rust implementation of jq
MIT License
333 stars 18 forks source link

Cannot use null and booleans in object value #67

Closed itchyny closed 2 years ago

itchyny commented 2 years ago

I noticed that I can't use some values in in object value.

❯ xq -n '{x: null}'
Error: compile query

Caused by:
    CompileError(UnknownFunction(Identifier("null"), 0))

❯ xq -n '{x: true}'
Error: compile query

Caused by:
    CompileError(UnknownFunction(Identifier("true"), 0))

❯ xq -n '{x: false}'
Error: compile query

Caused by:
    CompileError(UnknownFunction(Identifier("false"), 0))

❯ xq --version
xq 0.2.3-a7d4cfbf962f3570b326dd97ecf288365d396ed4
MiSawa commented 2 years ago

Ooops.... I made lexer treat keywords directly inside {} an identifier instead. I shouldn't have applied this trick to the keywords that can be appeared in a term, i.e. true, false and null.