mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
rebuilding lexer.js
This commit is contained in:
parent
913171f708
commit
64bd4b3f74
1 changed files with 6 additions and 5 deletions
|
@ -107,14 +107,15 @@
|
|||
};
|
||||
|
||||
Lexer.prototype.numberToken = function() {
|
||||
var is_binary, match, number, numlen;
|
||||
var binaryLiteral, lexedLength, match, number;
|
||||
if (!(match = NUMBER.exec(this.chunk))) return 0;
|
||||
number = match[0];
|
||||
numlen = number.length;
|
||||
is_binary = /0b([01]+)/.exec(number);
|
||||
if (is_binary) number = (parseInt(is_binary[1], 2)).toString();
|
||||
lexedLength = number.length;
|
||||
if (binaryLiteral = /0b([01]+)/.exec(number)) {
|
||||
number = (parseInt(binaryLiteral[1], 2)).toString();
|
||||
}
|
||||
this.token('NUMBER', number);
|
||||
return numlen;
|
||||
return lexedLength;
|
||||
};
|
||||
|
||||
Lexer.prototype.stringToken = function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue