diff --git a/lib/coffee-script/lexer.js b/lib/coffee-script/lexer.js index 8c560c36..8d46f338 100644 --- a/lib/coffee-script/lexer.js +++ b/lib/coffee-script/lexer.js @@ -112,8 +112,8 @@ var binaryLiteral, lexedLength, match, number, octalLiteral; if (!(match = NUMBER.exec(this.chunk))) return 0; number = match[0]; - if (/[E]/.test(number)) { - this.error("exponential notation must be indicated with a lowercase 'e'"); + if (/E/.test(number)) { + this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'"); } else if (/[BOX]/.test(number)) { this.error("radix prefixes must be lowercase '" + number + "'"); } else if (/^0[89]/.test(number)) { diff --git a/src/lexer.coffee b/src/lexer.coffee index 8544b8f1..55a4821f 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -133,8 +133,8 @@ exports.Lexer = class Lexer numberToken: -> return 0 unless match = NUMBER.exec @chunk number = match[0] - if /[E]/.test number - @error "exponential notation must be indicated with a lowercase 'e'" + if /E/.test number + @error "exponential notation '#{number}' must be indicated with a lowercase 'e'" else if /[BOX]/.test number @error "radix prefixes must be lowercase '#{number}'" else if /^0[89]/.test number