mirror of
https://github.com/SpaceManiac/SpacemanDMM.git
synced 2025-12-23 05:36:47 +00:00
Add ConstFn::File
This commit is contained in:
parent
6b401ef5ef
commit
cb31916ca0
2 changed files with 5 additions and 0 deletions
|
|
@ -122,6 +122,7 @@ impl<'o> AssumptionSet<'o> {
|
|||
ConstFn::Newlist => AssumptionSet::from_valid_instance(objtree.expect("/list")),
|
||||
ConstFn::Sound => AssumptionSet::from_valid_instance(objtree.expect("/sound")),
|
||||
ConstFn::Filter => AssumptionSet::default(),
|
||||
ConstFn::File => AssumptionSet::default(),
|
||||
},
|
||||
Constant::New { type_, args: _ } => {
|
||||
if let Some(pop) = type_.as_ref() {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ pub enum ConstFn {
|
|||
Sound,
|
||||
/// The `filter()` type constructor.
|
||||
Filter,
|
||||
/// The `file()` annotator (marks a string as `isfile`).
|
||||
File,
|
||||
}
|
||||
|
||||
/// A constant-evaluation error (usually type mismatch).
|
||||
|
|
@ -334,6 +336,7 @@ impl fmt::Display for ConstFn {
|
|||
ConstFn::Newlist => "newlist",
|
||||
ConstFn::Sound => "sound",
|
||||
ConstFn::Filter => "filter",
|
||||
ConstFn::File => "file",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -700,6 +703,7 @@ impl<'a> ConstantFolder<'a> {
|
|||
"newlist" => Constant::Call(ConstFn::Newlist, self.arguments(args)?),
|
||||
"icon" => Constant::Call(ConstFn::Icon, self.arguments(args)?),
|
||||
"sound" => Constant::Call(ConstFn::Sound, self.arguments(args)?),
|
||||
"file" => Constant::Call(ConstFn::File, self.arguments(args)?),
|
||||
// constant-evaluatable functions
|
||||
"rgb" => {
|
||||
use std::fmt::Write;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue