本文整理汇总了C#中ProtoScript.Runners.ProtoScriptRunner类的典型用法代码示例。如果您正苦于以下问题:C# ProtoScript.Runners.ProtoScriptRunner类的具体用法?C# ProtoScript.Runners.ProtoScriptRunner怎么用?C# ProtoScript.Runners.ProtoScriptRunner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProtoScript.Runners.ProtoScriptRunner类属于命名空间,在下文中一共展示了ProtoScript.Runners.ProtoScriptRunner类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1:
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
fsr.Execute(
@"
[Associative]
{
a = [Imperative]
{
开发者ID:lewshion,项目名称:Dynamo,代码行数:7,代码来源:MultiLanugageBasic.cs
示例2: RedefineWithFunctions03
public void RedefineWithFunctions03()
{
String code =
@"
class C
{
mx : var;
constructor C()
{
mx = 10;
}
def f(a : int)
{
mx = a + 1;
return = mx;
}
}
x = 10;
p = C.C();
x = p.f(x);
";
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
Assert.IsTrue((Int64)mirror.GetValue("x").Payload == 11);
}
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:25,代码来源:RedefinitionExpression.cs
示例3: GetUpcastChainTest
public void GetUpcastChainTest()
{
String code =
@"class A {}
class B extends A {}
class C extends B {}
";
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
ProtoCore.RuntimeCore runtimeCore = null;
runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
int idA = core.ClassTable.IndexOf("A");
int idB = core.ClassTable.IndexOf("B");
int idC = core.ClassTable.IndexOf("C");
ClassNode cnA = core.ClassTable.ClassNodes[idA];
ClassNode cnB = core.ClassTable.ClassNodes[idB];
ClassNode cnC = core.ClassTable.ClassNodes[idC];
List<int> idsA = ClassUtils.GetClassUpcastChain(cnA, runtimeCore);
List<int> idsB = ClassUtils.GetClassUpcastChain(cnB, runtimeCore);
List<int> idsC = ClassUtils.GetClassUpcastChain(cnC, runtimeCore);
Assert.IsTrue(idsA.Count == 2);
Assert.IsTrue(idsA.Contains(idA));
Assert.IsTrue(idsB.Count == 3);
Assert.IsTrue(idsB.Contains(idA));
Assert.IsTrue(idsB.Contains(idB));
Assert.IsTrue(idsC.Count == 4);
Assert.IsTrue(idsC.Contains(idA));
Assert.IsTrue(idsC.Contains(idB));
Assert.IsTrue(idsC.Contains(idC));
}
开发者ID:Conceptual-Design,项目名称:Dynamo,代码行数:30,代码来源:ClassUtilsTest.cs
示例4: ExecuteAndVerify
protected int ExecuteAndVerify(String code, ValidationData[] data, Dictionary<string, Object> context, out int nErrors)
{
ProtoCore.Core core = Setup();
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
ProtoCore.CompileTime.Context compileContext = new ProtoCore.CompileTime.Context(code, context);
ProtoCore.RuntimeCore runtimeCore = null;
ExecutionMirror mirror = fsr.Execute(compileContext, core, out runtimeCore);
int nWarnings = runtimeCore.RuntimeStatus.WarningCount;
nErrors = core.BuildStatus.ErrorCount;
if (data == null)
{
runtimeCore.Cleanup();
return nWarnings + nErrors;
}
TestFrameWork thisTest = new TestFrameWork();
foreach (var item in data)
{
if (item.ExpectedValue == null)
{
object nullOb = null;
TestFrameWork.Verify(mirror, item.ValueName, nullOb, item.BlockIndex);
}
else
{
TestFrameWork.Verify(mirror, item.ValueName, item.ExpectedValue, item.BlockIndex);
}
}
runtimeCore.Cleanup();
return nWarnings + nErrors;
}
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:30,代码来源:CSFFITest.cs
示例5: T0000_sample
public void T0000_sample()
{
String code =
@"
x = 1;
";
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
String errmsg = "";
ExecutionMirror mirror = thisTest.VerifyRunScriptSource(code, errmsg);
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:9,代码来源:Old_Language_test_Cases.cs
示例6: scale
return = 0;
}
x = 10;
y = 40;
n = scale();
n = scale(10);
";
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:9,代码来源:MethodResolution.cs
示例7: SimpleMethodOverload1
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
Assert.IsTrue((Int64)mirror.GetValue("x").Payload == 123);
Assert.IsTrue((Int64)mirror.GetValue("y").Payload == 345);
}
[Test]
[Category("DSDefinedClass_Ported")]
public void SimpleMethodOverload1()
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:9,代码来源:MethodResolution.cs
示例8: TestMultLanguageImperativeAssociative
b = 4;
}
", core, out runtimeCore);
}
[Test]
public void TestMultLanguageImperativeAssociative()
{
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
fsr.Execute(
@"
开发者ID:lewshion,项目名称:Dynamo,代码行数:10,代码来源:MultiLanugageBasic.cs
示例9: ParserFailTest2
});
}
[Test]
public void ParserFailTest2()
{
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
//@TODO: What exception should this throw
Assert.Throws(typeof(ProtoCore.Exceptions.CompileErrorsOccured), () =>
{
fsr.Execute(
开发者ID:lewshion,项目名称:Dynamo,代码行数:10,代码来源:ProtoScriptTest.cs
示例10: SimpleExpr
public void SimpleExpr()
{
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
runtimeCore = fsr.Execute(
@"
[Associative]
{
a = 10;
}
", core);
}
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:11,代码来源:ModifierStack.cs
示例11: TestSingleLanguageImperative
public void TestSingleLanguageImperative()
{
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
runtimeCore = fsr.Execute(
@"
[Imperative]
{
a = 3;
b = 4;
}
", core);
}
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:12,代码来源:MultiLanugageBasic.cs
示例12: RedefineWithFunctions01
public void RedefineWithFunctions01()
{
String code =
@"
def f(i : int)
{
return = i + 1;
}
x = 1000;
x = f(x);
";
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
Assert.IsTrue((Int64)mirror.GetValue("x").Payload == 1001);
}
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:15,代码来源:RedefinitionExpression.cs
示例13: SimpleFuncDef
public void SimpleFuncDef()
{
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
runtimeCore = fsr.Execute(
@"
[Associative]
{
def foo : int (b : int)
{
return = 2;
}
x = foo(2);
}
", core);
}
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:15,代码来源:ModifierStack.cs
示例14: TestMultLanguageImperativeAssociative
public void TestMultLanguageImperativeAssociative()
{
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
runtimeCore = fsr.Execute(
@"
[Imperative]
{
[Associative]
{
return= 5;
}
b = 4;
}
", core);
}
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:15,代码来源:MultiLanugageBasic.cs
示例15: StackValueDiffTestDefect
public void StackValueDiffTestDefect()
{
String code =
@"[Imperative]
{
a = 1;
b = 1.0;
}
";
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
ProtoCore.RuntimeCore runtimeCore = null;
runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
StackValue svA = mirror.GetRawFirstValue("a");
StackValue svB = mirror.GetRawFirstValue("b");
Assert.IsTrue(svA.metaData.type != svB.metaData.type);
}
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:16,代码来源:ArrayUtilsTest.cs
示例16: TwoSimpleExprInModifierStack
public void TwoSimpleExprInModifierStack()
{
ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
ExecutionMirror mirror = fsr.Execute(
@"
a;
[Associative]
{
a =
{
10;
20;
}
}
", core, out runtimeCore);
Assert.IsTrue((Int64)mirror.GetValue("a", 0).Payload == 20);
}
开发者ID:lewshion,项目名称:Dynamo,代码行数:17,代码来源:ModifierStack.cs
示例17: f
}
def f(a : int)
{
mx = a + 1;
return = mx;
}
}
x = 10;
开发者ID:lewshion,项目名称:Dynamo,代码行数:8,代码来源:RedefinitionExpression.cs
示例18: RedefineWithFunctions03
public void RedefineWithFunctions03()
{
String code =
@"
class C
{
mx : var;
constructor C()
开发者ID:lewshion,项目名称:Dynamo,代码行数:8,代码来源:RedefinitionExpression.cs
示例19: SimpleMethodOverload2
runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
Assert.IsTrue((Int64)mirror.GetValue("x").Payload == 123);
Assert.IsTrue((Int64)mirror.GetValue("y").Payload == 345);
}
[Test]
[Category("DSDefinedClass_Ported")]
public void SimpleMethodOverload2()
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:8,代码来源:MethodResolution.cs
示例20:
ExecutionMirror mirror = thisTest.RunScriptSource(code);
thisTest.Verify("f0", false);
thisTest.Verify("f1", false);
thisTest.Verify("f2", false);
thisTest.Verify("f3", false);
thisTest.Verify("t0", true);
thisTest.Verify("t1", true);
thisTest.Verify("t2", true);
开发者ID:lewshion,项目名称:Dynamo,代码行数:8,代码来源:FromOldTestSuite.cs
注:本文中的ProtoScript.Runners.ProtoScriptRunner类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论