summaryrefslogtreecommitdiffstats
path: root/stdlib/optimize.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-03-20 22:39:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-03-20 22:39:18 -0700
commit132da9700cb9c6e4edcac8684cf50b61d00a5e8c (patch)
tree6167c85e3c9a752cd91094c08cd74b37eab2a155 /stdlib/optimize.tl
parent700f8089ccf2986c6dc1a86036faa55452434e34 (diff)
downloadtxr-132da9700cb9c6e4edcac8684cf50b61d00a5e8c.tar.gz
txr-132da9700cb9c6e4edcac8684cf50b61d00a5e8c.tar.bz2
txr-132da9700cb9c6e4edcac8684cf50b61d00a5e8c.zip
compiler: source-loc propagation in tree-bind, lambda
Unused variables in tree-bind forms are not generating diagnostics with source location info. We are missing some rlcp calls. * stdlib/compiler.tl (compiler comp-catch): The generated lambda here ends up transformed to a let by the lambda-apply-transfom function. We must propagate source info to it, otherwise unused catch clause parameters get diagnosed without it. (compiler (comp-for, comp-mac-param-bind, comp-mac-env-param-bind, comp-tree-case): Confer source location info onto the err-form argument of expand-bind-mac-params. (expand-bind-mac-params): Pass source location info from err-form onto the generated let* form. Thus, diagnostics related to variables in that let* get reported against that form's location. (lambda-apply-transform): Pass source location info from the lambda expression to the generated let. * stdlib/except.tl (usr:catch): Pass source loc info from each clause source code to the transformed clause. The transformed clause will turn into a lambda which will turn into a let in comp-catch, and then into a let in lambda-apply-transform.
Diffstat (limited to 'stdlib/optimize.tl')
0 files changed, 0 insertions, 0 deletions