Ejemplo n.º 1
0
        public void AppendJSStmt(StringBuilder buf, string chain, bool expandIds)
        {
            if (ConditionVar != null)
            {
                ConditionVar.AppendJSStmt(buf, chain, true);
            }
            Helper.PrintIndented(string.Empty, buf);
            for (int i = 0; i < Sections.Count; i++)
            {
                if (i > 0)
                {
                    buf.Append(" else ");
                }
                if (!(Sections[i].Condition is Else))
                {
                    buf.Append("if (");
                    buf.Append(Sections[i].Condition.ToJSExpr(true));
                    buf.Append(") ");
                }
                buf.AppendLine("{");

                Status.Variables.IncrementDepth();
                Status.Indent++;
                foreach (var st in Sections[i].Statements)
                {
                    st.AppendJSStmt(buf, "", true);
                }
                Status.Indent--;
                Status.Variables.DecrementDepth();

                Helper.PrintIndented("}", buf);
            }
            buf.AppendLine();
        }
Ejemplo n.º 2
0
 public void AppendPrint(int indent, StringBuilder buf)
 {
     Helper.PrintASTIndentLine("if", indent, buf);
     if (ConditionVar != null)
     {
         Helper.PrintASTIndentLine("condition var", indent + 1, buf);
         ConditionVar.AppendPrint(indent + 2, buf);
     }
     foreach (var s in Sections)
     {
         s.AppendPrint(indent + 1, buf);
     }
 }