载入中...
搜索中...
未找到
eve::script 命名空间参考

命名空间

namespace  detail
 

类

class  BindContext
 Pins the active VM and a stable diagnostic source for one expose() TU. 更多...
 
struct  BindingContract
 Complete script-facing contract for a native function or method. 更多...
 
class  BindingContractRegistry
 Registry consumed by compiler checks and tooling protocol adapters. 更多...
 
struct  BindingParameterContract
 One native binding parameter visible to EveScript tools and named arguments. 更多...
 
struct  BindingSearchHit
 Ranked Binding Contract hit from text search. 更多...
 
class  Borrowed
 Non-owning C++ observation with no implicit lifetime extension. 更多...
 
class  BorrowedSquirrelObject
 Borrowed view of a rooted Squirrel object for one synchronous call. 更多...
 
class  IScriptModuleProvider
 Pluggable script source backend for directories, archives, plugins, or memory. 更多...
 
class  ISquirrelRootReleaser
 Releases C++-owned Squirrel roots before Runtime destroys its VM. 更多...
 
class  OwnedSquirrelObject
 A rooted Squirrel reference owned by the C++ holder. 更多...
 
struct  RuntimeHandleRef
 Handle plus owner-lifetime epoch for a non-ECS registry object. 更多...
 
class  RuntimeObjectRegistry
 Slot/generation registry whose objects are exclusively unique-owned. 更多...
 
class  RuntimePin
 RAII keep-alive for one RuntimeObjectRegistry entry. 更多...
 
class  ScriptCompiler
 Unified Runtime compiler facade for metadata, diagnostics, and module preparation. 更多...
 
struct  ScriptCompletion
 Tool-neutral completion item suitable for LSP, MCP, and editor adapters. 更多...
 
struct  ScriptDiagnostic
 Stable structured diagnostic shared by Runtime, LSP, MCP, and editor tools. 更多...
 
struct  ScriptErrorContext
 Structured snapshot of a script error: message, throw site and stack. 更多...
 
struct  ScriptFrame
 One call-stack frame captured while the script error is still live. 更多...
 
struct  ScriptHover
 Tool-neutral hover result for one script or binding symbol. 更多...
 
struct  ScriptMetadata
 Metadata retained for one compiled EveScript source unit. 更多...
 
struct  ScriptModuleRequest
 Logical module request emitted by an EveScript import declaration. 更多...
 
class  ScriptModuleResolver
 Owns providers, the static dependency graph, compiled closures, and module instances. 更多...
 
struct  ScriptModuleSource
 UTF-8 source and stable identity returned by a module provider. 更多...
 
struct  ScriptPropertyMetadata
 Inspector-facing metadata for one annotated script property. 更多...
 
struct  ScriptSourceMap
 Source map for a compiled script. 更多...
 
struct  ScriptSourceMapEntry
 One generated-to-original mapping segment. Native syntax uses identity mappings. 更多...
 
struct  ScriptSourcePosition
 Original EveScript source position. Lines and columns are one-based. 更多...
 
struct  ScriptSymbolMetadata
 Erased source-level symbol retained for tooling. 更多...
 
struct  SquirrelValueOptions
 Limits and provenance used by the Squirrel ↔ Value adapter. 更多...
 

类型定义

template<class T >
using Owned = std::unique_ptr< T >
 C++ owning storage used by an object factory.
 
using ScriptValue = eve::Value
 Canonical detached script value; it never aliases a VM object.
 

枚举

enum class  ScriptDiagnosticSeverity { Info , Warning , Error }
 Severity of a structured EveScript compiler diagnostic. 更多...
 
enum class  ScriptUnit {
  None , Seconds , Milliseconds , Radians ,
  Degrees , Pixels , Meters
}
 Unit attached to a binding parameter or return value. 更多...
 
enum class  ScriptModuleStatus { NotHandled , Found , Error }
 Result of asking a provider to resolve or load a script module. 更多...
 
enum class  ObjectSemantic { Value , Owned , Borrowed }
 The only three meanings a script-facing object may have. 更多...
 

函数

EVENGINE_API_FOUNDATION void registerEngineBindingContracts (BindingContractRegistry &registry)
 Registers the build-generated contracts for every SimpleSquirrel binding.
 
const BindingContractRegistry & generatedBindingContracts ()
 Process-wide generated Binding Contracts for this linked engine build.
 
