Files
jq/src
Emanuele Torre 193f432e08 Lex $foo as a single token, instead of using '$' IDENT
Previously, bindings were parsed as the combination of two tokens:
  '$' IDENT

This meant that using a keyword as variable name (e.g. $then, $label)
did not work.
Attempts were made to allow $keyword to work by adding some '$' Keyword
rules in the parser, but this did not allow $keyword in all places:

  jq --arg label foo -n '$label'  # ok

  jq -n '"foo" as $label | .'     # error

Treating $foo as a single token is much simpler, in my opinion.

This patch also changes how LOC is lexed: "$__loc__" instead of as
"__loc__" that gets combined with '$' in the parser.

This patch also disallows having spaces after '$' when recalling a
variable  `$ foo'  since that was probably just an unintentional side
effect of the implementation, and it was not documented.

Fixes #2675
2023-07-09 17:23:19 -05:00
..
2020-01-02 10:52:12 -06:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2020-01-14 10:18:22 -06:00
2015-08-23 20:36:11 -07:00
2021-10-24 16:23:26 -05:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2020-12-19 15:18:29 -05:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2018-08-17 23:15:48 -04:00
2020-01-10 12:01:08 -06:00
2015-08-23 20:36:11 -07:00