diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-07-26 18:34:44 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-07-26 18:34:44 +0300 |
commit | 34074287861b3ef6c9ee89195056d20ae1603cfc (patch) | |
tree | a9faa94ce84f17a9a383f3ab1ec8ab314b6620f8 /src/sexp/util.rs | |
parent | 6dbcbc54352dc81b6ef2f2ecd9719eac40d8f1e6 (diff) | |
download | myslip-34074287861b3ef6c9ee89195056d20ae1603cfc.tar.gz myslip-34074287861b3ef6c9ee89195056d20ae1603cfc.zip |
Added variables and tests for their substitution
Diffstat (limited to 'src/sexp/util.rs')
-rw-r--r-- | src/sexp/util.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sexp/util.rs b/src/sexp/util.rs index c31358f..ce6de5d 100644 --- a/src/sexp/util.rs +++ b/src/sexp/util.rs @@ -25,3 +25,8 @@ impl From<i32> for SLeaf { pub fn scons(x: impl Into<Box<SExp>>, y: impl Into<Box<SExp>>) -> SExp { SCons(x.into(), y.into()) } + +pub fn var(name: &str) -> SExp { + Atom(Var(name.to_string())) +} + |