xiyuzhai-husky-lang / husky

Empowering everyone towards next generation AI and software.
MIT License
80 stars 7 forks source link

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

Open xiyuzhai opened 13 hours ago

xiyuzhai commented 13 hours 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 13 hours ago

This solves the caching problem of condition