Ejemplo n.º 1
0
 void Emit(LS1Type t, LS1TypeIndex ti)
 {
     if (ti.Forms != null && ti.Forms.Count > 0)
     {
         EmitLine("### Indexers");
         foreach (LS1TypeIndexForm tif in ti.Forms)
         {
             Emit(t, tif);
         }
     }
 }
Ejemplo n.º 2
0
        void Emit(LS1Type t, LS1TypeMember tm, LS1TypeMemberForm form)
        {
            string useDescription = string.Empty;

            if (!string.IsNullOrEmpty(form.Description))
            {
                useDescription = ": " + form.Description;
            }

            string useType = "???";

            if (!string.IsNullOrEmpty(form.Type))
            {
                useType = string.Format("[{0}](#type-{0})", form.Type);
            }

            if (form.Parameters == null || form.Parameters.Count == 0)
            {
                EmitLine(string.Format("- {2} `{1}`{3}", t.Name, tm.Name, useType, useDescription));
            }
            else
            {
                string parameters = string.Empty;

                foreach (LS1Parameter p in form.Parameters)
                {
                    if (parameters.Length > 0)
                    {
                        parameters += " `,` ";
                    }
                    parameters += EmitDeclaration(p, " `,` ", false);
                }

                EmitLine(string.Format("- {2} `{1}[` {3} `]`{4}", t.Name, tm.Name, useType, parameters, useDescription));
            }

            if (tm.Restricted)
            {
                EmitLine("  - Restricted: Yes");
            }
#if MINIMUM_BUILD
            if (form.MinimumBuild > 0)
            {
                EmitLine(string.Format("  - Minimum Build: {0}", form.MinimumBuild));
            }
#endif
        }
Ejemplo n.º 3
0
        void Emit(LS1Type t, LS1TypeAsString tas)
        {
            if (!string.IsNullOrEmpty(tas.Constant))
            {
                EmitLine(string.Format("As Text: \"{0}\"", tas.Constant));
                return;
            }

            if (!string.IsNullOrEmpty(tas.Member))
            {
                EmitLine(string.Format("As Text: Same as `{0}`", tas.Member));
            }

            if (!string.IsNullOrEmpty(tas.Description))
            {
                EmitLine(string.Format("As Text: {0}", tas.Description));
            }
        }
Ejemplo n.º 4
0
        void Emit(LS1Type t, LS1TypeMethod tm)
        {
            if (HideRestricted && tm.Restricted)
            {
                return;
            }

            if (tm.Forms != null && tm.Forms.Count > 0)
            {
                foreach (LS1TypeMethodForm tif in tm.Forms)
                {
                    Emit(t, tm, tif);
                }
            }
            else
            {
                EmitLine(string.Format("- `{1}[`???`]`", t.Name, tm.Name));
                if (tm.Restricted)
                {
                    EmitLine("  - Restricted: Yes");
                }
            }
        }
Ejemplo n.º 5
0
        void Emit(LS1Type t, LS1TypeInitializerForm form)
        {
            string useDescription = string.Empty;

            if (!string.IsNullOrEmpty(form.Description))
            {
                useDescription = ": " + form.Description;
            }

            if (form.Parameters == null || form.Parameters.Count == 0)
            {
                EmitLine(string.Format("`{0}`{1}", t.Name, useDescription));
            }
            else
            {
                string parameters = string.Empty;

                foreach (LS1Parameter p in form.Parameters)
                {
                    if (parameters.Length > 0)
                    {
                        parameters += " `,` ";
                    }
                    parameters += EmitDeclaration(p, " `,` ", false);
                }

                EmitLine(string.Format("- `{0}[` {1} `]`{2}", t.Name, parameters, useDescription));
            }

#if MINIMUM_BUILD
            if (form.MinimumBuild > 0)
            {
                EmitLine(string.Format("  - Minimum Build: {0}", form.MinimumBuild));
            }
#endif
        }
Ejemplo n.º 6
0
        void Emit(LS1Type t)
        {
            if (HideRestricted && t.Restricted)
            {
                return;
            }

            EmitLine(string.Format("## Type: {0}", t.Name));

            if (!string.IsNullOrEmpty(t.BaseType))
            {
                EmitLine(string.Format("- Base Type: [{0}](#type-{0})", t.BaseType));
            }

            if (!t.Persistent)
            {
                EmitLine("- Persistent: No ([weakref](#type-weakref) not supported)");
            }

            if (t.Restricted)
            {
                EmitLine("- Restricted: Yes");
            }

#if MINIMUM_BUILD
            if (t.MinimumBuild > 0)
            {
                EmitLine(string.Format("- Minimum Build: {0}", t.MinimumBuild));
            }
#endif

            if (!string.IsNullOrEmpty(t.Description))
            {
                EmitLine(string.Format("{0}", t.Description));
            }

            EmitLine("");

            if (t.Initializer != null)
            {
                Emit(t, t.Initializer);
                EmitLine("");
            }

            if (t.Index != null)
            {
                Emit(t, t.Index);
                EmitLine("");
            }

            if (t.AsString != null)
            {
                Emit(t, t.AsString);
                EmitLine("");
            }

            EmitLine("### Members");
            if (t.Members != null && t.Members.Count > 0)
            {
                foreach (var tm in t.Members)
                {
                    Emit(t, tm);
                }
                EmitLine("");
            }
            else
            {
                EmitLine("none.");
            }

            EmitLine("### Methods");
            if (t.Methods != null && t.Methods.Count > 0)
            {
                foreach (var tm in t.Methods)
                {
                    Emit(t, tm);
                }
                EmitLine("");
            }
            else
            {
                EmitLine("none.");
            }

            EmitLine("");
            EmitLine("");
        }