Merge branch 'master' of http://github.com/jashkenas/coffee-script into refactorTests
This commit is contained in:
commit
a330eda4b6
|
@ -58,7 +58,7 @@
|
||||||
base = path.join(source);
|
base = path.join(source);
|
||||||
compile = function(source, topLevel) {
|
compile = function(source, topLevel) {
|
||||||
return path.exists(source, function(exists) {
|
return path.exists(source, function(exists) {
|
||||||
if (!exists) {
|
if (topLevel && !exists) {
|
||||||
throw new Error("File not found: " + source);
|
throw new Error("File not found: " + source);
|
||||||
}
|
}
|
||||||
return fs.stat(source, function(err, stats) {
|
return fs.stat(source, function(err, stats) {
|
||||||
|
|
|
@ -598,7 +598,7 @@
|
||||||
RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf'];
|
RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf'];
|
||||||
JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED);
|
JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED);
|
||||||
exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS);
|
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;
|
NUMBER = /^0x[\da-f]+|^(?:\d+(\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i;
|
||||||
HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/;
|
HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/;
|
||||||
OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;
|
OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;
|
||||||
|
@ -613,7 +613,7 @@
|
||||||
HEREGEX_OMIT = /\s+(?:#.*)?/g;
|
HEREGEX_OMIT = /\s+(?:#.*)?/g;
|
||||||
MULTILINER = /\n/g;
|
MULTILINER = /\n/g;
|
||||||
HEREDOC_INDENT = /\n+([^\n\S]*)/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*(?:,|\??\.(?!\.)|::)/;
|
LINE_CONTINUER = /^\s*(?:,|\??\.(?!\.)|::)/;
|
||||||
TRAILING_SPACES = /\s+$/;
|
TRAILING_SPACES = /\s+$/;
|
||||||
NO_NEWLINE = /^(?:[-+*&|\/%=<>!.\\][<>=&|]*|and|or|is(?:nt)?|n(?:ot|ew)|delete|typeof|instanceof)$/;
|
NO_NEWLINE = /^(?:[-+*&|\/%=<>!.\\][<>=&|]*|and|or|is(?:nt)?|n(?:ot|ew)|delete|typeof|instanceof)$/;
|
||||||
|
|
|
@ -1071,7 +1071,7 @@
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.param = options && options.param;
|
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.children = ['variable', 'value'];
|
||||||
Assign.prototype.assigns = function(name) {
|
Assign.prototype.assigns = function(name) {
|
||||||
return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
|
return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
|
||||||
|
@ -2150,7 +2150,7 @@
|
||||||
LEVEL_ACCESS = 6;
|
LEVEL_ACCESS = 6;
|
||||||
TAB = ' ';
|
TAB = ' ';
|
||||||
TRAILING_WHITESPACE = /[ \t]+$/gm;
|
TRAILING_WHITESPACE = /[ \t]+$/gm;
|
||||||
IDENTIFIER = /^[$A-Za-z_][$\w]*$/;
|
IDENTIFIER = /^[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*$/;
|
||||||
SIMPLENUM = /^[+-]?\d+$/;
|
SIMPLENUM = /^[+-]?\d+$/;
|
||||||
IS_STRING = /^['"]/;
|
IS_STRING = /^['"]/;
|
||||||
utility = function(name) {
|
utility = function(name) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ compileScripts = ->
|
||||||
base = path.join(source)
|
base = path.join(source)
|
||||||
compile = (source, topLevel) ->
|
compile = (source, topLevel) ->
|
||||||
path.exists source, (exists) ->
|
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) ->
|
fs.stat source, (err, stats) ->
|
||||||
if stats.isDirectory()
|
if stats.isDirectory()
|
||||||
fs.readdir source, (err, files) ->
|
fs.readdir source, (err, files) ->
|
||||||
|
|
|
@ -534,7 +534,7 @@ exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS)
|
||||||
|
|
||||||
# Token matching regexes.
|
# Token matching regexes.
|
||||||
IDENTIFIER = /// ^
|
IDENTIFIER = /// ^
|
||||||
( [$A-Za-z_][$\w]* )
|
( [$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]* )
|
||||||
( [^\n\S]* : (?!:) )? # Is this a property name?
|
( [^\n\S]* : (?!:) )? # Is this a property name?
|
||||||
///
|
///
|
||||||
|
|
||||||
|
@ -591,7 +591,7 @@ MULTILINER = /\n/g
|
||||||
|
|
||||||
HEREDOC_INDENT = /\n+([^\n\S]*)/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* (?: , | \??\.(?!\.) | :: ) ///
|
LINE_CONTINUER = /// ^ \s* (?: , | \??\.(?!\.) | :: ) ///
|
||||||
|
|
||||||
|
|
|
@ -856,7 +856,7 @@ exports.Assign = class Assign extends Base
|
||||||
@param = options and options.param
|
@param = options and options.param
|
||||||
|
|
||||||
# Matchers for detecting class/method names
|
# 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']
|
children: ['variable', 'value']
|
||||||
|
|
||||||
|
@ -1735,7 +1735,7 @@ TAB = ' '
|
||||||
# with Git.
|
# with Git.
|
||||||
TRAILING_WHITESPACE = /[ \t]+$/gm
|
TRAILING_WHITESPACE = /[ \t]+$/gm
|
||||||
|
|
||||||
IDENTIFIER = /^[$A-Za-z_][$\w]*$/
|
IDENTIFIER = /^[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*$/
|
||||||
SIMPLENUM = /^[+-]?\d+$/
|
SIMPLENUM = /^[+-]?\d+$/
|
||||||
|
|
||||||
# Is a literal value a string?
|
# Is a literal value a string?
|
||||||
|
|
|
@ -268,3 +268,7 @@ six: -> 10
|
||||||
|
|
||||||
ok not one.six
|
ok not one.six
|
||||||
|
|
||||||
|
|
||||||
|
# Issue #986: Unicode identifiers.
|
||||||
|
λ = 5
|
||||||
|
eq λ, 5
|
||||||
|
|
Loading…
Reference in New Issue