return p.pos+1;
}
String id = p.getId();
if (id.length()==0) {
throw new ParseException("Expected identifier '}' parsing local params '" + txt + '"');
}
String val=null;
ch = p.peek();
if (ch!='=') {
// single word... treat {!func} as type=func for easy lookup
val = id;
id = TYPE;
} else {
// saw equals, so read value
p.pos++;
ch = p.peek();
if (ch=='\"' || ch=='\'') {
val = p.getQuotedString();
} else if (ch=='$') {
p.pos++;
// dereference parameter
String pname = p.getId();
if (params!=null) {
val = params.get(pname);
}
} else {
// read unquoted literal ended by whitespace or '}'
// there is no escaping.
int valStart = p.pos;
for (;;) {
if (p.pos >= p.end) {
throw new ParseException("Missing end to unquoted value starting at " + valStart + " str='" + txt +"'");
}
char c = p.val.charAt(p.pos);
if (c==LOCALPARAM_END || Character.isWhitespace(c)) {
val = p.val.substring(valStart, p.pos);
break;