9class ExpressionContext;
12namespace enzo::script {
16namespace enzo::daslang {
19using ScriptArgument = std::variant<intT, void*>;
22inline constexpr size_t maxScriptArguments = 32;
49 const String& functionName,
58 const String& functionName,
67 const String& functionName,
77 const String& functionName,
78 std::span<const ScriptArgument> arguments,
80 size_t primitiveIndex,
97 std::shared_ptr<CompiledProgram>
clone()
const;
105 std::unique_ptr<Impl> impl_;
128 std::shared_ptr<CompiledProgram>
129 compile(
const String& name,
const String& source, String& error);
Basic attribute, parameter, and node types for Enzo.
A compiled daslang program ready to run.
Definition Runtime.h:42
std::vector< bool > getWrittenArguments(const String &functionName) const
Returns whether the function writes each of its arguments, in argument order.
Definition Runtime.cpp:164
bool evalString(const String &functionName, const expr::ExpressionContext *context, String &result, String &error)
Evaluates an exported function as a string.
Definition Runtime.cpp:132
bool run(const String &functionName, std::span< const ScriptArgument > arguments, const script::ScriptContext *context, size_t primitiveIndex, String &error)
Runs an exported function for its side effects.
Definition Runtime.cpp:148
bool evalInt(const String &functionName, const expr::ExpressionContext *context, intT &result, String &error)
Evaluates an exported function as an integer.
Definition Runtime.cpp:119
std::shared_ptr< CompiledProgram > clone() const
Returns a copy that shares the compiled program and runs in its own context.
Definition Runtime.cpp:180
bool evalFloat(const String &functionName, const expr::ExpressionContext *context, floatT &result, String &error)
Evaluates an exported function as a float.
Definition Runtime.cpp:106
std::vector< String > takeWarnings()
Returns the warnings the runs added and clears them.
Definition Runtime.cpp:178
Shared host for the daslang runtime.
Definition Runtime.h:119
std::shared_ptr< CompiledProgram > compile(const String &name, const String &source, String &error)
Compiles source text into a reusable script.
Definition Runtime.cpp:212
The world a single expression evaluation reads and writes to.
Definition ExpressionContext.h:28
The world a script reads during one cook of a node.
Definition ScriptContext.h:28
Definition Runtime.cpp:26