xiyuzhai-husky-lang / husky

Empowering everyone towards next generation AI and software.
MIT License
85 stars 8 forks source link

add expr to Condition::Be in hir, vmir, handle them properly when evaluate, like history #304

Open xiyuzhai opened 1 month ago

xiyuzhai commented 1 month ago

crates/hir/husky-hir-eager-expr/src/stmt.rs

SemCondition::Be {
                expr,
                src,
                contract,
                be_regional_token_idx: _,
                target,
            } => HirEagerCondition::Be {
                opd: src.to_hir_eager(builder),
                contract: HirContract::from_contract(contract),
                pattern: target.to_hir_eager(builder),
            },

crates/hir/husky-hir-lazy-expr/src/stmt.rs

 match *self {
            SemCondition::Be {
                expr,
                src,
                contract,
                be_regional_token_idx: _,
                target,
            } => HirLazyCondition::Be {
                src: src.to_hir_lazy(builder),
                pattern: target.to_hir_lazy(builder),
            },
xiyuzhai commented 1 month ago

This solves the caching problem of condition