Skip to content

Commit f8b0c80

Browse files
authored
Merge pull request #4318 from GeoffreyBooth/octal-and-binaries-as-is
Pass through octal and binary literals as-is
2 parents 1d230fe + 329b2d1 commit f8b0c80

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)