From 098bc86187295a77b08c1e5c061ed5788aaa73ae Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 31 Jan 2018 18:39:25 +0100 Subject: Bug 793052 - C#: Incorrect parsing of property definitions containing "//" symbols in one line with "} The handling of comment signs inside a string for property definitions has been corrected, by defining parsing rules for these cases so that not the default comment handler will be used (i.e. remove the part behind the comment sign). --- src/scanner.l | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/scanner.l b/src/scanner.l index fd1568b..90e710b 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -755,6 +755,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) %x CopyHereDocEnd %x RawString %x RawGString +%x CSString %x IDLAttribute %x IDLProp @@ -6235,8 +6236,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) "add" { if (curlyCount==0) current->spec |= Entry::Addable; } "remove" { if (curlyCount==0) current->spec |= Entry::Removable; } "raise" { if (curlyCount==0) current->spec |= Entry::Raisable; } -. {} +"\"" { BEGIN(CSString);} +"." {} \n { lineCount(); } +"\"" { BEGIN(CSAccessorDecl);} +"//" {} /* Otherwise the rule <*>"//" will kick in */ +"/*" {} /* Otherwise the rule <*>"/*" will kick in */ +\n { lineCount(); } +"." {} -- cgit v0.12