Beispiel #1
0
 //assert_stmt: 'assert' expression [',' expression]
 private AssertStatement ParseAssertStmt() {
     Eat(TokenKind.KeywordAssert);
     var start = GetStart();
     Expression expr = ParseExpression();
     Expression message = null;
     if (MaybeEat(TokenKind.Comma)) {
         message = ParseExpression();
     }
     AssertStatement ret = new AssertStatement(expr, message);
     ret.SetLoc(_globalParent, start, GetEnd());
     return ret;
 }
Beispiel #2
0
 public override bool Walk(AssertStatement node)
 {
     node.Parent = _currentScope;
     return base.Walk(node);
 }
Beispiel #3
0
 internal Assert(AssertStatement stmt)
     : this() {
     _test = Convert(stmt.Test);
     if (stmt.Message != null)
         _msg = Convert(stmt.Message);
 }
Beispiel #4
0
 public override bool Walk(AssertStatement node)
 {
     CommonWalk(node);
     return true;
 }
Beispiel #5
0
 public override void PostWalk(AssertStatement node)
 {
     CommonPostWalk(node);
 }
 public void PostWalk(AssertStatement node)
 {
     PostProcess(node);
 }
 // AssertStatement
 public bool Walk(AssertStatement node)
 {
     return Process(node);
 }
 public override bool Walk(AssertStatement node)
 {
     Emit(node); return false;
 }
 // AssertStatement
 public override bool Walk(AssertStatement node)
 {
     node.Parent = _currentScope;
     return(base.Walk(node));
 }
 public virtual void PostWalk(AssertStatement node)
 {
 }
 // AssertStatement
 public virtual bool Walk(AssertStatement node)
 {
     return true;
 }
Beispiel #12
0
 //assert_stmt: 'assert' test [',' test]
 private AssertStatement ParseAssertStmt()
 {
     Eat(TokenKind.KeywordAssert);
     Location start = GetStart();
     Expression test = ParseTest();
     Expression message = null;
     if (MaybeEat(TokenKind.Comma)) {
         message = ParseTest();
     }
     AssertStatement ret = new AssertStatement(test, message);
     ret.SetLoc(GetExternal(), start, GetEnd());
     return ret;
 }
 public void Visit(PyAst.AssertStatement node) => throw CreateNotImplementedEx();
Beispiel #14
0
		public override bool Walk(AssertStatement node)
		{
			writer.WriteLine("Assert");
			return base.Walk(node);
		}