コード例 #1
0
ファイル: CodeGen.cs プロジェクト: korolkiewiczk/Lua2Cs
 public void OpenScope()
 {
     _sb.AppendLine("{");
     _sb.Ident++;
     if (Env.Instance.isCurrentFuncCtor)
     {
         _sb.AppendLineNoIdentA(Constants.Dependencies);
         _sb.AppendLineNoIdentA(Constants.InitCode);
         Env.Instance.isCurrentFuncCtor = false;
     }
 }
コード例 #2
0
        public TypeGen(StringBuilderWithIdent sb)
        {
            _sb = sb;
            _sb.AppendLineA($"public class {Constants.ClassName} : LuaObject");
            _sb.AppendLineA("{");
            _sb.Ident++;
            _sb.AppendLineNoIdentA(Constants.Fields);
            _sb.AppendLineNoIdentA(Constants.FieldsInit);
            _sb.AppendLineNoIdentA(Constants.ImplicitCtor);

            _fields     = new HashSet <string>();
            _fieldsInit = new Dictionary <string, Operand>();
        }