From: uz Date: Tue, 19 Aug 2008 21:26:23 +0000 (+0000) Subject: Added C like /* */ comments. X-Git-Tag: V2.13.0rc1~367 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9f7fc6f4c899fa6051d74e8304ae82842921ac6d;p=cc65 Added C like /* */ comments. git-svn-id: svn://svn.cc65.org/cc65/trunk@3888 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/scanner.c b/src/ca65/scanner.c index 891971c95..51cc998bc 100644 --- a/src/ca65/scanner.c +++ b/src/ca65/scanner.c @@ -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 '*':