From 0c0a281896d77df4b10b357c84590b41dbb5bebd Mon Sep 17 00:00:00 2001 From: paulmcq Date: Mon, 10 Jan 2011 05:29:49 +0000 Subject: [PATCH] #2506253: allow C++ // comments --- re2c/scanner.re | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/re2c/scanner.re b/re2c/scanner.re index b777fb52..87755cd1 100644 --- a/re2c/scanner.re +++ b/re2c/scanner.re @@ -258,6 +258,9 @@ scan: goto code; } + "//" { + goto nextLine; + } "/*" { depth = 1; goto comment; @@ -561,6 +564,22 @@ comment: } */ +nextLine: +/*!re2c /* resync emacs */ + "\n" { if(cursor == eof) { + RETURN(0); + } + tok = pos = cursor; + cline++; + goto scan; + } + any { if(cursor == eof) { + RETURN(0); + } + goto nextLine; + } +*/ + config: /*!re2c space+ { -- 2.40.0