SAM: Allow backslash escapes in parser (tickets #1325, #1488)

remove unneeded escape char in other parsers
This commit is contained in:
zzz
2015-11-28 18:53:40 +00:00
parent 87fa1cb1ac
commit dffd441304
3 changed files with 10 additions and 4 deletions

View File

@ -180,10 +180,10 @@ class SAMUtils {
* PING any thing goes
* PONG any thing goes
*
* No escaping of '"' or anything else is allowed or defined
* Escaping is allowed with a backslash, e.g. \"
* No spaces before or after '=' allowed
* Keys may not be quoted
* COMMAND and OPCODE may not have '='
* COMMAND, OPCODE, and keys may not have '=' or whitespace unless escaped
* Duplicate keys not allowed
*</pre>
*
@ -274,6 +274,12 @@ class SAMUtils {
}
break;
case '\\':
if (++i >= length)
throw new SAMException("Unterminated escape");
c = args.charAt(i);
// fall through...
default:
buf.append(c);
break;