Skip to content

Commit 329b2d1

Browse files
committed
Pass through octal and binary literals as-is
See coffeescript6/discuss#45
1 parent 57f5297 commit 329b2d1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lexer.coffee

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,8 @@ exports.Lexer = class Lexer
211211
when 'o' then 8
212212
when 'x' then 16
213213
else null
214+
214215
numberValue = if base? then parseInt(number[2..], base) else parseFloat(number)
215-
if number.charAt(1) in ['b', 'o']
216-
number = "0x#{numberValue.toString 16}"
217216

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

0 commit comments

Comments
 (0)