mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Pass through octal and binary literals as-is
See https://github.com/coffeescript6/discuss/issues/45
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user