Exemplo n.º 1
0
        // Delete once migrated to PastelContext
        internal string GetFunctionDeclarationsTEMP(Transpilers.TranspilerContext ctx, string indent)
        {
            foreach (FunctionDefinition fd in this.GetFunctionDefinitions())
            {
                ctx.Transpiler.GenerateCodeForFunctionDeclaration(ctx, fd, true);
                ctx.Append(ctx.Transpiler.NewLine);
            }

            return(Indent(ctx.FlushAndClearBuffer().Trim(), ctx.Transpiler.NewLine, indent));
        }
Exemplo n.º 2
0
        // Delete once migrated to PastelContext
        internal Dictionary <string, string> GetStructCodeByClassTEMP(Transpilers.TranspilerContext ctx, string indent)
        {
            Dictionary <string, string> output = new Dictionary <string, string>();

            foreach (StructDefinition sd in this.GetStructDefinitions())
            {
                string name = sd.NameToken.Value;
                ctx.Transpiler.GenerateCodeForStruct(ctx, sd);
                output[name] = ctx.FlushAndClearBuffer();
            }
            return(output);
        }
Exemplo n.º 3
0
        internal Dictionary <string, string> GetFunctionCodeAsLookupTEMP(Transpilers.TranspilerContext ctx, string indent)
        {
            Dictionary <string, string> output = new Dictionary <string, string>();

            foreach (FunctionDefinition fd in this.GetFunctionDefinitions())
            {
                ctx.Transpiler.GenerateCodeForFunction(ctx, fd, true);
                output[fd.NameToken.Value] = Indent(ctx.FlushAndClearBuffer().Trim(), ctx.Transpiler.NewLine, indent);
            }

            return(output);
        }
Exemplo n.º 4
0
        // Delete once migrated to PastelContext
        internal string GetFunctionCodeTEMP(Transpilers.TranspilerContext ctx, string indent)
        {
            foreach (FunctionDefinition fd in this.GetFunctionDefinitions())
            {
                if (!alreadySerializedFunctions.Contains(fd))
                {
                    this.Transpiler.GenerateCodeForFunction(ctx, fd);
                    ctx.Append(this.Transpiler.NewLine);
                }
            }

            return(Indent(ctx.FlushAndClearBuffer().Trim(), this.Transpiler.NewLine, indent));
        }
Exemplo n.º 5
0
        internal string GetFunctionCodeForSpecificFunctionAndPopItFromFutureSerializationTEMP(
            string name,
            string swapOutWithNewNameOrNull,
            Transpilers.TranspilerContext ctx,
            string indent)
        {
            FunctionDefinition fd = this.GetFunctionDefinitions().Where(f => f.NameToken.Value == name).FirstOrDefault();

            if (fd == null || this.alreadySerializedFunctions.Contains(fd))
            {
                return(null);
            }

            this.alreadySerializedFunctions.Add(fd);

            if (swapOutWithNewNameOrNull != null)
            {
                fd.NameToken = Token.CreateDummyToken(swapOutWithNewNameOrNull);
            }

            this.Transpiler.GenerateCodeForFunction(ctx, fd);
            return(Indent(ctx.FlushAndClearBuffer().Trim(), this.Transpiler.NewLine, indent));
        }
Exemplo n.º 6
0
 internal string GetGlobalsCodeTEMP(Transpilers.TranspilerContext ctx, string indent)
 {
     this.Transpiler.GenerateCodeForGlobalsDefinitions(ctx, this.GetGlobalsDefinitions());
     return(Indent(ctx.FlushAndClearBuffer().Trim(), this.Transpiler.NewLine, indent));
 }