changeset 10:3ee65d6e39c9

- Parsing // comments now.
author aziz
date Sat, 23 Jun 2007 08:33:00 +0000
parents 5d6968cc751e
children dffcdaa7c47a
files trunk/src/Lexer.d trunk/src/main.d
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Lexer.d	Sat Jun 23 07:46:00 2007 +0000
+++ b/trunk/src/Lexer.d	Sat Jun 23 08:33:00 2007 +0000
@@ -86,7 +86,7 @@
   {
     assert(p < end);
 
-    char c = *p;
+    uint c = *p;
 
     while(1)
     {
@@ -149,6 +149,16 @@
           t.end = p;
           return;
         }
+        else if (c == '/')
+        {
+          do
+          {
+            c = *++p;
+          } while (c != '\n' && c != 0)
+          t.type = TOK.Comment;
+          t.end = p;
+          return;
+        }
       }
 
       if (c == '"')
--- a/trunk/src/main.d	Sat Jun 23 07:46:00 2007 +0000
+++ b/trunk/src/main.d	Sat Jun 23 08:33:00 2007 +0000
@@ -59,5 +59,5 @@
     }
     end = token.end;
   }
-  writef("</sourcetext>");
+  writef("\n</sourcetext>");
 }
\ No newline at end of file