Commit Diff


commit - 22b07b77baf34b009a952718517ce2a817476352
commit + 62cc366514f65a297aaa36acfbc5fe53d7f7abd7
blob - c8b2430f06ceeb2212e1e9ecb16b4eb05c668ecb
blob + 5d949468955f4dce591d95ab8dc84838b30bdcb6
--- cc/cc1/cc1.c
+++ cc/cc1/cc1.c
@@ -96,6 +96,30 @@ lex (void)
 	}
 }
 
+int peekd = TK_EOF;
+
+peek (void)
+{
+	if (peekd == TK_EOF)
+		peekd = lex ();
+
+	return peekd;
+}
+
+next (void)
+{
+	int tk;
+
+	if (peekd != TK_EOF) {
+		tk = peekd;
+		peekd = TK_EOF;
+	} else {
+		tk = lex ();
+	}
+
+	return tk;
+}
+
 main (void)
 {
 	return 0;