ISO patches
This commit is contained in:
parent
2829696db7
commit
d575ca8391
31
C/scanner.c
31
C/scanner.c
@ -283,13 +283,7 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream)
|
|||||||
ch = getchrq(inp_stream);
|
ch = getchrq(inp_stream);
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 10:
|
case 10:
|
||||||
do {
|
return 0;
|
||||||
ch = getchrq(inp_stream);
|
|
||||||
if (ch == '\\') goto restart;
|
|
||||||
if (chtype(ch) != BS || ch == 10) {
|
|
||||||
return ch;
|
|
||||||
}
|
|
||||||
} while (TRUE);
|
|
||||||
case 'a':
|
case 'a':
|
||||||
return '\a';
|
return '\a';
|
||||||
case 'b':
|
case 'b':
|
||||||
@ -364,12 +358,7 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream)
|
|||||||
case 'v':
|
case 'v':
|
||||||
return '\v';
|
return '\v';
|
||||||
case 'z': /* Prolog end-of-file */
|
case 'z': /* Prolog end-of-file */
|
||||||
if (yap_flags[CHARACTER_ESCAPE_FLAG] == ISO_CHARACTER_ESCAPES) {
|
return send_error_message("invalid escape sequence \\z");
|
||||||
return send_error_message("invalid escape sequence \\z");
|
|
||||||
} else
|
|
||||||
return -1;
|
|
||||||
case '\\':
|
|
||||||
return '\\';
|
|
||||||
case '\'':
|
case '\'':
|
||||||
return '\'';
|
return '\'';
|
||||||
case '"':
|
case '"':
|
||||||
@ -486,16 +475,7 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream)
|
|||||||
/* accept sequence. Note that the ISO standard does not
|
/* accept sequence. Note that the ISO standard does not
|
||||||
consider this sequence legal, whereas SICStus would
|
consider this sequence legal, whereas SICStus would
|
||||||
eat up the escape sequence. */
|
eat up the escape sequence. */
|
||||||
if (yap_flags[CHARACTER_ESCAPE_FLAG] == ISO_CHARACTER_ESCAPES) {
|
return send_error_message("invalid escape sequence");
|
||||||
return send_error_message("invalid escape sequence");
|
|
||||||
} else {
|
|
||||||
/* sicstus */
|
|
||||||
if (chtype(ch) == SL) {
|
|
||||||
goto restart;
|
|
||||||
} else {
|
|
||||||
return ch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1142,8 +1122,9 @@ Yap_tokenizer(IOSTREAM *inp_stream, int store_comments, Term *tposp)
|
|||||||
ch = getchrq(inp_stream);
|
ch = getchrq(inp_stream);
|
||||||
} else if (ch == '\\' && yap_flags[CHARACTER_ESCAPE_FLAG] != CPROLOG_CHARACTER_ESCAPES) {
|
} else if (ch == '\\' && yap_flags[CHARACTER_ESCAPE_FLAG] != CPROLOG_CHARACTER_ESCAPES) {
|
||||||
int scan_next = TRUE;
|
int scan_next = TRUE;
|
||||||
ch = read_quoted_char(&scan_next, inp_stream);
|
if ((ch = read_quoted_char(&scan_next, inp_stream))) {
|
||||||
add_ch_to_buff(ch);
|
add_ch_to_buff(ch);
|
||||||
|
}
|
||||||
if (scan_next) {
|
if (scan_next) {
|
||||||
ch = getchrq(inp_stream);
|
ch = getchrq(inp_stream);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user