Examples of GoPrimaryExpression


Examples of ro.redeul.google.go.lang.psi.expressions.GoPrimaryExpression

                addOccurrence(statement);
            }

            @Override
            public void visitBuiltinCallExpression(GoBuiltinCallOrConversionExpression expression) {
                GoPrimaryExpression baseExpression = expression.getBaseExpression();
                if (baseExpression instanceof GoLiteralExpression) {
                    GoLiteral literal = ((GoLiteralExpression) baseExpression).getLiteral();
                    if (literal instanceof GoLiteralIdentifier && "panic".equals(literal.getText())) {
                        addOccurrence(expression);
                    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoPrimaryExpression

        PsiElement call = element.getFirstChild();
        if (!(call instanceof GoBuiltinCallOrConversionExpression)) {
            return false;
        }

        GoPrimaryExpression expression = ((GoBuiltinCallOrConversionExpression) call).getBaseExpression();
        return expression != null && "panic".equals(expression.getText());
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoPrimaryExpression

            }
        }.visitFile(file);
    }

    private static void checkFmtCall(InspectionResult result, GoCallOrConvExpression call) {
        GoPrimaryExpression callNameExpression = call.getBaseExpression();

        if (callNameExpression == null)
            return;

        String methodCall = callNameExpression.getText();

        GoExpr[]args = call.getArguments();

        if ("fmt.Fprintf".equals(methodCall) && args.length > 1) {
            checkFormat(result, call, Arrays.copyOfRange(args, 1, args.length), false);
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoPrimaryExpression

    public static GoPsiElement getCallFunctionIdentifier(@Nullable GoCallOrConvExpression call) {
        if (call == null) {
            return null;
        }

        GoPrimaryExpression baseExpression = call.getBaseExpression();
        if (baseExpression instanceof GoLiteralExpression) {
            GoLiteralExpression literal = (GoLiteralExpression) baseExpression;
            PsiElement child = literal.getLiteral();
            return child instanceof GoLiteralIdentifier ? (GoLiteralIdentifier) child : null;
        }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoPrimaryExpression

    }

    @NotNull
    @Override
    protected GoType[] resolveTypes() {
        GoPrimaryExpression baseExpr = getBaseExpression();
        if (baseExpr == null)
            return GoType.EMPTY_ARRAY;

        GoType baseCallType[] = baseExpr.getType();

        GoType[] goTypes = GoTypes.visitFirstType(baseCallType, new TypeVisitor<GoType[]>(GoType.EMPTY_ARRAY) {

            @Override
            public GoType[] visitFunction(GoTypeFunction type) {
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoPrimaryExpression

    @NotNull
    @Override
    public PsiReference[] defineReferences() {
        // TODO understand if this can be removed.
        GoPrimaryExpression baseExpression = getBaseExpression();

        if (baseExpression == null) {
            return PsiReference.EMPTY_ARRAY;
        }

        GoType[] baseTypes = baseExpression.getType();
        if (baseTypes.length == 0) {
            return PsiReference.EMPTY_ARRAY;
        }

        GoType type = baseTypes[0];
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoPrimaryExpression

            @Override
            public void visitBuiltinCallExpression(GoBuiltinCallOrConversionExpression expression) {
                super.visitBuiltinCallExpression(expression);

                GoPrimaryExpression baseExpression = expression.getBaseExpression();
                String expressionText = baseExpression.getText();
                if (expressionText.equals("make")) {
                    checkMakeCall(expression, result);

                } else if (expressionText.equals("new")) {
                    checkNewCall(expression, result);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.