Skip to content

Commit 86e2f96

Browse files
committed
Handling of protection of the Java enum constructs.
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.
1 parent 97f8756 commit 86e2f96

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/scanner.l

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,13 @@ NONLopt [^\n]*
17611761
if (yyextra->insideJava)
17621762
{
17631763
yyextra->current->section = EntryType::makeClass();
1764+
yyextra->current->protection = Protection::Public;
1765+
if (text.find("protected")!=-1)
1766+
yyextra->current->protection = Protection::Protected;
1767+
else if (text.find("private")!=-1)
1768+
yyextra->current->protection = Protection::Private;
1769+
else if (text.find("package")!=-1)
1770+
yyextra->current->protection = Protection::Package;
17641771
yyextra->current->spec = TypeSpecifier().setEnum(true);
17651772
}
17661773
else
@@ -7318,7 +7325,7 @@ static void initEntry(yyscan_t yyscanner)
73187325
{
73197326
yyextra->protection = (yyextra->current_root->spec.isInterface() || yyextra->current_root->spec.isEnum()) ? Protection::Public : Protection::Package;
73207327
}
7321-
yyextra->current->protection = yyextra->protection ;
7328+
yyextra->current->protection = yyextra->protection;
73227329
yyextra->current->exported = yyextra->exported ;
73237330
yyextra->current->mtype = yyextra->mtype;
73247331
yyextra->current->virt = yyextra->virt;

0 commit comments

Comments
 (0)