Skip to content

Expose type of word to Variable logic via Word Enum

Created by: phddoom

Problem:

Single quoted words are currently expaned during variable expansion.

Solution:

Add a mechanism to allow variable expansion logic to not expand single quoted words.

Changes introduced by this pull request:

Introduces a Word enum with Bare, SingleQuoted, and DoubleQuoted variants.

This allows logic related to variable expansion to not expand single quoted words while expanding bare and double quoted words.

The Word Enum Derefs to String so it can access the functions / methods of the string type.

Drawbacks:

More clones

TODOs:

  • Fix cargo test PartialEq error
  • Example test
  • Ensure this prevents all expansions not just variable
  • Adjust variable expansion logic to search only for $[names of variables in scope]
  • Remove commented code

Fixes: #123 (closed) #84 (closed)

State:

WIP

Blocking/related: #123 (closed) #84 (closed)

Other:

I am seeking feedback on whether this is a good approach, or refinements.


Merge request reports