diff src/tokenizer.cpp @ 213:44ffef730bc4

cleanup tokenizer differences with other projects, update tld list
author Carl Byington <carl@five-ten-sg.com>
date Wed, 30 Apr 2008 13:11:32 -0700
parents 4db1457cd11a
children 82886d4dd71f
line wrap: on
line diff
--- a/src/tokenizer.cpp	Sat Mar 22 11:25:30 2008 -0700
+++ b/src/tokenizer.cpp	Wed Apr 30 13:11:32 2008 -0700
@@ -303,9 +303,9 @@
 	ifstream *is = streams.front();
 	char *fn = filenames.front();
 	streams.pop_front();
-	filenames.pop_front();
 	filenamess.erase(fn);
-	linenumbers.pop_front();
+	if (filenames.size() > 1)	filenames.pop_front();
+	if (linenumbers.size() > 1) linenumbers.pop_front();
 	is->close();
 	delete is;
 }
@@ -437,7 +437,7 @@
 
 			default: {
 				token_error();
-				token_error("unknown state %d %s \n", st, " ");
+				token_error("unknown state %d %s", st, " ");
 			} break;
 		}
 		if (st == s_init) break;
@@ -509,7 +509,7 @@
 
 void TOKEN::token_error(const char *want, const char *have) {
 	token_error();
-	token_error("expecting %s, found %s \n", want, have);
+	token_error("expecting %s, found %s", want, have);
 }
 
 
@@ -521,7 +521,7 @@
 		if (i != filenames.begin()) {
 			char *fn = (*i);
 			int   li = (*j);
-			token_error("\n    included from line %d in file %s -- ", li, fn);
+			token_error("    included from line %d in file %s -- ", li, fn);
 		}
 	}
 }