Skip to content

Commit

Permalink
Pass through octal and binary literals as-is
Browse files Browse the repository at this point in the history
  • Loading branch information
JimPanic committed Sep 26, 2016
1 parent 57f5297 commit 329b2d1
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 329b2d1

Please sign in to comment.