ScriptErrorContext captureScriptError (HSQUIRRELVM vm)
 Captures the pending runtime error from inside the Squirrel error handler.
 
ScriptErrorContext captureCompileError (HSQUIRRELVM vm)
 Captures the last compilation error recorded by the VM.
 
bool parseCompileError (const std::string &text, std::string *source, int *line, int *column, std::string *message)
 Parses the ssq compile message "Compile error at source:line:column msg".
 
std::string sourceLineText (const std::string &sourceText, int line)
 Extracts one 1-based line from script source text.
 
std::string formatStackTrace (const std::vector< ScriptFrame > &frames)
 Formats just the call-stack portion of a context.
 
std::string formatScriptError (const ScriptErrorContext &ctx)
 Formats a context into a human-readable multi-line report.
 
void setLastScriptError (HSQUIRRELVM vm, ScriptErrorContext ctx)
 Records the last error for a VM (thread-local, synchronous consumers).
 
ScriptErrorContext takeLastScriptError (HSQUIRRELVM vm)
 Consumes and clears the last recorded error for a VM.
 
const ScriptErrorContext * peekLastScriptError (HSQUIRRELVM vm)
 Peeks at the last recorded error for a VM without clearing it.
 
void clearLastScriptError (HSQUIRRELVM vm)
 Drops any recorded error for a VM.
 
std::string formatLastScriptError (HSQUIRRELVM vm)
 Formats the last captured error for a VM without consuming it.
 
template<class F >
void bindMethod (ssq::Class &cls, const char *name, F &&fn)
 Register one script method while keeping a literal name for Binding Contracts.
 
template<class ScriptT , class Getter >
void bindNullSafe (ssq::Class &cls, const char *name, Getter getter, std::invoke_result_t< Getter, ScriptT & > whenNull)
 Register a null-safe getter that returns whenNull when self is null.
 
Result< Value > valueFromSquirrel (HSQUIRRELVM vm, SQInteger index, const SquirrelValueOptions &options={})
 Convert one Squirrel value into the canonical owning Value tree.
 
Result< Value > valueFromSquirrel (const ssq::Object &object, const SquirrelValueOptions &options={})
 Convert a rooted Squirrel object into the canonical owning Value tree.
 
Result< void > pushValue (HSQUIRRELVM vm, const Value &value, const SquirrelValueOptions &options={})
 Push a canonical Value into the active Squirrel VM.
 
ssq::Table projectDiagnostic (HSQUIRRELVM vm, const Diagnostic &diagnostic)
 Project one Diagnostic using the common script table schema.
 
ssq::Table projectStatus (HSQUIRRELVM vm, const Status &status)
 Project one Status using the common script table schema.
 
ssq::Table projectStatusResult (HSQUIRRELVM vm, const Status &status)
 Project a checked native status that carries no payload.
 
ssq::Table projectStatusResult (HSQUIRRELVM vm, const Status &status, const Value &value)
 Project a checked native status together with its canonical payload.
 
ssq::Table projectStatusResult (HSQUIRRELVM vm, const Status &status, ssq::Object value)
 Project a checked native status together with an already-bound script object.
 
void markResultHasValue (ssq::Table &result)
 Declare that a projected table received a payload the caller attached itself.
 
ssq::Table projectResult (HSQUIRRELVM vm, Result< void > &&result)
 Consume and project a void native Result using the common schema.
 
bool ignoreResult (const ssq::Object &result, const std::string &reason)
 Mark a projected Result table as intentionally ignored by script.
 
void exposeResultBindings (ssq::Table &eveTable)
 Expose the common script helpers under eve.result.
 
template<class T , class Projector >
ssq::Table projectResult (HSQUIRRELVM vm, Result< T > &&result, Projector &&projector)
 Consume and project a value-bearing native Result.
 
const char * objectSemanticName (ObjectSemantic semantic) noexcept
 Returns the stable name used by diagnostics and documentation.
 
BorrowedSquirrelObject borrowSquirrelObject (const ssq::Object &object) noexcept
 Creates a one-call Borrowed view without retaining a VM reference.
 
eve::Result< OwnedSquirrelObject > ownSquirrelObject (BorrowedSquirrelObject borrowed)
 Promotes a borrowed VM object to an explicit rooted owner.
 
template<class T >
eve::Result< ssq::Object > makeOwnedSquirrelInstance (HSQUIRRELVM vm, Owned< T > object)
 Creates a Squirrel instance that owns a C++ wrapper through a release hook.
 

