diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-08-17 21:38:13 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-08-17 21:38:13 -0700 |
commit | 8f03981dfcd66aed76a98716e1a41a8bf1f0dbe6 (patch) | |
tree | d10f3588a0b1de6c6d1addcf0987904141cd5d78 /txr.1 | |
parent | 42ba138efa6159e1d0387b8f3c7b3fb1a34721ad (diff) | |
download | txr-8f03981dfcd66aed76a98716e1a41a8bf1f0dbe6.tar.gz txr-8f03981dfcd66aed76a98716e1a41a8bf1f0dbe6.tar.bz2 txr-8f03981dfcd66aed76a98716e1a41a8bf1f0dbe6.zip |
txr: identify output repeat vars at parse time
Up to now the @(repeat) and @(rep) directives have scanned
their interior to find output variables. We now hoist that
into the parser; the variables are found up-front and
integrated into the abstract syntax.
This work anticipates doing a more proper job of identifying
free variables in Lisp expressions.
* match.c (extract_vars): Delete static this function here.
It moves into parser.y.
(extract_bindings): Don't call extract_vars to obtain the
variables occurring in the repeat body. Get it as a new
argument, occur_vars.
(do_output_line, do_repeat): Extract the new occur_vars
element of the abstract syntax node and pass it to
extract_bindings.
* parser.y (extract_vars): New static function, moved here
from match.c.
(repeat_rep_helper): Scan over each of the repeat subclauses
with extract vars. Catenate the resulting lists together and
pass through uniq to squash repeated symbols. Then add the
resulting vars as a new element of the returned syntax node.
Diffstat (limited to 'txr.1')
0 files changed, 0 insertions, 0 deletions