Skip to content

Commit 3d6a2fc

Browse files
committed
Add functions to determine what type of context they are.
1 parent d966947 commit 3d6a2fc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/org/luapp/language/handlers/ClassBodyHandler.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ public ClassBodyHandler() {
1010
this.setTarget(luappParser.RULE_classbody);
1111
}
1212

13+
public boolean isClassFunction(ParserRuleContext context){
14+
return context.getRuleIndex() == luappParser.RULE_classfunction;
15+
}
16+
17+
public boolean isClassGetSet(ParserRuleContext context){
18+
return context.getRuleIndex() == luappParser.RULE_classgetset;
19+
}
20+
21+
public boolean isClassConstructor(ParserRuleContext context){
22+
return context.getRuleIndex() == luappParser.RULE_constructor;
23+
}
24+
25+
1326
@Override
1427
public void onSetManager() {
1528

0 commit comments

Comments
 (0)