Re: POLL: What should value do with underscores?
- Posted by cargoan Feb 14, 2015
- 1533 views
Forgot count zero when it is not part of the header number.
--- get.e 2015-02-14 08:37:35.982026000 +0100 +++ get.e 2015-02-14 08:39:14.970026000 +0100 @@ -192,7 +192,7 @@ if ch = '/' then return {GET_IGNORE, 0} else - return {GET_EOF, 0} + return read_c_comment() end if else for i = string_next to length(input_string) do @@ -203,7 +203,7 @@ ch = input_string[i+1] string_next = i + 1 if ch = '/' then - return {GET_IGNORE, 0} + return read_c_comment() end if end if end for @@ -260,6 +260,8 @@ end if number_string &= ch get_ch() + else + ndigits += 1 end if end if @@ -301,7 +303,7 @@ mantissa = sign * mantissa - if ch = 'e' or ch = 'E' then + if base = 10 and (ch = 'e' or ch = 'E') then -- get exponent sign number_string &= ch get_ch() @@ -314,6 +316,7 @@ end if -- get exponent magnitude + ndigits = 0 while TRUE do base_digit = find(ch - 32 * (ch >= 'a'), HEX_DIGITS[1..base] & '_') - 1 if base_digit >= 0 then @@ -326,7 +329,9 @@ exit end if end while - mantissa = scientific_to_atom( number_string ) + if ndigits > 0 then + mantissa = scientific_to_atom( number_string ) + end if end if if ndigits = 0 then
Sorry for the inconvenience.
Thanks.