GoDeclarationsScanner.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:goworks 作者:
@Override
@RuleDependency(recognizer=GoParser.class, rule=GoParser.RULE_interfaceType, version=0)
public void enterInterfaceType(InterfaceTypeContext ctx) {
    if (isAnonymousType(ctx)) {
        return;
    }

    Interval sourceInterval = ParseTrees.getSourceInterval(ctx);
    String name = typeNameStack.isEmpty() ? "?interface?" : typeNameStack.peek();
    String signature = name;

    GoNode.DeclarationDescription description = new GoNode.DeclarationDescription(name, DeclarationKind.INTERFACE);
    description.setOffset(snapshot, getCurrentParent().getFileObject(), sourceInterval.a);
    description.setHtmlHeader(String.format("%s", signature));
    getCurrentParent().getChildren().add(description);
    descriptionStack.push(description);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号