summaryrefslogtreecommitdiff
path: root/src/cli/runtime/LineNumberingTextReader.cs
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2007-09-22 22:32:46 +0000
committerRich Hickey <richhickey@gmail.com>2007-09-22 22:32:46 +0000
commitb6db84aea2db2ddebcef58918971258464cbf46f (patch)
treea02f6e2d758da84f1358c2e647464ff563a7f00c /src/cli/runtime/LineNumberingTextReader.cs
parent07060b8e569c6fd9073da42bcb80f3ab26251195 (diff)
refactoring dumping unused classes
Diffstat (limited to 'src/cli/runtime/LineNumberingTextReader.cs')
-rw-r--r--src/cli/runtime/LineNumberingTextReader.cs75
1 files changed, 0 insertions, 75 deletions
diff --git a/src/cli/runtime/LineNumberingTextReader.cs b/src/cli/runtime/LineNumberingTextReader.cs
deleted file mode 100644
index 71f05e8d..00000000
--- a/src/cli/runtime/LineNumberingTextReader.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Copyright (c) Rich Hickey. All rights reserved.
- * The use and distribution terms for this software are covered by the
- * Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
- * which can be found in the file CPL.TXT at the root of this distribution.
- * By using this software in any fashion, you are agreeing to be bound by
- * the terms of this license.
- * You must not remove this notice, or any other, from this software.
- **/
-
-using System;
-using System.IO;
-
-namespace clojure.lang
- {
-
-
-public class LineNumberingTextReader : TextReader, IDisposable
- {
- TextReader impl;
- int line = 0;
- int unreadChar;
- bool haveUnread = false;
-
- public LineNumberingTextReader(TextReader r){
- this.impl = r;
- }
-
- public int getLineNumber(){
- return line;
- }
-
- override public int Read(){
- int ret;
- if(haveUnread)
- {
- ret = unreadChar;
- haveUnread = false;
- }
- else
- ret = impl.Read();
- if(ret == '\n')
- ++line;
- return ret;
- }
-
- public void unread(int ch){
- if(haveUnread)
- throw new InvalidOperationException("Can't unread more than once in a row");
- unreadChar = ch;
- haveUnread = true;
- if (ch == '\n')
- --line;
- }
-
- override public int Peek(){
- return impl.Peek();
- }
-
- public override void Close()
- {
- base.Close();
- impl.Close();
- }
-
- void IDisposable.Dispose()
- {
- base.Dispose();
- impl.Dispose();
- }
-
- }
-
-
- }