Skip to content

Move `export` into the grammar

Michael Aaron Murphy requested to merge huntergoldstein:export_to_grammar into master

Created by: huntergoldstein

Problem: export not being in the grammar meant that the RHS was eagerly expanded.

Solution: export now has the same semantics as let but instead of storing the variable locally, it is written to the OS environment.

Changes introduced by this pull request:

  • export is now in the PEG grammar and has an associated Statement enumeration
  • export and let now have the same logic except, as mentioned, export writes to the OS environment
  • DRYed up the logic, including replacing a custom made ExpanderFunctions with get_expanders!`

Drawbacks: Nothing off the top of my head

Fixes: Related to #255 (closed)

State: Ready!

Merge request reports