Esempio n. 1
0
 private StatementNode FindContinueDest()
 {
     for (CommonTree t = this; t != null; t = t.Parent as CommonTree)
     {
         if (t is TopStatementList)
         {
             return(null);
         }
         StatementNode dest = t as StatementNode;
         if ((dest != null) && (((this.lbl == null) && dest.AllowContinue) || dest.HasLabel(this.lbl)))
         {
             return(dest);
         }
     }
     return(null);
 }
Esempio n. 2
0
 internal void AddLabel(string p)
 {
     for (ITree t = this; t != null; t = t.Parent)
     {
         StatementNode l = t as StatementNode;
         if ((l != null) && l.HasLabel(p))
         {
             throw new JSRuntimeException("SyntaxError", "duplicate label");
         }
     }
     if (this.Labels == null)
     {
         this.Labels = new HashSet <string>();
     }
     this.Labels.Add(p);
 }