Beispiel #1
0
 protected bool Equals(TryNode other)
 {
     return(Equals(Code, other.Code) &&
            CatchClauses.SequenceEqual(other.CatchClauses) &&
            Equals(Finally, other.Finally));
 }
Beispiel #2
0
        /// <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;
        }
Beispiel #3
0
 protected bool Equals(TryNode other)
 {
     return Equals(Code, other.Code)
            && CatchClauses.SequenceEqual(other.CatchClauses)
            && Equals(Finally, other.Finally);
 }