tamer: asg::air::{AirState=>AirAggregate}: Rename

Like the previous commit, this emphasizes what is happening.

DEV-7145
main
Mike Gerwitz 2022-06-02 13:26:46 -04:00
parent 45bbf3879e
commit 91b55999e2
2 changed files with 16 additions and 14 deletions

View File

@ -111,12 +111,12 @@ impl Display for AirToken {
/// all state is stored on the ASG itself,
/// which is the parsing context.
#[derive(Debug, PartialEq, Eq, Default)]
pub enum AirState {
pub enum AirAggregate {
#[default]
Empty,
}
impl ParseState for AirState {
impl ParseState for AirAggregate {
type Token = AirToken;
type Object = ();
type Error = AsgError;
@ -131,7 +131,7 @@ impl ParseState for AirState {
tok: Self::Token,
asg: &mut Self::Context,
) -> crate::parse::TransitionResult<Self> {
use AirState::*;
use AirAggregate::*;
use AirToken::*;
match (self, tok) {
@ -167,9 +167,9 @@ impl ParseState for AirState {
}
}
impl Display for AirState {
impl Display for AirAggregate {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
use AirState::*;
use AirAggregate::*;
// This is not terribly useful beyond indicating which parser caused
// an error.
@ -192,7 +192,7 @@ mod test {
use super::*;
type Sut = AirState;
type Sut = AirAggregate;
#[test]
fn ident_decl() {

View File

@ -27,7 +27,7 @@ use super::xmle::{
};
use crate::{
asg::{
air::{AirState, AirToken},
air::{AirAggregate, AirToken},
Asg, AsgError, DefaultAsg, Ident, Object,
},
diagnose::{AnnotatedSpan, Diagnostic},
@ -190,11 +190,12 @@ fn load_xmlo<'a, P: AsRef<Path>, S: Escaper>(
// TODO: This entire block is a WIP and will be incrementally
// abstracted away.
let (mut asg, mut state) =
Lower::<ParsedObject<XirToken, XirError>, flat::State<64>>::lower::<
_,
TameldError,
>(&mut XmlXirReader::new(file, escaper, ctx), |toks| {
let (mut asg, mut state) = Lower::<
ParsedObject<XirToken, XirError>,
flat::State<64>,
>::lower::<_, TameldError>(
&mut XmlXirReader::new(file, escaper, ctx),
|toks| {
Lower::<flat::State<64>, XmloReader>::lower(toks, |xmlo| {
let mut iter = xmlo.scan(false, |st, rtok| match st {
true => None,
@ -212,7 +213,7 @@ fn load_xmlo<'a, P: AsRef<Path>, S: Escaper>(
state,
|air| {
let (_, asg) =
Lower::<XmloToAir, AirState>::lower_with_context(
Lower::<XmloToAir, AirAggregate>::lower_with_context(
air,
asg,
|end| {
@ -227,7 +228,8 @@ fn load_xmlo<'a, P: AsRef<Path>, S: Escaper>(
},
)
})
})?;
},
)?;
let mut dir: PathBuf = path.clone();
dir.pop();