shell/console/src/main/java/org/apache/karaf/shell/console/completer/Parser.java [296:394]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return peek(true);
    }

    char unicode() {
        if (current + 4 > text.length()) {
            throw new IllegalArgumentException("Unicode \\u escape at eof at pos ..."
                + context(current) + "...");
        }

        String s = text.subSequence(current, current + 4).toString();
        int n = Integer.parseInt(s, 16);
        return (char) n;
    }

    int find(char target, char deeper) {
        int start = current;
        int level = 1;

        while (level != 0) {
            if (eof()) {
                throw new RuntimeException("Eof found in the middle of a compound for '"
                    + target + deeper + "', begins at " + context(start));
            }

            char c = next();
            if (!escaped) {
                if (c == target) {
                    level--;
                } else {
                    if (c == deeper) {
                        level++;
                    } else {
                        if (c == '"') {
                            quote('"');
                        } else {
                            if (c == '\'') {
                                quote('\'');
                            }
                            else {
                                if (c == '`') {
                                    quote('`');
                                }
                            }
                        }
                    }
                }
            }
        }
        return current;
    }

    int quote(char which) {
        while (!eof() && (peek() != which || escaped)) {
            next();
        }

        return current++;
    }

    CharSequence findVar() {
        int start = current;
        char c = peek();

        if (c == '{') {
            next();
            int end = find('}', '{');
            return text.subSequence(start, end);
        }
        if (c == '(') {
            next();
            int end = find(')', '(');
            return text.subSequence(start, end);
        }

        if (Character.isJavaIdentifierPart(c)) {
            while (c == '$') {
                c = next();
            }
            while (!eof() && (Character.isJavaIdentifierPart(c) || c == '.') && c != '$') {
                next();
                c = peek();
            }
            return text.subSequence(start, current);
        }
        throw new IllegalArgumentException(
            "Reference to variable does not match syntax of a variable: "
                + context(start));
    }

    public String toString() {
        return "..." + context(current) + "...";
    }

    public String unescape() {
        StringBuilder sb = new StringBuilder();
        while (!eof()) {
            sb.append(next());
        }
        return sb.toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



shell/core/src/main/java/org/apache/karaf/shell/support/parsing/GogoParser.java [311:409]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return peek(true);
    }

    char unicode() {
        if (current + 4 > text.length()) {
            throw new IllegalArgumentException("Unicode \\u escape at eof at pos ..."
                + context(current) + "...");
        }

        String s = text.subSequence(current, current + 4).toString();
        int n = Integer.parseInt(s, 16);
        return (char) n;
    }

    int find(char target, char deeper) {
        int start = current;
        int level = 1;

        while (level != 0) {
            if (eof()) {
                throw new RuntimeException("Eof found in the middle of a compound for '"
                    + target + deeper + "', begins at " + context(start));
            }

            char c = next();
            if (!escaped) {
                if (c == target) {
                    level--;
                } else {
                    if (c == deeper) {
                        level++;
                    } else {
                        if (c == '"') {
                            quote('"');
                        } else {
                            if (c == '\'') {
                                quote('\'');
                            }
                            else {
                                if (c == '`') {
                                    quote('`');
                                }
                            }
                        }
                    }
                }
            }
        }
        return current;
    }

    int quote(char which) {
        while (!eof() && (peek() != which || escaped)) {
            next();
        }

        return current++;
    }

    CharSequence findVar() {
        int start = current;
        char c = peek();

        if (c == '{') {
            next();
            int end = find('}', '{');
            return text.subSequence(start, end);
        }
        if (c == '(') {
            next();
            int end = find(')', '(');
            return text.subSequence(start, end);
        }

        if (Character.isJavaIdentifierPart(c)) {
            while (c == '$') {
                c = next();
            }
            while (!eof() && (Character.isJavaIdentifierPart(c) || c == '.') && c != '$') {
                next();
                c = peek();
            }
            return text.subSequence(start, current);
        }
        throw new IllegalArgumentException(
            "Reference to variable does not match syntax of a variable: "
                + context(start));
    }

    public String toString() {
        return "..." + context(current) + "...";
    }

    public String unescape() {
        StringBuilder sb = new StringBuilder();
        while (!eof()) {
            sb.append(next());
        }
        return sb.toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



