aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/anarres/cpp/CppReader.java
diff options
context:
space:
mode:
authorShevek <[email protected]>2008-06-14 22:42:09 +0000
committerShevek <[email protected]>2008-06-14 22:42:09 +0000
commitaba944f23747fdf35e890020cdbbca722bbaaacf (patch)
treeba247d276402039f5c75d00312a40bf5581715a2 /src/java/org/anarres/cpp/CppReader.java
parent0e479d174065605b32892be1a7fc5f789ea2e255 (diff)
remove quadratic getName; close lexers; add debug flags
Diffstat (limited to 'src/java/org/anarres/cpp/CppReader.java')
-rw-r--r--src/java/org/anarres/cpp/CppReader.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/java/org/anarres/cpp/CppReader.java b/src/java/org/anarres/cpp/CppReader.java
index a429fd4..fbe3545 100644
--- a/src/java/org/anarres/cpp/CppReader.java
+++ b/src/java/org/anarres/cpp/CppReader.java
@@ -110,6 +110,10 @@ public class CppReader extends Reader {
return true;
}
catch (LexerException e) {
+ /* Never happens.
+ if (e.getCause() instanceof IOException)
+ throw (IOException)e.getCause();
+ */
IOException ie = new IOException(String.valueOf(e));
ie.initCause(e);
throw ie;
@@ -139,7 +143,10 @@ public class CppReader extends Reader {
public void close()
throws IOException {
- cpp = null;
+ if (cpp != null) {
+ cpp.close();
+ cpp = null;
+ }
token = null;
}