类型定义说明

◆ Owned

template<class T >
using eve::script::Owned = typedef std::unique_ptr<T>

C++ owning storage used by an object factory.

模板参数
TObject whose destruction belongs to this owner.
备注
Prefer this alias over a raw owning pointer. Ownership transfer is explicit through move construction or std::move.

在文件 RuntimeRegistry.h 第 33 行定义.

◆ ScriptValue

Canonical detached script value; it never aliases a VM object.

在文件 SquirrelOwnership.h 第 63 行定义.

枚举类型说明

◆ ObjectSemantic

enum class eve::script::ObjectSemantic
strong

The only three meanings a script-facing object may have.

Value is a detached canonical eve::Value tree. Owned is rooted or otherwise responsible for destruction. Borrowed is an observation whose lifetime is bounded by its owner and which must never be retained across a mutation, frame, task, callback, restore, or module unload.

枚举值
Value 
Owned 
Borrowed 

在文件 SquirrelOwnership.h 第 40 行定义.

◆ ScriptDiagnosticSeverity

Severity of a structured EveScript compiler diagnostic.

枚举值
Info 
Warning 
Error 

在文件 ScriptCompiler.h 第 28 行定义.

◆ ScriptModuleStatus

Result of asking a provider to resolve or load a script module.

枚举值
NotHandled 
Found 
Error 

在文件 ScriptModule.h 第 17 行定义.

◆ ScriptUnit

enum class eve::script::ScriptUnit
strong

Unit attached to a binding parameter or return value.

枚举值
None 
Seconds 
Milliseconds 
Radians 
Degrees 
Pixels 
Meters 

在文件 ScriptCompiler.h 第 117 行定义.

函数说明

◆ bindMethod()

template<class F >
void eve::script::bindMethod ( ssq::Class &  cls,
const char *  name,
F &&  fn 
)
inline

Register one script method while keeping a literal name for Binding Contracts.

模板参数
FCallable accepted by ssq::Class::addFunc.
参数
clsScript class being filled.
nameScript-visible method name; must be a string literal at the call site so scripts/generate_binding_contracts.py can scrape it.
fnMember pointer, lambda, or std::function passed through to SimpleSquirrel.
备注
Prefer this (or cls.addFunc("literal", ...)) over building names at runtime.

Binds method.

在文件 SquirrelBindContext.h 第 130 行定义.

引用了 cls, fn , 以及 name.

被这些函数引用 eve::animation::exposeAnimCurveLibraryBindings(), eve::animation::exposeAnimInertializerBindings() , 以及 eve::animation::exposeOrientationWarpingBindings().

◆ bindNullSafe()

template<class ScriptT , class Getter >
void eve::script::bindNullSafe ( ssq::Class &  cls,
const char *  name,
Getter  getter,
std::invoke_result_t< Getter, ScriptT & >  whenNull 
)
inline

Register a null-safe getter that returns whenNull when self is null.

模板参数
ScriptTScript wrapper pointer type.
GetterCallable (ScriptT&) -> R.
参数
clsScript class being filled.
nameScript-visible method name (string literal for Contracts scrape).
getterInvoked only when self is non-null.
whenNullValue returned for a null self.

Binds null safe.

在文件 SquirrelBindContext.h 第 145 行定义.

引用了 cls , 以及 name.

◆ borrowSquirrelObject()

BorrowedSquirrelObject eve::script::borrowSquirrelObject ( const ssq::Object &  object)
inlinenoexcept

Creates a one-call Borrowed view without retaining a VM reference.

在文件 SquirrelOwnership.h 第 98 行定义.

被这些函数引用 eve::ui::ObjectRegistry::registerObject().

◆ captureCompileError()

EVENGINE_API_FOUNDATION ScriptErrorContext eve::script::captureCompileError ( HSQUIRRELVM  vm)

Captures the last compilation error recorded by the VM.

