shithub: scc

Download patch

ref: 96b6cc1d8be1ad93af98b570e699ff202378cb4b
parent: 9750a1e13aca0b42f79a5254bfe45e1263d2a053
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Sep 3 08:13:23 EDT 2014

Remove printing in external environment

It is better to do this job in functions because it allows us
to can declare local variables and avoid conflict about names.

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -544,11 +544,6 @@
 	case ';':
 		expect(';');
 		return;
-	case '@':
-		next();
-		emitprint(expr());
-		expect(';');
-		return;
 	default:
 		unexpected();
 	}
--- a/cc1/stmt.c
+++ b/cc1/stmt.c
@@ -338,6 +338,11 @@
 	case TYPEIDEN: case IDEN:
 		fun = (ahead() == ':') ? Label : stmtexp;
 		break;
+	case '@':
+		next();
+		emitprint(expr());
+		break;
+		next();
 	}
 	(*fun)(lbreak, lcont, lswitch);
 }