Пример #1
0
        /// <summary>
        /// Append a runnable's info to the assembly output
        /// </summary>
        /// <param name="Item"></param>
        /// <param name="Compiled"></param>
        internal void OutItem(Runnable Item, Block Compiled)
        {
            Item.Annotation.CompiledPosition.Begin = Output.Length;

            var d = Item.GetDescription();

            AppendSyntax(new string(' ', (_OutIdent + 1) * 4) + d.Name, Parse.SyntaxType.eType.Name);
            if (d.Parameters != null)
            {
                for (int i = 0; i < d.Parameters.Length; i++)
                {
                    var it = d.Parameters[i];
                    if (i == 0)
                    {
                        Output.Append(" ");
                    }
                    else
                    {
                        Output.Append(", ");
                    }
                    if (it.Name != null)
                    {
                        AppendSyntax(it.Name + ":", Parse.SyntaxType.eType.ArgName);
                    }
                    if (it.Value != null)
                    {
                        AppendSyntax(it.Value, Parse.SyntaxType.eType.ArgValue);
                    }
                }
            }
            Output.Append("\r");

            Item.Annotation.CompiledPosition.End = Output.Length;
            Item.Annotation.FirstRunnable        = Item;
            Item.Annotation.RunnablesCount       = 1;
            Item.Annotation.RunnableParentBlock  = Compiled.ExecuteBlock;
            IDE.CompiledAnnotations.Add(Item.Annotation.CompiledPosition, Item.Annotation);
        }
        /// <summary>
        /// Append a runnable's info to the assembly output
        /// </summary>
        /// <param name="Item"></param>
        /// <param name="Compiled"></param>
        internal void OutItem(Runnable Item, Block Compiled)
        {
            Item.Annotation.CompiledPosition.Begin = Output.Length;

            var d = Item.GetDescription();
            AppendSyntax(new string(' ', (_OutIdent + 1) * 4) + d.Name, Parse.SyntaxType.eType.Name);
            if (d.Parameters != null)
                for (int i = 0 ; i < d.Parameters.Length ; i++)
                {
                    var it = d.Parameters[i];
                    if (i == 0)
                        Output.Append(" ");
                    else
                        Output.Append(", ");
                    if (it.Name != null)
                        AppendSyntax(it.Name + ":", Parse.SyntaxType.eType.ArgName);
                    if (it.Value != null)
                        AppendSyntax(it.Value, Parse.SyntaxType.eType.ArgValue);
                }
            Output.Append("\r");

            Item.Annotation.CompiledPosition.End = Output.Length;
            Item.Annotation.FirstRunnable = Item;
            Item.Annotation.RunnablesCount = 1;
            Item.Annotation.RunnableParentBlock = Compiled.ExecuteBlock;
            IDE.CompiledAnnotations.Add(Item.Annotation.CompiledPosition, Item.Annotation);
        }