Beispiel #1
0
 internal Raise(RaiseStatement stmt)
     : this() {
     if (stmt.ExceptType != null)
         _type = Convert(stmt.ExceptType);
     if (stmt.Value != null)
         _inst = Convert(stmt.Value);
     if (stmt.Traceback != null)
         _tback = Convert(stmt.Traceback);
 }
Beispiel #2
0
        //raise_stmt: 'raise' [expression [',' expression [',' expression]]]
        private RaiseStatement ParseRaiseStmt() {
            Eat(TokenKind.KeywordRaise);
            var start = GetStart();
            Expression type = null, _value = null, traceback = null;

            if (!NeverTestToken(PeekToken())) {
                type = ParseExpression();
                if (MaybeEat(TokenKind.Comma)) {
                    _value = ParseExpression();
                    if (MaybeEat(TokenKind.Comma)) {
                        traceback = ParseExpression();
                    }
                }
            }
            RaiseStatement ret = new RaiseStatement(type, _value, traceback);
            ret.SetLoc(_globalParent, start, GetEnd());
            return ret;
        }
Beispiel #3
0
        // *** END GENERATED CODE ***

        #endregion

        public override bool Walk(RaiseStatement node)
        {
            node.Parent    = _currentScope;
            node.InFinally = _finallyCount[_finallyCount.Count - 1] != 0;
            return(base.Walk(node));
        }
Beispiel #4
0
 public override bool Walk(RaiseStatement node)
 {
     node.Parent = _currentScope;
     node.InFinally = _finallyCount[_finallyCount.Count - 1] != 0;
     return base.Walk(node);
 }
Beispiel #5
0
 public override bool Walk(RaiseStatement node)
 {
     CommonWalk(node);
     return true;
 }
Beispiel #6
0
 public override void PostWalk(RaiseStatement node)
 {
     CommonPostWalk(node);
 }
 public void PostWalk(RaiseStatement node)
 {
     PostProcess(node);
 }
 // RaiseStatement
 public bool Walk(RaiseStatement node)
 {
     return Process(node);
 }
Beispiel #9
0
 public static string Format(RaiseStatement node)
 {
     return("raise " + Format(node.ExceptType) + "(" + Format(node.Value) + ")");
 }
 public override bool Walk(RaiseStatement node)
 {
     Emit(node); return false;
 }
 public virtual void PostWalk(RaiseStatement node)
 {
 }
 // RaiseStatement
 public virtual bool Walk(RaiseStatement node)
 {
     return true;
 }
 //public void Visit(PyAst.PythonAst node)=> throw CreateNotImplementedEx();
 public void Visit(PyAst.RaiseStatement node)
 {
     AppendLineWithIndentation("raise" + (node.Value is null ? "" : " " + Visit(node.Value)));
 }