Skip to content

Commit

Permalink
Merge pull request #7 from lightszero/master
Browse files Browse the repository at this point in the history
Merge master code.
  • Loading branch information
GraphicGame committed Sep 15, 2014
2 parents 3da4718 + 7c2729c commit 3324421
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ IList<ICLS_Type> _FileCompiler(string filename, IList<Token> tokens, bool embDeu
}
}
int iend = FindBlock(env, tokens, ibegin);
if(iend==-1)
{
env.logger.Log_Error("查找文件尾失败。");
return null;
}
if (bJumpClass)
{
env.logger.Log("(NotScript)findclass:" + name + "(" + ibegin + "," + iend + ")");
Expand Down Expand Up @@ -301,7 +306,10 @@ ICLS_Type Compiler_Class(ICLS_Environment env, string classname, bool bInterface
{
int funcend = FindBlock(env, tokens, funcbegin);
this.Compiler_Expression_Block(tokens, env, funcbegin, funcend, out func.expr_runtime);

if(func.expr_runtime==null)
{
logger.Log_Warn("警告,该函数编译为null,请检查");
}
(stype.function as SType).functions.Add(idname, func);

i = funcend;
Expand Down
80 changes: 19 additions & 61 deletions CSLightStudio/windows/CSEvilTestor/script/test07/Test07.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,32 @@

class Test07
{
public static void Run()
public void Run()
{
StateManager.Method1("eventName","eventName2","eventName3");

StateManager.Instance.DoMethod1("eventName","eventName2","eventName3");

try
{


throw new NotImplementedException("E2");
}
catch (NotSupportedException err)
{
Debug.Log("not here.");
}
catch (NotImplementedException err)
{
Debug.Log("Got.");
}
catch (Exception err)
{
Debug.Log("Got 2.");
}
Debug.Log("===-----------===");
Fun1();
}
//static C5 c5 = null;
}

/// <summary>
/// 状态中心
/// </summary>
public class StateManager
{
public static StateManager Instance
public void Fun1()
{
get
{
if (g_this == null)
g_this = new StateManager();
return g_this;

}
Debug.Log("Fun1 in");
Fun2();
Debug.Log("Fun1 out");
}

public static StateManager g_this;

public StateMgr mgr
int _pix = int.MinValue;
int _piy = int.MinValue;
public void Fun2()
{
get;
private set;
}

public void OnInit(StateMgr _mgr)
{
Debug.Log("StateManager Init");

this.mgr = _mgr;

StateManager inst = StateManager.Instance;
}

public static void Method1(string eventName,string scriptTypeName, string method)
{
Debug.Log("Method1");
}

public void DoMethod1(string eventName, string scriptTypeName, string method)
{
Debug.Log("DoMethod1");
Debug.Log("Fun3 in"); // !!!!!!!!!!!!!!没有了
int pix = 0;
int piy = 0;
if (pix == _pix && piy == _piy)
{
return;
}
Debug.Log("Fun3");
}
}
}
3 changes: 2 additions & 1 deletion CSLightStudio/windows/CSEvilTestor/script/test07/test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
//这个测试测试try catch throw
Test07.Run();
Test07 t = new Test07();
t.Run();

0 comments on commit 3324421

Please sign in to comment.