Merge branch 'master' of http://github.com/jashkenas/coffee-script into refactorTests

This commit is contained in:
Michael Ficarra 2010-12-29 00:51:26 -05:00
commit a330eda4b6
7 changed files with 14 additions and 10 deletions

View File

@ -58,7 +58,7 @@
base = path.join(source);
compile = function(source, topLevel) {
return path.exists(source, function(exists) {
if (!exists) {
if (topLevel && !exists) {
throw new Error("File not found: " + source);
}
return fs.stat(source, function(err, stats) {

View File

@ -598,7 +598,7 @@
RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf'];
JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED);
exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS);
IDENTIFIER = /^([$A-Za-z_][$\w]*)([^\n\S]*:(?!:))?/;
IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/;
NUMBER = /^0x[\da-f]+|^(?:\d+(\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i;
HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/;
OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;
@ -613,7 +613,7 @@
HEREGEX_OMIT = /\s+(?:#.*)?/g;
MULTILINER = /\n/g;
HEREDOC_INDENT = /\n+([^\n\S]*)/g;
ASSIGNED = /^\s*@?([$A-Za-z_][$\w]*|['"].*['"])[^\n\S]*?[:=][^:=>]/;
ASSIGNED = /^\s*@?([$A-Za-z_][$\w\x7f-\uffff]*|['"].*['"])[^\n\S]*?[:=][^:=>]/;
LINE_CONTINUER = /^\s*(?:,|\??\.(?!\.)|::)/;
TRAILING_SPACES = /\s+$/;
NO_NEWLINE = /^(?:[-+*&|\/%=<>!.\\][<>=&|]*|and|or|is(?:nt)?|n(?:ot|ew)|delete|typeof|instanceof)$/;

View File

@ -1071,7 +1071,7 @@
this.context = context;
this.param = options && options.param;
}
Assign.prototype.METHOD_DEF = /^(?:(\S+)\.prototype\.|\S+?)?\b([$A-Za-z_][$\w]*)$/;
Assign.prototype.METHOD_DEF = /^(?:(\S+)\.prototype\.|\S+?)?\b([$A-Za-z_][$\w\x7f-\uffff]*)$/;
Assign.prototype.children = ['variable', 'value'];
Assign.prototype.assigns = function(name) {
return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
@ -2150,7 +2150,7 @@
LEVEL_ACCESS = 6;
TAB = ' ';
TRAILING_WHITESPACE = /[ \t]+$/gm;
IDENTIFIER = /^[$A-Za-z_][$\w]*$/;
IDENTIFIER = /^[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*$/;
SIMPLENUM = /^[+-]?\d+$/;
IS_STRING = /^['"]/;
utility = function(name) {

View File

@ -76,7 +76,7 @@ compileScripts = ->
base = path.join(source)
compile = (source, topLevel) ->
path.exists source, (exists) ->
throw new Error "File not found: #{source}" unless exists
throw new Error "File not found: #{source}" if topLevel and not exists
fs.stat source, (err, stats) ->
if stats.isDirectory()
fs.readdir source, (err, files) ->

View File

@ -534,7 +534,7 @@ exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS)
# Token matching regexes.
IDENTIFIER = /// ^
( [$A-Za-z_][$\w]* )
( [$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]* )
( [^\n\S]* : (?!:) )? # Is this a property name?
///
@ -591,7 +591,7 @@ MULTILINER = /\n/g
HEREDOC_INDENT = /\n+([^\n\S]*)/g
ASSIGNED = /^\s*@?([$A-Za-z_][$\w]*|['"].*['"])[^\n\S]*?[:=][^:=>]/
ASSIGNED = /^\s*@?([$A-Za-z_][$\w\x7f-\uffff]*|['"].*['"])[^\n\S]*?[:=][^:=>]/
LINE_CONTINUER = /// ^ \s* (?: , | \??\.(?!\.) | :: ) ///

View File

@ -856,7 +856,7 @@ exports.Assign = class Assign extends Base
@param = options and options.param
# Matchers for detecting class/method names
METHOD_DEF: /^(?:(\S+)\.prototype\.|\S+?)?\b([$A-Za-z_][$\w]*)$/
METHOD_DEF: /^(?:(\S+)\.prototype\.|\S+?)?\b([$A-Za-z_][$\w\x7f-\uffff]*)$/
children: ['variable', 'value']
@ -1735,7 +1735,7 @@ TAB = ' '
# with Git.
TRAILING_WHITESPACE = /[ \t]+$/gm
IDENTIFIER = /^[$A-Za-z_][$\w]*$/
IDENTIFIER = /^[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*$/
SIMPLENUM = /^[+-]?\d+$/
# Is a literal value a string?

View File

@ -268,3 +268,7 @@ six: -> 10
ok not one.six
# Issue #986: Unicode identifiers.
λ = 5
eq λ, 5