diff --git a/.cursor/rules/core.mdc b/.cursor/rules/core.mdc index e337eb0..dde7f8b 100644 --- a/.cursor/rules/core.mdc +++ b/.cursor/rules/core.mdc @@ -1,5 +1,5 @@ --- -alwaysApply: false +alwaysApply: true --- ## RIPER-5 + O1 思维 + 代理执行协议 diff --git a/Convention/[FLEE] b/Convention/[FLEE] index 47b12f4..5c561fc 160000 --- a/Convention/[FLEE] +++ b/Convention/[FLEE] @@ -1 +1 @@ -Subproject commit 47b12f4bc0b0ff9ad9be0ba07268e7a497f4c330 +Subproject commit 5c561fc69c7bba8c5fead507a1244e1abca4943a diff --git a/Convention/[RScript] b/Convention/[RScript] index 971baf8..29dd4f5 160000 --- a/Convention/[RScript] +++ b/Convention/[RScript] @@ -1 +1 @@ -Subproject commit 971baf8c9eccebb9b9ecca79bd40707407827d51 +Subproject commit 29dd4f5d96898b1cbca59c6f0d178591ebb8baa9 diff --git a/[Test]/Program.cs b/[Test]/Program.cs index 74ea8ea..5709dd1 100644 --- a/[Test]/Program.cs +++ b/[Test]/Program.cs @@ -1,62 +1,39 @@ using Convention; using Convention.EasySave; using Convention.RScript; +using Convention.RScript.Variable; +using Convention.RScript.Variable.Attr; +using Convention.RScript.Variable.CStyle; using System; using System.IO; public class Program { - static class Test + [Description(@" +测试注释1 +测试注释二 +")] + [Default(@" +this.Log(1); +")] + public class Test { - public static object Func(object x) + [Method] + public void Log(object o) { - Console.WriteLine(x); - return x; + Console.WriteLine(o); } } static void Main(string[] args) { - RScriptEngine engine = new(); - RScriptImportClass import = new() - { - typeof(Math), - typeof(ExpressionMath), - typeof(Test) - }; - - - var result = engine.Compile(@" -int i= 2; -int count = 0; -label(test); -goto(true,func1); -Func(i); -goto(100>i,test); - -goto(context.ExistNamespace(""x""),end); -namespace(x) -{ - Func(""xxx""); -} - -namespace(func1) -{ - i = Pow(i,2); - count = count + 1; - Func(count); -} - -label(end); -", import); - var data = RScriptSerializer.SerializeClass(result); - var file = new ToolFile("F:\\test_after_run.dat"); - file.SaveAsBinary(data); - data = file.LoadAsBinary(); - engine.Run(RScriptSerializer.DeserializeClass(data), import); - return; - var data2 = RScriptSerializer.SerializeClass(engine.GetCompileResultFromCurrent()); - var file2 = new ToolFile("F:\\test_after_run.dat"); - file2.SaveAsBinary(data2); + var engine = new RScriptEngine(); + var testClass = new CScriptRScriptVariableGenerater(typeof(Test), () => new Test(), null, nameof(Test)); + testClass.Register(); + engine.Run(@" +var t = New(Test); +t.Log(114514); +"); + Console.WriteLine(testClass.scriptIndicator); } } \ No newline at end of file