From 9f7fc6f4c899fa6051d74e8304ae82842921ac6d Mon Sep 17 00:00:00 2001 From: uz Date: Tue, 19 Aug 2008 21:26:23 +0000 Subject: [PATCH] Added C like /* */ comments. git-svn-id: svn://svn.cc65.org/cc65/trunk@3888 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/scanner.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 '*': -- 2.39.5