Mike Gerwitz

Activist for User Freedom

diff options
authorMike Gerwitz <mike.gerwitz@ryansg.com>2022-11-10 12:14:56 -0500
committerMike Gerwitz <mike.gerwitz@ryansg.com>2022-11-10 12:33:30 -0500
commit4117efc50cb5fbe26d91ef27f8503567ec07f1ac (patch)
tree5dd4686aa580468375069f233b920ed17db2748b /tamer/benches/asg.rs
parent8a430a52bc5623ec4ca6b74bb481bbd03cc6627e (diff)
tamer: nir::desugar::interp: Generalize without NIR symbol typesmain
This is a shift in approach. My original idea was to try to keep NIR parsing the way it was, since it's already hard enough to reason about with the `ele_parse!` parser-generator macro mess. The idea was to produce an IR that would explicitly be denoted as "maybe sugared", and have a desugaring operation as part of the lowering pipeline that would perform interpolation and lower the symbol into a plain version. The problem with that is: 1. The use of the type was going to introduce a lot of mapping for all the NIR token variants there are going to be; and 2. _The types weren't even utilized for interpolation._ Instead, if we interpolated _as attributes are encountered_ while parsing NIR, then we'd be able to expand directly into that NIR token stream and handle _all_ symbols in a generic way, without any mapping beyond the definition of NIR's grammar using `ele_parse!`. This is a step in that direction---it removes `NirSymbolTy` and introduces a generic abstraction for the concept of expansion, which will be utilized soon by the attribute parser to allow replacing `TryFrom` with something akin to `ParseFrom`, or something like that, which is able to produce a token stream before finally yielding the value of the attribute (which will be either the original symbol or the replacement metavariable, in the case of interpolation). (Note that interpolation isn't yet finished---errors still need to be implemented. But I want a working vertical slice first.) DEV-13156
Diffstat (limited to 'tamer/benches/asg.rs')
0 files changed, 0 insertions, 0 deletions