Permalink
Browse files

allowing capital B in binary literals; see #2021; thanks @BrendanEich

  • Loading branch information...
1 parent ff05575 commit 6d33a2e1a0f79ff587352bf2679579e809cbb7db @michaelficarra michaelficarra committed Jan 12, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 lib/coffee-script/lexer.js
  2. +1 −1 src/lexer.coffee
  3. +1 −0 test/numbers.coffee

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -134,7 +134,7 @@ exports.Lexer = class Lexer
return 0 unless match = NUMBER.exec @chunk
number = match[0]
lexedLength = number.length
- if binaryLiteral = /0b([01]+)/.exec number
+ if binaryLiteral = /0b([01]+)/i.exec number
number = (parseInt binaryLiteral[1], 2).toString()
@token 'NUMBER', number
lexedLength
View
@@ -15,6 +15,7 @@
test "Parser recognises binary numbers", ->
eq 4, 0b100
+ eq 5, 0B101
# Decimal Integer Literals

0 comments on commit 6d33a2e

Please sign in to comment.