summaryrefslogtreecommitdiff
path: root/src/context.rs
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2026-06-11 13:42:31 -0700
committerMike Buland <mike@xagasoft.com>2026-06-11 13:42:31 -0700
commitc9889f7c6622def3b6badde2738c3e912b48144f (patch)
tree35eb83eb7b9eee530512f84c73640d16ffc1a6de /src/context.rs
parentcffacc4dc4a46b525250772e87fd69a2f1c64dc2 (diff)
downloadcrimtag-c9889f7c6622def3b6badde2738c3e912b48144f.tar.gz
crimtag-c9889f7c6622def3b6badde2738c3e912b48144f.tar.bz2
crimtag-c9889f7c6622def3b6badde2738c3e912b48144f.tar.xz
crimtag-c9889f7c6622def3b6badde2738c3e912b48144f.zip
Basic if statements work.
I need to tweak the parser to get mid-tags working, then we can have else, and maybe elif. After that is expressions.
Diffstat (limited to 'src/context.rs')
-rw-r--r--src/context.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/context.rs b/src/context.rs
index 78a7940..e4cd5c2 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -44,6 +44,7 @@ pub enum Value {
44 String(String), 44 String(String),
45 Int(i64), 45 Int(i64),
46 Float(f64), 46 Float(f64),
47 Bool(bool),
47 Identifier(Identifier), 48 Identifier(Identifier),
48} 49}
49 50
@@ -71,6 +72,12 @@ impl From<f64> for Value {
71 } 72 }
72} 73}
73 74
75impl From<bool> for Value {
76 fn from(val: bool) -> Value {
77 Value::Bool(val)
78 }
79}
80
74impl From<Vec<Value>> for Value { 81impl From<Vec<Value>> for Value {
75 fn from(val: Vec<Value>) -> Value { 82 fn from(val: Vec<Value>) -> Value {
76 Value::List(val) 83 Value::List(val)