Skip to content

Commit

Permalink
issue #9845 C# parser reads "$" as "Interpolated string expression" w…
Browse files Browse the repository at this point in the history
…hich is not correct

- the verbatim string should also be handled inside round brackets
- in case of a "normal string" inside round brackets (i.e. without the `@`) the `$"` hasn't a special meaning either, states `CopyGString` and `SkipString` should not check on `$"`.
  • Loading branch information
albert-github committed Feb 10, 2023
1 parent 8887ee5 commit f8de97c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -3277,6 +3277,13 @@ NONLopt [^\n]*
*yyextra->pCopyRoundGString << yytext;
}
}
<GCopyRound>"@\"" {
if (!yyextra->insideCS) REJECT;
*yyextra->pCopyRoundGString << yytext;
yyextra->lastSkipVerbStringContext=YY_START;
yyextra->pSkipVerbString=yyextra->pCopyRoundGString;
BEGIN(SkipVerbString);
}
<GCopyRound>[^"'()\n\/,]+ {
*yyextra->pCopyRoundGString << yytext;
}
Expand Down Expand Up @@ -3904,7 +3911,7 @@ NONLopt [^\n]*
yyextra->current->program << yytext ;
}
/* Interpolated string C# */
<CopyGString,SkipString,SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,FindMembers,FindMemberName>$\" { if (!yyextra->insideCS) REJECT
<SkipCurly,ReadBody,ReadNSBody,ReadBodyIntf,FindMembers,FindMemberName>$\" { if (!yyextra->insideCS) REJECT
yyextra->current->program << yytext ;
yyextra->pSkipInterpString = &yyextra->current->program;
yyextra->lastSkipInterpStringContext=YY_START;
Expand Down

0 comments on commit f8de97c

Please sign in to comment.