Skip to content

Commit

Permalink
Small fix for the cpp semantics. Probably doesn't make a difference.
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoOfTwelve committed Oct 18, 2024
1 parent e9333d7 commit f6a2ac1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions languages/cpp/src/main/java/de/jplag/cpp/CPPListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@
class CPPListener extends AbstractAntlrListener {

CPPListener() {
visit(ClassSpecifierContext.class, rule -> rule.classHead().Union() != null).map(UNION_BEGIN, UNION_END).withSemantics(CodeSemantics::new);
visit(ClassSpecifierContext.class, rule -> rule.classHead().Union() != null).map(UNION_BEGIN, UNION_END).addClassScope().withSemantics(CodeSemantics::createControl);
mapClass(ClassKeyContext::Class, CLASS_BEGIN, CLASS_END);
mapClass(ClassKeyContext::Struct, STRUCT_BEGIN, STRUCT_END); // structs are basically just classes
visit(EnumSpecifierContext.class).map(ENUM_BEGIN, ENUM_END).withSemantics(CodeSemantics::createControl);
visit(EnumSpecifierContext.class).map(ENUM_BEGIN, ENUM_END).addClassScope().withSemantics(CodeSemantics::createControl);

visit(FunctionDefinitionContext.class).map(FUNCTION_BEGIN, FUNCTION_END).addLocalScope().withSemantics(CodeSemantics::createControl);

Expand Down

0 comments on commit f6a2ac1

Please sign in to comment.