protected bool Equals(TryNode other) { return(Equals(Code, other.Code) && CatchClauses.SequenceEqual(other.CatchClauses) && Equals(Finally, other.Finally)); }
/// <summary> /// try_stmt = "try" block catch_stmt_list [ finally_stmt ] /// </summary> private TryNode parseTryStmt() { if (!check(LexemType.Try)) return null; var node = new TryNode(); node.Code = ensure(parseBlock, ParserMessages.TryBlockExpected); node.CatchClauses = parseCatchStmtList().ToList(); node.Finally = attempt(parseFinallyStmt); if (node.Finally == null && node.CatchClauses.Count == 0) error(ParserMessages.CatchExpected); return node; }
protected bool Equals(TryNode other) { return Equals(Code, other.Code) && CatchClauses.SequenceEqual(other.CatchClauses) && Equals(Finally, other.Finally); }