feat: usable?

This commit is contained in:
2025-05-05 11:31:46 +08:00
parent eea4a4ce9f
commit b9dcc83c39
24 changed files with 688 additions and 244 deletions

View File

@@ -1,3 +1,5 @@
use std::fmt::{Debug, Formatter, Result};
use ecow::EcoString;
use crate::ty::internal::Const;
@@ -57,6 +59,8 @@ pub enum OpCode {
/// push an empty attribute set onto stack
AttrSet,
/// push an empty recursive attribute set onto stack
RecAttrSet,
/// [ .. set value ] consume 1 element, push a static kv pair (`name`, `value`) into `set`
PushStaticAttr { name: EcoString },
/// [ .. set name value ] consume 2 elements, push a dynamic kv pair (`name`, `value`) in to `set`
@@ -87,15 +91,14 @@ pub enum OpCode {
/// [ .. set sym ] select `sym` from `set`
SelectDynamic,
/// [ .. set sym default ] select `sym` from `set` or `default`
SelectDynamicOrDefault,
/// enter the environment of the attribute set at TOS
EnterEnv,
/// exit current envrironment
LeaveEnv,
/// no operation, used as termporary placeholder
NoOp,
/// illegal operation, used as termporary placeholder
Illegal,
}
#[derive(Debug, Clone, Copy)]