-
Notifications
You must be signed in to change notification settings - Fork 0
API Host ScriptSourceReference
Resolver 成功解析 import/include 路径后返回的稳定来源标识。
Stable identity returned by a resolver after an import/include path is resolved.
命名空间:AuroraScript.Core。类型:struct。
Namespace:
AuroraScript.Core. Kind: struct.
Purpose
ScriptSourceReference 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。
Stable identity returned by a resolver after an import/include path is resolved.
Simple Example
下面是 ScriptSourceReference 的最小使用方式。
A minimal use of
ScriptSourceReference.
var reference = new ScriptSourceReference(
"mem://app/",
"main.as");
Console.WriteLine(reference.FullPath); // mem://app/main.asMembers
签名
ScriptSourceReference(string baseDirectory, string fullPath)ScriptSourceReference(string baseDirectory, string fullPath, string modulePath)
创建 ScriptSourceReference 实例。
Use the member according to its public signature.
Parameters:
-
baseDirectory
来源所属的 Resolver 根目录。Resolver root directory owning the source.
-
fullPath
来源的规范化完整路径。Normalized full path of the source.
-
modulePath
按签名提供的string参数。The
stringparameter required by the signature.
Returns
新建的 ScriptSourceReference 实例。
A new
ScriptSourceReferenceinstance.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
var value = new ScriptSourceReference(/* 参数 */);读取 BaseDirectory 属性。
Resolver root that should read this reference.
Parameters:
- 无。
None.
Returns
返回 string。
Returns
string.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptSourceReference value = /* 从宿主 API 获取实例 */;
var current = value.BaseDirectory;读取 FullPath 属性。
Normalized absolute file path or virtual source identifier.
Parameters:
- 无。
None.
Returns
返回 string。
Returns
string.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptSourceReference value = /* 从宿主 API 获取实例 */;
var current = value.FullPath;读取 ModulePath 属性。
Module-relative path used by compiler/runtime names.
Parameters:
- 无。
None.
Returns
返回 string。
Returns
string.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptSourceReference value = /* 从宿主 API 获取实例 */;
var current = value.ModulePath;AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License