]> git.sur5r.net Git - cc65/commitdiff
Added C like /* */ comments.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 19 Aug 2008 21:26:23 +0000 (21:26 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 19 Aug 2008 21:26:23 +0000 (21:26 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3888 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/scanner.c

index 891971c95a92323b03f289c51ded7af1f3c03797..51cc998bc32d362598ee7c66befdc3d2871b073b 100644 (file)
@@ -1061,7 +1061,25 @@ CharAgain:
 
        case '/':
            NextChar ();
-           Tok = TOK_DIV;
+            if (C != '*') {
+                Tok = TOK_DIV;
+            } else {
+                /* Remember the position, then skip the '*' */
+                FilePos Pos = CurPos;
+                NextChar ();
+                do {
+                    while (C !=  '*') {
+                        if (C == EOF) {
+                            PError (&Pos, "Unterminated comment");
+                            goto Again;
+                        }
+                        NextChar ();
+                    }
+                    NextChar ();
+                } while (C != '/');
+                NextChar ();
+                goto Again;  
+            }
            return;
 
        case '*':