improve SWI and ISO scanner compatibility.

This commit is contained in:
Vítor Santos Costa 2011-03-14 20:37:17 +00:00
parent 0d6be2d858
commit c5ba36e191

View File

@ -372,9 +372,9 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream)
ch = getchrq(inp_stream); ch = getchrq(inp_stream);
if (ch == '?') {/* delete character */ if (ch == '?') {/* delete character */
return 127; return 127;
} else if (ch >= 'a' && ch < 'z') {/* octal */ } else if (ch >= 'a' && ch < 'z') {/* hexa */
return ch - 'a'; return ch - 'a';
} else if (ch >= 'A' && ch < 'Z') {/* octal */ } else if (ch >= 'A' && ch < 'Z') {/* hexa */
return ch - 'A'; return ch - 'A';
} else { } else {
return '^'; return '^';
@ -389,7 +389,8 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream)
case '6': case '6':
case '7': case '7':
/* character in octal: maximum of 3 digits, terminates with \ */ /* character in octal: maximum of 3 digits, terminates with \ */
if (yap_flags[CHARACTER_ESCAPE_FLAG] == ISO_CHARACTER_ESCAPES) { /* follow ISO */
if (TRUE || yap_flags[CHARACTER_ESCAPE_FLAG] == ISO_CHARACTER_ESCAPES) {
unsigned char so_far = ch-'0'; unsigned char so_far = ch-'0';
ch = getchrq(inp_stream); ch = getchrq(inp_stream);
if (ch >= '0' && ch < '8') {/* octal */ if (ch >= '0' && ch < '8') {/* octal */
@ -401,6 +402,7 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream)
if (ch != '\\') { if (ch != '\\') {
return send_error_message("invalid octal escape sequence"); return send_error_message("invalid octal escape sequence");
} }
return so_far;
} else if (ch == '\\') { } else if (ch == '\\') {
return so_far; return so_far;
} else { } else {