[armedbear-cvs] r12591 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sat Apr 10 19:16:00 UTC 2010


Author: ehuelsmann
Date: Sat Apr 10 15:15:59 2010
New Revision: 12591

Log:
Removal of copy/paste code between FaslReader and LispReader.

Modified:
   trunk/abcl/src/org/armedbear/lisp/FaslReader.java
   trunk/abcl/src/org/armedbear/lisp/FaslReadtable.java

Modified: trunk/abcl/src/org/armedbear/lisp/FaslReader.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/FaslReader.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/FaslReader.java	Sat Apr 10 15:15:59 2010
@@ -37,32 +37,6 @@
 
 public final class FaslReader
 {
-    // ### fasl-read-comment
-    public static final ReaderMacroFunction FASL_READ_COMMENT =
-        new ReaderMacroFunction("fasl-read-comment", PACKAGE_SYS, false,
-                                "stream character")
-    {
-        @Override
-        public LispObject execute(Stream stream, char ignored)
-
-        {
-          try 
-            {
-              while (true) {
-                int n = stream._readChar();
-                if (n < 0)
-                  return null;
-                if (n == '\n')
-                  return null;
-              }
-            }
-          catch (java.io.IOException e)
-            {
-              return null;
-            }
-        }
-    };
-
     // ### fasl-read-string
     public static final ReaderMacroFunction FASL_READ_STRING =
         new ReaderMacroFunction("fasl-read-string", PACKAGE_SYS, false,
@@ -141,19 +115,6 @@
         }
     };
 
-    // ### fasl-read-right-paren
-    public static final ReaderMacroFunction FASL_READ_RIGHT_PAREN =
-        new ReaderMacroFunction("fasl-read-right-paren", PACKAGE_SYS, false,
-                                "stream character")
-    {
-        @Override
-        public LispObject execute(Stream stream, char ignored)
-
-        {
-            return error(new ReaderError("Unmatched right parenthesis.", stream));
-        }
-    };
-
     // ### fasl-read-quote
     public static final ReaderMacroFunction FASL_READ_QUOTE =
         new ReaderMacroFunction("fasl-read-quote", PACKAGE_SYS, false,
@@ -450,38 +411,4 @@
                                                LispThread.currentThread());
         }
     };
-
-    // ### fasl-sharp-vertical-bar
-    public static final DispatchMacroFunction FASL_SHARP_VERTICAL_BAR =
-        new DispatchMacroFunction("sharp-vertical-bar", PACKAGE_SYS, false,
-                                  "stream sub-char numarg")
-    {
-        @Override
-        public LispObject execute(Stream stream, char c, int n)
-
-        {
-            stream.skipBalancedComment();
-            return null;
-        }
-    };
-
-    // ### fasl-sharp-illegal
-    public static final DispatchMacroFunction FASL_SHARP_ILLEGAL =
-        new DispatchMacroFunction("fasl-sharp-illegal", PACKAGE_SYS, false,
-                                  "stream sub-char numarg")
-    {
-        @Override
-        public LispObject execute(Stream stream, char c, int n)
-
-        {
-            StringBuilder sb =
-                new StringBuilder("Illegal # macro character: #\\");
-            String s = LispCharacter.charToName(c);
-            if (s != null)
-                sb.append(s);
-            else
-                sb.append(c);
-            return error(new ReaderError(sb.toString(), stream));
-        }
-    };
 }

Modified: trunk/abcl/src/org/armedbear/lisp/FaslReadtable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/FaslReadtable.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/FaslReadtable.java	Sat Apr 10 15:15:59 2010
@@ -64,10 +64,10 @@
         syntax['|']  = SYNTAX_TYPE_MULTIPLE_ESCAPE;
 
         LispObject[] readerMacroFunctions = this.readerMacroFunctions.constants;
-        readerMacroFunctions[';']  = FaslReader.FASL_READ_COMMENT;
+        readerMacroFunctions[';']  = LispReader.READ_COMMENT;
         readerMacroFunctions['"']  = FaslReader.FASL_READ_STRING;
         readerMacroFunctions['(']  = FaslReader.FASL_READ_LIST;
-        readerMacroFunctions[')']  = FaslReader.FASL_READ_RIGHT_PAREN;
+        readerMacroFunctions[')']  = LispReader.READ_RIGHT_PAREN;
         readerMacroFunctions['\''] = FaslReader.FASL_READ_QUOTE;
         readerMacroFunctions['#']  = FaslReader.FASL_READ_DISPATCH_CHAR;
 
@@ -91,15 +91,15 @@
         dtfunctions['X']  = FaslReader.FASL_SHARP_X;
         dtfunctions['\''] = FaslReader.FASL_SHARP_QUOTE;
         dtfunctions['\\'] = FaslReader.FASL_SHARP_BACKSLASH;
-        dtfunctions['|']  = FaslReader.FASL_SHARP_VERTICAL_BAR;
-        dtfunctions[')']  = FaslReader.FASL_SHARP_ILLEGAL;
-        dtfunctions['<']  = FaslReader.FASL_SHARP_ILLEGAL;
-        dtfunctions[' ']  = FaslReader.FASL_SHARP_ILLEGAL;
-        dtfunctions[8]    = FaslReader.FASL_SHARP_ILLEGAL; // backspace
-        dtfunctions[9]    = FaslReader.FASL_SHARP_ILLEGAL; // tab
-        dtfunctions[10]   = FaslReader.FASL_SHARP_ILLEGAL; // newline, linefeed
-        dtfunctions[12]   = FaslReader.FASL_SHARP_ILLEGAL; // page
-        dtfunctions[13]   = FaslReader.FASL_SHARP_ILLEGAL; // return
+        dtfunctions['|']  = LispReader.SHARP_VERTICAL_BAR;
+        dtfunctions[')']  = LispReader.SHARP_ILLEGAL;
+        dtfunctions['<']  = LispReader.SHARP_ILLEGAL;
+        dtfunctions[' ']  = LispReader.SHARP_ILLEGAL;
+        dtfunctions[8]    = LispReader.SHARP_ILLEGAL; // backspace
+        dtfunctions[9]    = LispReader.SHARP_ILLEGAL; // tab
+        dtfunctions[10]   = LispReader.SHARP_ILLEGAL; // newline, linefeed
+        dtfunctions[12]   = LispReader.SHARP_ILLEGAL; // page
+        dtfunctions[13]   = LispReader.SHARP_ILLEGAL; // return
         dispatchTables.constants['#'] = dt;
 
         readtableCase = Keyword.UPCASE;




More information about the armedbear-cvs mailing list