diff options
author | albert-github <albert.tests@gmail.com> | 2020-08-28 11:27:14 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-08-28 11:27:14 (GMT) |
commit | 1d8610c90ba279bb207f0d45f96cef3054ff34eb (patch) | |
tree | e7ebd37ddf367a4d34a9f52b24de0667bdc8f98c /src | |
parent | 63dc5b9b1b3e8fb875304a954e4df934b249034b (diff) | |
download | Doxygen-1d8610c90ba279bb207f0d45f96cef3054ff34eb.zip Doxygen-1d8610c90ba279bb207f0d45f96cef3054ff34eb.tar.gz Doxygen-1d8610c90ba279bb207f0d45f96cef3054ff34eb.tar.bz2 |
bug_647654 Special command \fn fails when first argument of PHP function is call-by-reference
The handling of `(&$var` for php was not included at all places.
It was handled with the rules (in scanner.l):
```
<FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */$
<FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ { /* typedef void (A::*ptr_t)(args...) or int (*fun c(int))[], the ^ is for Obj-C blocks */$
```
Diffstat (limited to 'src')
-rw-r--r-- | src/declinfo.l | 1 | ||||
-rw-r--r-- | src/scanner.l | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/declinfo.l b/src/declinfo.l index 2f497f9..014ef75 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -149,6 +149,7 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+) addType(yyscanner); } <Start>{B}*"("({ID}"::")*{B}*[&*]({B}*("const"|"volatile"){B}+)? { + if (yyextra->insidePHP) REJECT; addType(yyscanner); QCString text=yytext; yyextra->type+=text.stripWhiteSpace(); diff --git a/src/scanner.l b/src/scanner.l index 7c710fa..e4e7184 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -6505,10 +6505,17 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) BEGIN( ReadFuncArgType ) ; } <Prototype>"("({ID}"::")*({B}*[&*])+ { - yyextra->current->type+=yyextra->current->name+yytext; - yyextra->current->name.resize(0); - BEGIN( PrototypePtr ); - } + if (yyextra->insidePHP) // reference parameter + { + REJECT; + } + else + { + yyextra->current->type+=yyextra->current->name+yytext; + yyextra->current->name.resize(0); + BEGIN( PrototypePtr ); + } + } <PrototypePtr>{SCOPENAME} { yyextra->current->name+=yytext; } |