diff options
author | Piotr Szydełko <wiertel@wiertel.info> | 2017-05-20 06:14:27 (GMT) |
---|---|---|
committer | Piotr Szydełko <wiertel@wiertel.info> | 2017-05-20 06:21:46 (GMT) |
commit | 14a0bcc74a121525917aefc8c9034e283e94884b (patch) | |
tree | c670f763cadf60fe637252211628751f5af464ce /src/scanner.l | |
parent | 88ff6e5931896a0798997a226e846e75a99f8802 (diff) | |
download | Doxygen-14a0bcc74a121525917aefc8c9034e283e94884b.zip Doxygen-14a0bcc74a121525917aefc8c9034e283e94884b.tar.gz Doxygen-14a0bcc74a121525917aefc8c9034e283e94884b.tar.bz2 |
Fix C# property initializer parsing
int Property {get; set;} = 23;
The parser was ending the property at the closing bracket,
which resulted in the initializer being assigned to the following property.
Diffstat (limited to 'src/scanner.l')
-rw-r--r-- | src/scanner.l | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/scanner.l b/src/scanner.l index 9ff082d..632c8a5 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -6198,6 +6198,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } } <CSAccessorDecl>"{" { curlyCount++; } +<CSAccessorDecl>"}"{B}*"=" { + // fall back to next rule if it's not the right bracket + if (curlyCount != 0) REJECT; + current->initializer = "="; + current->endBodyLine=yyLineNr; + lastInitializerContext = FindMembers; + BEGIN(ReadInitializer); + } <CSAccessorDecl>"}" { if (curlyCount) { @@ -6207,6 +6215,8 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) { mtype = Method; virt = Normal; + // not really important, but while we are at it + current->endBodyLine=yyLineNr; unput(';'); BEGIN(FindMembers); } |