[svn] r7574: nemerle/trunk/ncc: parsing/Lexer.n passes.n

kliss svnadmin at nemerle.org
Mon Apr 2 20:59:03 CEST 2007


Log:
Minor changes in lexer.

Author: kliss
Date: Mon Apr  2 20:58:57 2007
New Revision: 7574

Modified:
   nemerle/trunk/ncc/parsing/Lexer.n
   nemerle/trunk/ncc/passes.n

Modified: nemerle/trunk/ncc/parsing/Lexer.n
==============================================================================
--- nemerle/trunk/ncc/parsing/Lexer.n	(original)
+++ nemerle/trunk/ncc/parsing/Lexer.n	Mon Apr  2 20:58:57 2007
@@ -66,6 +66,7 @@
   
   | Indent     { value : string; }
   | WhiteSpace { value : string; }
+  | NewLine    { value : string; }
 
   | RoundGroup { Child : Token; }     // ( ... )
   | BracesGroup { Child : Token; }    // { ... }
@@ -130,6 +131,8 @@
 
       | Using => "using import;"
       | WhiteSpace(name) => name
+      | NewLine => "\\r\\n";
+      
     }
   }
 
@@ -183,6 +186,8 @@
             "operator `" + ToString () + "'"
 
         | Indent (value) => $"indentation `$value'"
+        | WhiteSpace => ""
+        | NewLine(value) => $"newline char: '$value'";
         
         | BracesGroup => "`{...}' group"          
         | RoundGroup => "`(...)' group"
@@ -194,7 +199,6 @@
 
         | Namespace => "namespace scoping"
         | Using => "using declaration"
-        | WhiteSpace => ""
       }
     else
       ToString ()
@@ -447,6 +451,8 @@
 
   public IsKeyword (str : string) : bool
   {
+    when(Keywords == null)
+      throw InvalidOperationException("Keywords property of lexer is not initialized!");
     Keywords.Contains (str)
   }
 

Modified: nemerle/trunk/ncc/passes.n
==============================================================================
--- nemerle/trunk/ncc/passes.n	(original)
+++ nemerle/trunk/ncc/passes.n	Mon Apr  2 20:58:57 2007
@@ -246,7 +246,7 @@
         filename. It can be customized to do any other action, like treating
         given string as textual code and creating LexerString from it.
      */
-    public mutable LexingPipeline : string -> LexerFile;
+    public mutable LexingPipeline : string -> LexerBase;
 
     /** Pipeline for performing parsing of lexical tokens into parsetree.
  
@@ -255,7 +255,7 @@
       */
     public mutable ParsingPipeline : LexerBase -> list [TopDeclaration];
 
-    /** Pipline for adding namespaces and types hierarchy from parsed
+    /** Pipeline for adding namespaces and types hierarchy from parsed
         declarations.
 
         The list of declarations denotes the scope of one file, including



More information about the svn mailing list