Skip to content

[4.0] Re-worked parser to support escaping dollars - #380

Merged
GrahamCampbell merged 5 commits into
masterfrom
parsing
Nov 25, 2019
Merged

GrahamCampbell merged 5 commits into
masterfrom
parsing

Conversation

@GrahamCampbell

@GrahamCampbell GrahamCampbell commented Nov 4, 2019 •

Copy link
Copy Markdown
Collaborator

Changes:

  1. The parser now returns a special Value object instead of a pure string. The value object contains both the parsed string, and the locations of nested environment variables for interpolation.
  2. Interpolation of environment variables is now performed right to left instead of left to right. This allows one to write code such as "${${FOO}}" where FOO holds the name of the actual variable.
  3. Double quoted strings now support escaping dollars with a backlash.
  4. Escape sequences are now banned in single quoted strings, just like for unquoted strings. This includes disallowing escaped (or otherwise) single quote characters within a single quoted string.

Closes #378.

@GrahamCampbell GrahamCampbell changed the title [4.x] Re-worked parser to support escaping dollars [4.0] Re-worked parser to support escaping dollars Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] [4.0] Behaviour of nested variables

1 participant