参数
vmVM whose compile just failed (ssq's compiler handler stores it).
返回
Context with message, source, line and column.

在文件 ScriptError.cpp 第 114 行定义.

引用了 eve::script::ScriptErrorContext::column, eve::script::ScriptErrorContext::line, eve::script::ScriptErrorContext::message, parseCompileError(), eve::script::ScriptErrorContext::source , 以及 vm.

被这些函数引用 eve::script::ScriptCompiler::compileBuffer(), eve::dev::ConsolePanel::eval() , 以及 eve::dev::Debugger::evaluate().

◆ captureScriptError()

EVENGINE_API_FOUNDATION ScriptErrorContext eve::script::captureScriptError ( HSQUIRRELVM  vm)

Captures the pending runtime error from inside the Squirrel error handler.

参数
vmVM whose error handler is executing (error value at stack slot 2).
返回
Context with the message and the still-live call stack.

在文件 ScriptError.cpp 第 80 行定义.

引用了 eve::script::ScriptFrame::function, eve::script::ScriptErrorContext::function, level, eve::script::ScriptFrame::line, eve::script::ScriptErrorContext::line, eve::script::ScriptErrorContext::message, eve::script::ScriptFrame::source, eve::script::ScriptErrorContext::source, eve::script::ScriptErrorContext::stack , 以及 vm.

◆ clearLastScriptError()

EVENGINE_API_FOUNDATION void eve::script::clearLastScriptError ( HSQUIRRELVM  vm)

Drops any recorded error for a VM.

参数
vmVM whose pending error should be forgotten.

在文件 ScriptError.cpp 第 237 行定义.

引用了 vm.

被这些函数引用 eve::Runtime::shutdown().

◆ exposeResultBindings()

EVENGINE_API_FOUNDATION void eve::script::exposeResultBindings ( ssq::Table &  eveTable)

Expose the common script helpers under eve.result.

参数
eveTableShared engine root table created by ModuleManager.
备注
This is idempotent for the initial root-table exposure and must be called once by the common composition root.

在文件 SquirrelBinding.cpp 第 505 行定义.

引用了 ignoreResult() , 以及 value.

被这些函数引用 eve::ModuleManager::exposeVM().

◆ formatLastScriptError()

EVENGINE_API_FOUNDATION std::string eve::script::formatLastScriptError ( HSQUIRRELVM  vm)

Formats the last captured error for a VM without consuming it.

参数
vmVM to read.
返回
Multi-line report, or empty when no error is pending.

在文件 ScriptError.cpp 第 242 行定义.

引用了 eve::script::ScriptErrorContext::empty(), formatScriptError(), peekLastScriptError() , 以及 vm.

被这些函数引用 eve::Runtime::initialize().

◆ formatScriptError()

EVENGINE_API_FOUNDATION std::string eve::script::formatScriptError ( const ScriptErrorContext &  ctx)

◆ formatStackTrace()

EVENGINE_API_FOUNDATION std::string eve::script::formatStackTrace ( const std::vector< ScriptFrame > &  frames)

Formats just the call-stack portion of a context.

参数
framesFrames to render, innermost first.
返回
One "source:line in function" line per frame, newline separated.

在文件 ScriptError.cpp 第 186 行定义.

被这些函数引用 formatScriptError().

◆ generatedBindingContracts()

const BindingContractRegistry & eve::script::generatedBindingContracts ( )

Process-wide generated Binding Contracts for this linked engine build.

返回
Shared registry populated once from registerEngineBindingContracts. @ownership Borrowed; the process retains the registry. @lifetime Valid for the remainder of the process. @thread Safe to read from the main / MCP poll thread after static initialization.

在文件 ScriptCompiler.cpp 第 447 行定义.

引用了 registerEngineBindingContracts().

被这些函数引用 eve::script::ScriptCompiler::ScriptCompiler().

◆ ignoreResult()

EVENGINE_API_FOUNDATION bool eve::script::ignoreResult ( const ssq::Object &  result,
const std::string &  reason 
)

Mark a projected Result table as intentionally ignored by script.

参数
resultProjected Result table/object returned by a checked binding.
reasonNon-empty reason retained in ignoreReason.
返回
True when the table was marked; false for a non-table or empty reason.

在文件 SquirrelBinding.cpp 第 475 行定义.

引用了 top , 以及 vm.

被这些函数引用 exposeResultBindings().

◆ makeOwnedSquirrelInstance()

template<class T >
eve::Result< ssq::Object > eve::script::makeOwnedSquirrelInstance ( HSQUIRRELVM  vm,
Owned< T >  object 
)

Creates a Squirrel instance that owns a C++ wrapper through a release hook.

The class for T* must have been registered in this VM with ssq::Table::addClass<T>(). The returned ssq::Object is itself a rooted owner and can safely cross the current native call into script storage.

备注
This is a thin wrapper: the only per-type code it adds is the two one-line adapters above and the type hash.

Make owned squirrel instance.

Failure.

Make owned squirrel instance raw.

在文件 SquirrelOwnership.h 第 241 行定义.

引用了 eve::Result< T >::failure(), makeOwnedSquirrelInstance(), release , 以及 vm.

被这些函数引用 eve::daynight::exposeSkyScriptBindings(), eve::graphics::exposeVegetationScriptBindings() , 以及 makeOwnedSquirrelInstance().

◆ markResultHasValue()

EVENGINE_API_FOUNDATION void eve::script::markResultHasValue ( ssq::Table &  result)

Declare that a projected table received a payload the caller attached itself.

参数
resultTable returned by a payload-free projectStatusResult call.
备注
For payloads that only simplesquirrel can bind (a raw registered pointer, for example). Sets hasValue = true so the schema stays truthful; call it in the same statement that attaches the value, never on its own.

在文件 SquirrelBinding.cpp 第 468 行定义.

被这些函数引用 eve::graphics::exposeCanvasScriptBindings() , 以及 eve::graphics::exposeShaderScriptBindings().

◆ objectSemanticName()

const char * eve::script::objectSemanticName ( ObjectSemantic  semantic)
inlinenoexcept

Returns the stable name used by diagnostics and documentation.

返回
A non-null borrowed pointer to immutable static text. @ownership Borrowed from program-static storage; callers must not free or modify the returned text. @nullable No. @lifetime Static for the process lifetime. @thread Thread-safe and side-effect free. @reentrancy Does not access the VM or invoke callbacks.

在文件 SquirrelOwnership.h 第 52 行定义.

引用了 Borrowed, Owned, semantic , 以及 Value.

◆ ownSquirrelObject()

eve::Result< OwnedSquirrelObject > eve::script::ownSquirrelObject ( BorrowedSquirrelObject  borrowed)
inline

Promotes a borrowed VM object to an explicit rooted owner.

参数
borrowedObject valid for the duration of this call.
返回
A move-only owner, or a structured invalid-argument failure.

Failure.

Error.

Success.

在文件 SquirrelOwnership.h 第 160 行定义.

引用了 borrowed, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, ownSquirrelObject() , 以及 eve::Result< T >::success().

被这些函数引用 ownSquirrelObject() , 以及 eve::ui::ObjectRegistry::registerObject().

◆ parseCompileError()

EVENGINE_API_FOUNDATION bool eve::script::parseCompileError ( const std::string &  text,
std::string *  source,
int *  line,
int *  column,
std::string *  message 
)

Parses the ssq compile message "Compile error at source:line:column msg".

参数
textMessage produced by ssq::CompileException::what().
sourceReceives the source name (may be nullptr).
lineReceives the 1-based line (may be nullptr).
columnReceives the 1-based column (may be nullptr).
messageReceives the raw compiler description (may be nullptr).
返回
True when the message matched the expected layout.

在文件 ScriptError.cpp 第 131 行定义.

引用了 column, line, message, source , 以及 text.

被这些函数引用 captureCompileError().

◆ peekLastScriptError()

EVENGINE_API_FOUNDATION const ScriptErrorContext * eve::script::peekLastScriptError ( HSQUIRRELVM  vm)

Peeks at the last recorded error for a VM without clearing it.

参数
vmVM the error belongs to.
返回
Pointer to the stored context, or nullptr when none is pending.

在文件 ScriptError.cpp 第 231 行定义.

引用了 found , 以及 vm.

被这些函数引用 eve::Runtime::execute(), formatLastScriptError() , 以及 eve::dev::DevTool::notifyError().

◆ projectDiagnostic()

EVENGINE_API_FOUNDATION ssq::Table eve::script::projectDiagnostic ( HSQUIRRELVM  vm,
const Diagnostic &  diagnostic 
)

◆ projectResult() [1/2]

template<class T , class Projector >
ssq::Table eve::script::projectResult ( HSQUIRRELVM  vm,
Result< T > &&  result,
Projector &&  projector 
)

Consume and project a value-bearing native Result.

模板参数
TNative Result payload type.
ProjectorPure projection from the native payload to Value.
参数
vmActive Squirrel VM.
resultChecked Result returned by a domain API.
projectorDomain-specific, non-throwing data projection.
返回
A common {ok, code, status, diagnostics, value, ...} table.
备注
Calling this helper observes the Result on both success and failure. It therefore never relies on a domain lastError slot.

Project result.

Project status result.

在文件 SquirrelBinding.h 第 132 行定义.

引用了 payload, projectStatusResult(), status , 以及 vm.

◆ projectResult() [2/2]

EVENGINE_API_FOUNDATION ssq::Table eve::script::projectResult ( HSQUIRRELVM  vm,
Result< void > &&  result 
)

Consume and project a void native Result using the common schema.

在文件 SquirrelBinding.cpp 第 470 行定义.

引用了 projectStatusResult(), status , 以及 vm.

被这些函数引用 eve::housegen::HouseGen::expose(), eve::editor::exposeActionTimelineScriptBindings(), eve::animation::exposeAnimClipBindings(), eve::animation::exposeAnimCurveLibraryBindings(), eve::animation::exposeAnimInertializerBindings(), eve::graphics::exposeCanvasScriptBindings(), eve::climbing::exposeClimbingMotionBindings(), eve::rts::script_internal::exposeFormationBindings(), eve::graphics::exposeGrassWindBindings(), eve::procgen::exposeGridMeshGraphs(), eve::housegen::exposeHouseGeneration(), eve::scene::exposeLocationProfileBindings(), eve::procgen::exposeMeshModifierGraph(), eve::procgen::exposeModuleAssembly(), eve::animation::exposeMotionMatcherBindings(), eve::animation::exposeOrientationWarpingBindings(), eve::scene::exposePcgBuildConfigBindings(), eve::camera::exposePcgCarCameraSetupBindings(), eve::ui::exposePcgColorPreviewSyncBindings(), eve::ui::exposePcgControllerSelectionBindings(), eve::ui::exposePcgDraggableWindowBindings(), eve::procgen::exposePcgFrameRateManagerBindings(), eve::camera::exposePcgFreeCameraBindings(), eve::scene::exposePcgGrowthBindings(), eve::ui::exposePcgLoadingScreenBindings(), eve::ui::exposePcgPhotoModeApplyPlanBindings(), eve::ui::exposePcgPhotoModeColorPickerBindings(), eve::ui::exposePcgPhotoModePanelsBindings(), eve::ui::exposePcgPhotoModeRangesBindings(), eve::ui::exposePcgPhotoModeRuntimeUIBindings(), eve::ui::exposePcgPhotoModeSessionBindings(), eve::ui::exposePcgPhotoModeValuesBindings(), eve::ui::exposePcgScreenshotSavedNoticeBindings(), eve::ui::exposePcgTooltipBindings(), eve::graphics::exposePcgWaterPhotoModeBindings(), eve::graphics::detail::exposeRenderable3DBindings(), eve::graphics::detail::exposeShaderResourceBindings(), eve::graphics::exposeShaderScriptBindings(), eve::daynight::exposeSkyScriptBindings(), eve::graphics::exposeVegetationScriptBindings(), eve::fluids::exposeVolumeFluidFactory(), eve::fluids::exposeVolumeFluidType(), eve::graphics::exposeWaterPlanarReflectionBindings(), eve::graphics::exposeWaterReflectionMaskerBindings() , 以及 eve::graphics::exposeWaterSystemBindings().

◆ projectStatus()

EVENGINE_API_FOUNDATION ssq::Table eve::script::projectStatus ( HSQUIRRELVM  vm,
const Status &  status 
)

Project one Status using the common script table schema.

在文件 SquirrelBinding.cpp 第 450 行定义.

引用了 status , 以及 vm.

◆ projectStatusResult() [1/3]

ssq::Table eve::script::projectStatusResult ( HSQUIRRELVM  vm,
const Status &  status 
)

◆ projectStatusResult() [2/3]

EVENGINE_API_FOUNDATION ssq::Table eve::script::projectStatusResult ( HSQUIRRELVM  vm,
const Status &  status,
const Value &  value 
)

Project a checked native status together with its canonical payload.

参数
vmActive Squirrel VM.
statusNative status copied from the checked Result.
valuePayload to expose; passing one sets hasValue = true.
返回
A table with the stable Result projection schema.

在文件 SquirrelBinding.cpp 第 456 行定义.

引用了 status, value , 以及 vm.

◆ projectStatusResult() [3/3]

EVENGINE_API_FOUNDATION ssq::Table eve::script::projectStatusResult ( HSQUIRRELVM  vm,
const Status &  status,
ssq::Object  value 
)

Project a checked native status together with an already-bound script object.

参数
vmActive Squirrel VM.
statusNative status copied from the checked Result.
valuePayload produced by makeOwnedSquirrelInstance/makeOwnedProxy and friends.
返回
A table with the stable Result projection schema.
备注
Payload presence is carried by the overload; there is no flag to disagree with.

在文件 SquirrelBinding.cpp 第 462 行定义.

引用了 status, value , 以及 vm.

◆ pushValue()

EVENGINE_API_FOUNDATION Result< void > eve::script::pushValue ( HSQUIRRELVM  vm,
const Value &  value,
const SquirrelValueOptions &  options = {} 
)

Push a canonical Value into the active Squirrel VM.

参数
vmActive Squirrel VM.
valueOwning value to project recursively.
optionsRecursion, element-count and diagnostic-source policy.
返回
Success with exactly one value pushed, or a diagnostic; on failure the VM stack is restored to its original height.

在文件 SquirrelBinding.cpp 第 369 行定义.

引用了 elements, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, options, eve::script::SquirrelValueOptions::source, eve::Result< T >::success(), top, value , 以及 vm.

◆ registerEngineBindingContracts()

EVENGINE_API_FOUNDATION void eve::script::registerEngineBindingContracts ( BindingContractRegistry &  registry)

Registers the build-generated contracts for every SimpleSquirrel binding.

被这些函数引用 generatedBindingContracts().

◆ setLastScriptError()

EVENGINE_API_FOUNDATION void eve::script::setLastScriptError ( HSQUIRRELVM  vm,
ScriptErrorContext  ctx 
)

Records the last error for a VM (thread-local, synchronous consumers).

参数
vmVM the error belongs to.
ctxContext to store.

在文件 ScriptError.cpp 第 217 行定义.

引用了 vm.

◆ sourceLineText()

EVENGINE_API_FOUNDATION std::string eve::script::sourceLineText ( const std::string &  sourceText,
int  line 
)

Extracts one 1-based line from script source text.

参数
sourceTextFull script source.
line1-based line number.
返回
The line without trailing newline, or empty when out of range.

在文件 ScriptError.cpp 第 170 行定义.

引用了 current, end, line, start , 以及 text.

◆ takeLastScriptError()

EVENGINE_API_FOUNDATION ScriptErrorContext eve::script::takeLastScriptError ( HSQUIRRELVM  vm)

Consumes and clears the last recorded error for a VM.

参数
vmVM the error belongs to.
返回
The stored context, or an empty context when none is pending.

在文件 ScriptError.cpp 第 222 行定义.

引用了 found , 以及 vm.

被这些函数引用 eve::Runtime::createInstance(), eve::dev::ConsolePanel::eval() , 以及 eve::dev::Debugger::evaluate().

◆ valueFromSquirrel() [1/2]

EVENGINE_API_FOUNDATION Result< Value > eve::script::valueFromSquirrel ( const ssq::Object &  object,
const SquirrelValueOptions &  options = {} 
)

Convert a rooted Squirrel object into the canonical owning Value tree.

参数
objectRooted object whose VM owns the referenced value.
optionsRecursion, element-count and diagnostic-source policy.
返回
An owning Value, or a path-aware conversion diagnostic.

在文件 SquirrelBinding.cpp 第 356 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, options, eve::script::SquirrelValueOptions::source, top, valueFromSquirrel() , 以及 vm.

◆ valueFromSquirrel() [2/2]

EVENGINE_API_FOUNDATION Result< Value > eve::script::valueFromSquirrel ( HSQUIRRELVM  vm,
SQInteger  index,
const SquirrelValueOptions &  options = {} 
)

Convert one Squirrel value into the canonical owning Value tree.

参数
vmActive Squirrel VM; it must remain valid for the call.
indexStack index of the value; both positive and negative indices are accepted.
optionsRecursion, element-count and diagnostic-source policy.
返回
An owning Value, or a path-aware conversion diagnostic.
备注
The VM stack is restored to its original height before returning.

在文件 SquirrelBinding.cpp 第 342 行定义.

引用了 context, eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument, options, output, eve::script::SquirrelValueOptions::source, eve::Result< T >::success(), top , 以及 vm.

被这些函数引用 eve::editor::exposeActionTimelineScriptBindings(), eve::scene_editor::exposeSceneEditorSessions(), eve::graphics::exposeVegetationScriptBindings(), eve::fluids::exposeVolumeFluidFactory(), eve::fluids::exposeVolumeFluidType() , 以及 valueFromSquirrel().