public ICLS_Expression Compiler_Expression_Loop_Try(IList <Token> tlist, ICLS_Environment content, int pos, int posend) { CLS_Expression_LoopTry value = new CLS_Expression_LoopTry(pos, posend, tlist[pos].line, tlist[posend].line); int b1; int fs1 = pos + 1; int fe1 = FindCodeAny(tlist, ref fs1, out b1); if (b1 != 2) { return(null); } //try { ICLS_Expression subvalue; bool succ = Compiler_Expression_Block(tlist, content, fs1, fe1, out subvalue); if (succ) { value.tokenEnd = fe1; value.lineEnd = tlist[fe1].line; value.listParam.Add(subvalue); } else { return(null); } } while (fe1 < posend && tlist[fe1 + 1].text == "catch") { //catch(...) int b2; int fs2 = fe1 + 2; int fe2 = FindCodeAny(tlist, ref fs2, out b2); { if (b2 != 1) { return(null); } ICLS_Expression subvalue; bool succ = Compiler_Expression(tlist, content, fs2, fe2, out subvalue); if (succ) { value.tokenEnd = fe2; value.lineEnd = tlist[fe2].line; value.listParam.Add(subvalue); } else { return(null); } } //catch(){...} { int b3; int fs3 = fe2 + 1; int fe3 = FindCodeAny(tlist, ref fs3, out b3); if (b3 != 2) { return(null); } ICLS_Expression subvalue; bool succ = Compiler_Expression_Block(tlist, content, fs3, fe3, out subvalue); if (succ) { value.tokenEnd = fe3; value.lineEnd = tlist[fe3].line; value.listParam.Add(subvalue); } else { return(null); } fe1 = fe3; } } return(value); }
public ICLS_Expression Compiler_Expression_Loop_Try(IList<Token> tlist, ICLS_Environment content, int pos, int posend) { CLS_Expression_LoopTry value = new CLS_Expression_LoopTry(pos, posend, tlist[pos].line, tlist[posend].line); int b1; int fs1 = pos + 1; int fe1 = FindCodeAny(tlist, ref fs1, out b1); if (b1 != 2) { return null; } //try { ICLS_Expression subvalue; bool succ = Compiler_Expression_Block(tlist, content, fs1, fe1, out subvalue); if (succ) { value.tokenEnd = fe1; value.lineEnd = tlist[fe1].line; value.listParam.Add(subvalue); } else { return null; } } while (fe1 < posend && tlist[fe1 + 1].text == "catch") { //catch(...) int b2; int fs2 = fe1 + 2; int fe2 = FindCodeAny(tlist, ref fs2, out b2); { if (b2 != 1) { return null; } ICLS_Expression subvalue; bool succ = Compiler_Expression(tlist, content, fs2, fe2, out subvalue); if (succ) { value.tokenEnd = fe2; value.lineEnd = tlist[fe2].line; value.listParam.Add(subvalue); } else { return null; } } //catch(){...} { int b3; int fs3 = fe2 + 1; int fe3 = FindCodeAny(tlist, ref fs3, out b3); if (b3 != 2) { return null; } ICLS_Expression subvalue; bool succ = Compiler_Expression_Block(tlist, content, fs3, fe3, out subvalue); if (succ) { value.tokenEnd = fe3; value.lineEnd = tlist[fe3].line; value.listParam.Add(subvalue); } else { return null; } fe1 = fe3; } } return value; }