tamer: nir::air: Lower to Air::TODO
This actually passes data to the next parser, whereas before we were stopping short. DEV-13160main
parent
d55b3add77
commit
be41d056bb
|
@ -60,6 +60,10 @@ pub type DepSym = SymbolId;
|
|||
/// subsequently analyzed and rewritten.
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum AirToken {
|
||||
/// Placeholder token for objects that do not yet have a proper place on
|
||||
/// the ASG.
|
||||
Todo,
|
||||
|
||||
/// Declare a resolved identifier.
|
||||
IdentDecl(IdentSym, IdentKind, Source),
|
||||
/// Declare an external identifier that must be resolved before linking.
|
||||
|
@ -91,6 +95,8 @@ impl Display for AirToken {
|
|||
use AirToken::*;
|
||||
|
||||
match self {
|
||||
Todo => write!(f, "TODO"),
|
||||
|
||||
IdentDecl(sym, ..) => {
|
||||
write!(f, "declaration of identifier `{sym}`")
|
||||
}
|
||||
|
@ -139,6 +145,8 @@ impl ParseState for AirAggregate {
|
|||
use AirToken::*;
|
||||
|
||||
match (self, tok) {
|
||||
(Empty, Todo) => Transition(Empty).incomplete(),
|
||||
|
||||
(Empty, IdentDecl(sym, kind, src)) => {
|
||||
asg.declare(sym, kind, src).map(|_| ()).transition(Empty)
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ impl ParseState for NirToAir {
|
|||
_tok: Self::Token,
|
||||
_: NoContext,
|
||||
) -> TransitionResult<Self::Super> {
|
||||
Transition(self).incomplete()
|
||||
Transition(self).ok(Air::Todo)
|
||||
}
|
||||
|
||||
fn is_accepting(&self, _: &Self::Context) -> bool {
|
||||
|
|
Loading…
Reference in New Issue