Skip to content

Commit

Permalink
Merge pull request #4318 from GeoffreyBooth/octal-and-binaries-as-is
Browse files Browse the repository at this point in the history
Pass through octal and binary literals as-is
  • Loading branch information
jashkenas authored Sep 27, 2016
2 parents 1d230fe + 329b2d1 commit f8b0c80
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lexer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ exports.Lexer = class Lexer
when 'o' then 8
when 'x' then 16
else null

numberValue = if base? then parseInt(number[2..], base) else parseFloat(number)
if number.charAt(1) in ['b', 'o']
number = "0x#{numberValue.toString 16}"

tag = if numberValue is Infinity then 'INFINITY' else 'NUMBER'
@token tag, number, 0, lexedLength
Expand Down

0 comments on commit f8b0c80

Please sign in to comment.