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

This commit is contained in:
Michael Ficarra
2012-01-12 13:21:29 -05:00
parent ff05575b78
commit 6d33a2e1a0
3 changed files with 3 additions and 2 deletions

View File

@@ -113,7 +113,7 @@
if (!(match = NUMBER.exec(this.chunk))) return 0;
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();
}
this.token('NUMBER', number);