From: nobu.nokada@... Date: 2002-01-05T00:54:48+09:00 Subject: [ruby-talk:30222] Re: Bug? At Fri, 4 Jan 2002 22:33:44 +0900, ts wrote: > n> + else if (c == '.' || c == 'e' || c == 'E' || c == 'f' || c == 'F') { > > I think that you'll have problem with this ('f' and 'F') or the patch is > not complete Oops, what's '0f0'!? Index: parse.y =================================================================== RCS file: /cvs/ruby/src/ruby/parse.y,v retrieving revision 1.140 diff -u -2 -p -r1.140 parse.y --- parse.y 2002/01/04 15:20:48 1.140 +++ parse.y 2002/01/04 15:51:46 @@ -3327,13 +3327,15 @@ yylex() /* hexadecimal */ c = nextc(); - do { - if (c == '_') { - seen_uc = 1; - continue; - } - if (!ISXDIGIT(c)) break; - seen_uc = 0; - tokadd(c); - } while (c = nextc()); + if (ISXDIGIT(c)) { + do { + if (c == '_') { + seen_uc = 1; + continue; + } + if (!ISXDIGIT(c)) break; + seen_uc = 0; + tokadd(c); + } while (c = nextc()); + } pushback(c); tokfix(); @@ -3348,13 +3350,15 @@ yylex() /* binary */ c = nextc(); - do { - if (c == '_') { - seen_uc = 1; - continue; - } - if (c != '0'&& c != '1') break; - seen_uc = 0; - tokadd(c); - } while (c = nextc()); + if (c == '0' || c != '1') { + do { + if (c == '_') { + seen_uc = 1; + continue; + } + if (c != '0' && c != '1') break; + seen_uc = 0; + tokadd(c); + } while (c = nextc()); + } pushback(c); tokfix(); @@ -3386,5 +3390,5 @@ yylex() yyerror("Illegal octal digit"); } - else if (c == '.') { + else if (c == '.' || c == 'e' || c == 'E') { tokadd('0'); } -- Nobu Nakada