only force 1E30 an error if in ISO mode.

always 1.0e30.
This commit is contained in:
Vitor Santos Costa
2010-11-22 12:51:02 +00:00
parent 20699fd838
commit 2ee12ca1a7
2 changed files with 37 additions and 11 deletions

View File

@@ -602,8 +602,12 @@ get_num(int *chp, int *chbuffp, int inp_stream, int (*Nxtch) (int), int (*Quoted
has_overflow = TRUE;
ch = Nxtch(inp_stream);
}
if (might_be_float && ch == '.') {
{
if (might_be_float && ( ch == '.' || ch == 'e' || ch == 'E')) {
if (yap_flags[STRICT_ISO_FLAG] && (ch == 'e' || ch == 'E')) {
Yap_ErrorMessage = "Float format not allowed in ISO mode";
return TermNil;
}
if (ch == '.') {
if (--max_size == 0) {
Yap_ErrorMessage = "Number Too Long";
return TermNil;
@@ -628,10 +632,14 @@ get_num(int *chp, int *chbuffp, int inp_stream, int (*Nxtch) (int), int (*Quoted
}
while (chtype(ch = Nxtch(inp_stream)) == NU);
}
if (ch == 'e') {
if (ch == 'e' || ch == 'E') {
char *sp0 = sp;
char cbuff = ch;
if (yap_flags[STRICT_ISO_FLAG] && ch == 'E') {
Yap_ErrorMessage = "Float format not allowed in ISO mode";
return TermNil;
}
if (--max_size == 0) {
Yap_ErrorMessage = "Number Too Long";
return TermNil;