public void OpenScope() { _sb.AppendLine("{"); _sb.Ident++; if (Env.Instance.isCurrentFuncCtor) { _sb.AppendLineNoIdentA(Constants.Dependencies); _sb.AppendLineNoIdentA(Constants.InitCode); Env.Instance.isCurrentFuncCtor = false; } }
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>(); }