Skip to content

Commit

Permalink
Handling of protection of the Java enum constructs.
Browse files Browse the repository at this point in the history
Based on the question https://stackoverflow.com/questions/77448988/doxygen-cannot-include-aidl-interfaces-and-enums-to-the-documentation and the enum code provided in https://www.w3schools.com/java/java_enums.asp i.e:
```
public class Main {
  enum Level {
    LOW,
    MEDIUM,
    HIGH
  }

  public static void main(String[] args) {
    Level myVar = Level.MEDIUM;
    System.out.println(myVar);
  }
}

```
the handling of the protection for Java enum's has been improved.
  • Loading branch information
albert-github committed Nov 10, 2023
1 parent 97f8756 commit 86e2f96
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/scanner.l
Expand Up @@ -1761,6 +1761,13 @@ NONLopt [^\n]*
if (yyextra->insideJava)
{
yyextra->current->section = EntryType::makeClass();
yyextra->current->protection = Protection::Public;
if (text.find("protected")!=-1)
yyextra->current->protection = Protection::Protected;
else if (text.find("private")!=-1)
yyextra->current->protection = Protection::Private;
else if (text.find("package")!=-1)
yyextra->current->protection = Protection::Package;
yyextra->current->spec = TypeSpecifier().setEnum(true);
}
else
Expand Down Expand Up @@ -7318,7 +7325,7 @@ static void initEntry(yyscan_t yyscanner)
{
yyextra->protection = (yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isEnum()) ? Protection::Public : Protection::Package;
}
yyextra->current->protection = yyextra->protection ;
yyextra->current->protection = yyextra->protection;
yyextra->current->exported = yyextra->exported ;
yyextra->current->mtype = yyextra->mtype;
yyextra->current->virt = yyextra->virt;
Expand Down

0 comments on commit 86e2f96

Please sign in to comment.