private Stmt ExpressionStatement() { Stmt ret = null; Expr expr = Expression(); if (repl) { if (Check(TokenType.Semicolon)) { Consume(TokenType.Semicolon, "Expect ';' after value."); ret = new Stmt.Expression(expr); } else { ret = new Stmt.Print(expr); } } else { Consume(TokenType.Semicolon, "Expect ';' after value."); ret = new Stmt.Expression(expr); } return(ret); }
public void Visit(Stmt.Expression stmt) { Evaluate(stmt.expression); }
public void Visit(Stmt.Expression expression) { // do nothing }
public void Visit(Stmt.Expression stmt) { Resolve(stmt.expression); }