Remove old code
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1736020 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java
index fdd7729..089df0a 100644
--- a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java
+++ b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expander.java
@@ -1060,271 +1060,6 @@
}
getch();
-
- /*
- Token pre;
- if ("#^~=+".indexOf(ch) >= 0) {
- pre = text.subSequence(index, index + 1);
- getch();
- } else {
- pre = null;
- }
-
- Token name1;
- Object val1;
- if (ch == '$') {
- name1 = null;
- val1 = expandVar();
- } else {
- int start = index - 1;
- while (ch != EOT && ch != '}' && (isName(ch) || ch == '\\')) {
- getch();
- if (ch == '{' || ch == '(' || ch == '[') {
- findClosing();
- }
- }
- if (ch == EOT) {
- throw new EOFError(sLine, sCol, "unexpected EOT looking for matching '}'", "compound", Character.toString('}'));
- }
- name1 = text.subSequence(start, index - 1);
- val1 = null;
- }
-
- Token op;
- if (ch != '}') {
- int start = index - 1;
- while (ch != EOT && ch != '}' && ":-+=?#%/^|*?".indexOf(ch) >= 0) {
- getch();
- }
- op = text.subSequence(start, index - 1);
- } else {
- op = null;
- }
-
- Token name2;
- Object val2;
- if (ch == '}') {
- name2 = null;
- val2 = null;
- }
- else if (ch == '$') {
- name2 = null;
- val2 = expandVar();
- }
- else {
- int start = index - 1;
- while (ch != EOT && ch != '}') {
- getch();
- if (ch == '\\') {
- escape();
- }
- else if (ch == '{' || ch == '(' || ch == '[') {
- findClosing();
- }
- }
- if (ch == EOT) {
- throw new EOFError(sLine, sCol, "unexpected EOT looking for matching '}'", "compound", Character.toString('}'));
- }
- name2 = text.subSequence(start, index - 1);
- val2 = null;
- }
-
- if (ch != '}') {
- throw new SyntaxError(sLine, sCol, "bad substitution");
- }
-
- if (pre == null && op == null) {
- if (name1 != null) {
- val1 = evaluate.get(expand(name1).toString());
- }
- }
- else if (pre != null && Token.eq(pre, "+") && op == null) {
- if (name1 != null) {
- val1 = evaluate.get(expand(name1).toString()) != null;
- } else {
- throw new SyntaxError(sLine, sCol, "bad substitution");
- }
- }
- else if (pre != null) {
- throw new SyntaxError(sLine, sCol, "bad substitution");
- }
- else if (Token.eq("-", op) || Token.eq(":-", op)) {
- if (name1 != null) {
- val1 = evaluate.get(expand(name1).toString());
- }
- if (val1 == null) {
- if (name2 != null) {
- val2 = expand(expand(name2).toString(), evaluate, inQuote);
- }
- val1 = val2;
- }
- if (val1 instanceof Token) {
- val1 = val1.toString();
- }
- }
- else if (Token.eq("=", op) || Token.eq(":=", op) || Token.eq("::=", op)) {
- assert name1 != null;
- val1 = evaluate.get(expand(name1).toString());
- if (val1 == null && name2 != null) {
- val1 = expand(name2);
- if (val1 instanceof Token) {
- val1 = val1.toString();
- }
- evaluate.put(name1.toString(), val1);
- }
- }
- else if (Token.eq("+", op) || Token.eq(":+", op)) {
- assert name1 != null;
- val1 = evaluate.get(expand(name1).toString());
- if (val1 != null && name2 != null) {
- val1 = expand(name2);
- if (val1 instanceof Token) {
- val1 = val1.toString();
- }
- }
- }
- else if (Token.eq("?", op) || Token.eq(":?", op)) {
- assert name1 != null;
- val1 = evaluate.get(expand(name1).toString());
- if (val1 == null) {
- if (name2 != null) {
- val1 = expand(name2);
- if (val1 instanceof Token) {
- val1 = val1.toString();
- }
- }
- if (val1 == null || val1.toString().length() == 0) {
- val1 = "parameter not set";
- }
- throw new IllegalArgumentException(name1 + ": " + val1);
- }
- }
- else {
-
- }
- val = val1;
- if (flagP) {
- val = val != null ? evaluate.get(val.toString()) : null;
- }
-
- /*
- while (true) {
- if (ch == EOT) {
- throw new EOFError(sLine, sCol, "unexpected EOT looking for matching '}'", "compound", Character.toString('}'));
- }
- if (ch == '\\') {
- escape();
- }
- if (ch == '{')
- }
- // ${NAME[[:]-+=?]WORD}
- short sLine = line;
- short sCol = column;
- Token group = group();
- char c;
- int i = 0;
-
- while (i < group.length())
- {
- switch (group.charAt(i))
- {
- case ':':
- case '-':
- case '+':
- case '=':
- case '?':
- case '#':
- break;
-
- default:
- ++i;
- continue;
- }
- break;
- }
-
- sCol += i;
-
- String name = String.valueOf(expand(group.subSequence(0, i)));
-
- for (int j = 0; j < name.length(); ++j)
- {
- if (!isName(name.charAt(j)))
- {
- throw new SyntaxError(sLine, sCol, "bad name: ${" + group + "}");
- }
- }
-
- val = evaluate.get(name);
-
- if (i < group.length())
- {
- c = group.charAt(i++);
- if (':' == c)
- {
- c = (i < group.length() ? group.charAt(i++) : EOT);
- }
-
- Token word = group.subSequence(i, group.length());
-
- switch (c)
- {
- case '-':
- case '=':
- if (null == val)
- {
- val = expand(word, evaluate, false);
- if (val instanceof Token)
- {
- val = val.toString();
- }
- if ('=' == c)
- {
- evaluate.put(name, val);
- }
- }
- break;
-
- case '+':
- if (null != val)
- {
- val = expand(word, evaluate, false);
- if (val instanceof Token)
- {
- val = val.toString();
- }
- }
- break;
-
- case '?':
- if (null == val)
- {
- val = expand(word, evaluate, false);
- if (val instanceof Token)
- {
- val = val.toString();
- }
- if (null == val || val.toString().length() == 0)
- {
- val = "parameter not set";
- }
- throw new IllegalArgumentException(name + ": " + val);
- }
- break;
-
- case '#':
- if (null != val)
- {
-
- }
- break;
-
- default:
- throw new SyntaxError(sLine, sCol, "bad substitution: ${" + group + "}");
- }
- }
- getch();
- */
}
return val;