lib/minjs/lex.rb in minjs-0.2.0 vs lib/minjs/lex.rb in minjs-0.2.1

- old
+ new

@@ -57,18 +57,10 @@ @lit_nextpos[pos0] = @pos end @error_pos = @pos return ret else - # p pos0 - # p @pos - #@error_pos = @pos - #debug_lit - #raise 'no hint' - #regexp_literal - #div_punctuator - #nil #unknown ECMA262::LIT_DIV_OR_REGEXP_LITERAL end end # 7.2 @@ -192,11 +184,12 @@ @pos += 6 elsif identifier_part?(@codes[@pos]) chars.push(@codes[@pos]) @pos += 1 else - return ECMA262::IdentifierName.new(nil, chars.pack("U*").to_sym) + name = chars.pack("U*").to_sym + return ECMA262::IdentifierName.new(nil, name) end end end def punctuator @@ -486,10 +479,10 @@ end if identifier_start?(@codes[@pos]) raise ParseError.new("The source character immediately following a NumericLiteral must not be an IdentifierStart or DecimalDigit", self) end - return ECMA262::ECMA262Numeric.new(0, f, e) + return ECMA262::ECMA262Numeric.new('0', f, e) end if code >= 0x30 and code <= 0x39 i = decimal_digits if @codes[@pos] == 0x2e #.