예제 #1
0
파일: TryNode.cs 프로젝트: vplemyannik/lens
 protected bool Equals(TryNode other)
 {
     return(Equals(Code, other.Code) &&
            CatchClauses.SequenceEqual(other.CatchClauses) &&
            Equals(Finally, other.Finally));
 }
예제 #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;
        }
예제 #3
0
파일: TryNode.cs 프로젝트: TrickyCat/lens
 protected bool Equals(TryNode other)
 {
     return Equals(Code, other.Code)
            && CatchClauses.SequenceEqual(other.CatchClauses)
            && Equals(Finally, other.Finally);
 }