Package org.python.pydev.parser.jython.ast

Examples of org.python.pydev.parser.jython.ast.Str


                indentPrefs = edit.getIndentPrefs();
            } else {
                indentPrefs = DefaultIndentPrefs.get();
            }

            Str docStr = NodeUtils.getNodeDocStringNode(astToPrint);
            if (docStr != null) {
                docStr.s = StringUtils.fixWhitespaceColumnsToLeftFromDocstring(docStr.s,
                        indentPrefs.getIndentationString());
            }
View Full Code Here


            case JJTSTRING:
            case JJTUNICODE:
            case JJTBINARY:
                //the actual number will be set during the parsing (token image) -- see Num construct
                ret = new Str(null, -1, false, false, false);
                break;

            case JJTFOR_STMT:
                ret = new For(null, null, null, null);
                break;
View Full Code Here

                s.value = (exprType) this.stack.popNode();
                ctx.setStore(s);
                return s;

            case JJTSTRJOIN:
                Str str2 = (Str) stack.popNode();
                Object o = stack.popNode();
                StrJoin ret;
                if (o instanceof Str) {
                    Str str1 = (Str) o;
                    ret = new StrJoin(new exprType[] { str1, str2 });
                } else {
                    StrJoin strJ = (StrJoin) o;
                    exprType[] newStrs = new exprType[strJ.strs.length + 1];
                    System.arraycopy(strJ.strs, 0, newStrs, 0, strJ.strs.length);
View Full Code Here

        addArgument(args, state.isGetter(), "get");
        addArgument(args, state.isSetter(), "set");
        addArgument(args, state.isDelete(), "del");
        if (state.isDocstring()) {
            args.add(new Str(propertyName + "'s docstring", str_typeType.SingleDouble, false, false, false));
        } else {
            args.add(NONE);
        }

        return args.toArray(new exprType[args.size()]);
View Full Code Here

    /**
     * @param node
     * @param t
     */
    public static String getNodeDocString(SimpleNode node) {
        Str s = getNodeDocStringNode(node);
        if (s != null) {
            return s.s;
        }
        return null;
    }
View Full Code Here

        }
        return null;
    }

    public static Str getNodeDocStringNode(SimpleNode node) {
        Str s = null;
        stmtType body[] = null;
        if (node instanceof FunctionDef) {
            FunctionDef def = (FunctionDef) node;
            body = def.body;
        } else if (node instanceof ClassDef) {
View Full Code Here

                indentPrefs = edit.getIndentPrefs();
            } else {
                indentPrefs = DefaultIndentPrefs.get();
            }

            Str docStr = NodeUtils.getNodeDocStringNode(astToPrint);
            if (docStr != null) {
                docStr.s = StringUtils.fixWhitespaceColumnsToLeftFromDocstring(docStr.s,
                        indentPrefs.getIndentationString());
            }
View Full Code Here

                if (elts != null) {
                    int len = elts.length;
                    for (int i = 0; i < len; i++) {
                        exprType elt = elts[i];
                        if (elt instanceof Str) {
                            Str str = (Str) elt;
                            validTokensInAll.add(str.s);
                        }
                    }
                }
View Full Code Here

        return node;
    }

    private boolean isAnyInSelection(List<Object> specials) {
        for (Object o : specials) {
            Str strNode = convertSpecialToStr(o);
            if (strNode != null) {
                if (module.isNodeInSelection(selection, strNode)) {
                    return true;
                }
            }
View Full Code Here

        }
        return false;
    }

    private Str convertSpecialToStr(Object o) {
        Str stringNode = null;
        if (o instanceof ISpecialStr) {
            ISpecialStr special = (ISpecialStr) o;
            stringNode = new Str(special.toString(), Str.SingleDouble, false, false, false);
            stringNode.beginLine = special.getBeginLine();
            stringNode.beginColumn = special.getBeginCol();
        }
        return stringNode;
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.jython.ast.Str

Copyright © 2018 www.massapicom. 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.