From f946b10fbd72dd760f04ad9475f2ba3ccb56666f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 19 Feb 2010 17:44:44 -0800 Subject: Simplify null_statement construction It only needs a token*, so build that into the constructor. --- parse.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'parse.cxx') diff --git a/parse.cxx b/parse.cxx index f99a440b..79784490 100644 --- a/parse.cxx +++ b/parse.cxx @@ -1289,11 +1289,7 @@ parser::parse_statement () statement *ret; const token* t = peek (); if (t && t->type == tok_operator && t->content == ";") - { - null_statement* n = new null_statement (); - n->tok = next (); - return n; - } + return new null_statement (next ()); else if (t && t->type == tok_operator && t->content == "{") return parse_stmt_block (); // Don't squash semicolons. else if (t && t->type == tok_keyword && t->content == "if") -- cgit