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)); }
switch (c) { case '{': return text.substring(start, find('}', '{')); case '(': return text.substring(start, find(')', '(')); case '[': return text.substring(start, find(']', '[')); case '<': return text.substring(start, find('>', '<')); case '=': return text.substring(start, current); find('}', '{'); find(')', '('); find('>', '<'); find(']', '[');