diff --git a/documentation/index.html.erb b/documentation/index.html.erb index d2508e3e..11a7610d 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -1,7 +1,7 @@ <% require 'uv' def code_for(file, executable=false) - @stripper ||= /(\A\(function\(\)\{\n|\}\)\(\);\Z|^ )/ + @stripper ||= /(\A\(function\(\)\{\n|\}\)\(\);\n*\Z|^ )/ return '' unless File.exists?("documentation/js/#{file}.js") cs = File.read("documentation/coffee/#{file}.coffee") js = File.read("documentation/js/#{file}.js").gsub(@stripper, '') @@ -138,7 +138,7 @@ alert reverse '!tpircseeffoC'

- The CoffeeScript compiler is written in pure CoffeeScript, using a + The CoffeeScript compiler is written in pure CoffeeScript, using a small DSL on top of the Jison parser generator, and is available as a Node.js utility. The core compiler however, @@ -214,6 +214,14 @@ sudo bin/cake install conjunction with --watch) + + -s, --stdio + + Pipe in CoffeeScript to STDIN and get back JavaScript over STDOUT. + Good for use with processes written in other languages. An example:
+ cat src/cake.coffee | coffee -s + + -e, --eval @@ -744,7 +752,7 @@ coffee --print app/scripts/*.coffee > concatenation.js Change Log - +

0.5.1 Improvements to null soaking with the existential operator, including diff --git a/documentation/js/aliases.js b/documentation/js/aliases.js index 944c5856..b2356fe9 100644 --- a/documentation/js/aliases.js +++ b/documentation/js/aliases.js @@ -11,4 +11,4 @@ } car.speed < speed_limit ? accelerate() : null; print("My name is " + this.name); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/arguments.js b/documentation/js/arguments.js index 09aa0e35..87722e6d 100644 --- a/documentation/js/arguments.js +++ b/documentation/js/arguments.js @@ -5,4 +5,4 @@ return alert(arguments.reverse()); }; backwards("stairway", "to", "heaven"); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/array_comprehensions.js b/documentation/js/array_comprehensions.js index 167dd01d..cdf1e8e2 100644 --- a/documentation/js/array_comprehensions.js +++ b/documentation/js/array_comprehensions.js @@ -23,4 +23,4 @@ } } } -})(); \ No newline at end of file +})(); diff --git a/documentation/js/assignment.js b/documentation/js/assignment.js index 69bd8eb2..5dbd5e24 100644 --- a/documentation/js/assignment.js +++ b/documentation/js/assignment.js @@ -2,4 +2,4 @@ var difficulty, greeting; greeting = "Hello CoffeeScript"; difficulty = 0.5; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/cake_tasks.js b/documentation/js/cake_tasks.js index f1953a8f..ab96a5b9 100644 --- a/documentation/js/cake_tasks.js +++ b/documentation/js/cake_tasks.js @@ -11,4 +11,4 @@ } return _a; }); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/comparisons.js b/documentation/js/comparisons.js index c4e97b2d..f7570581 100644 --- a/documentation/js/comparisons.js +++ b/documentation/js/comparisons.js @@ -2,4 +2,4 @@ var cholesterol, healthy; cholesterol = 127; healthy = (200 > cholesterol) && (cholesterol > 60); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/conditionals.js b/documentation/js/conditionals.js index cb805671..22366f27 100644 --- a/documentation/js/conditionals.js +++ b/documentation/js/conditionals.js @@ -9,4 +9,4 @@ } date = friday ? sue : jill; expensive = expensive || do_the_math(); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/embedded.js b/documentation/js/embedded.js index d097f260..878acd86 100644 --- a/documentation/js/embedded.js +++ b/documentation/js/embedded.js @@ -3,4 +3,4 @@ hi = function() { return [document.title, "Hello JavaScript"].join(": "); }; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/existence.js b/documentation/js/existence.js index 9ac6438f..f2c353d2 100644 --- a/documentation/js/existence.js +++ b/documentation/js/existence.js @@ -4,4 +4,4 @@ solipsism = true; } speed = (typeof speed !== "undefined" && speed !== null) ? speed : 140; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/expressions.js b/documentation/js/expressions.js index eb2e983b..78be4173 100644 --- a/documentation/js/expressions.js +++ b/documentation/js/expressions.js @@ -10,4 +10,4 @@ } }; eldest = 24 > 21 ? "Liz" : "Ike"; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/expressions_assignment.js b/documentation/js/expressions_assignment.js index 903dca1f..4b697618 100644 --- a/documentation/js/expressions_assignment.js +++ b/documentation/js/expressions_assignment.js @@ -1,4 +1,4 @@ (function(){ var one, six, three, two; six = ((one = 1)) + ((two = 2)) + ((three = 3)); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/expressions_comprehension.js b/documentation/js/expressions_comprehension.js index ce2e771c..0c9f37f7 100644 --- a/documentation/js/expressions_comprehension.js +++ b/documentation/js/expressions_comprehension.js @@ -9,4 +9,4 @@ }} return _a; }).call(this).slice(0, 10); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/expressions_try.js b/documentation/js/expressions_try.js index 79c77e40..c2f8cb9d 100644 --- a/documentation/js/expressions_try.js +++ b/documentation/js/expressions_try.js @@ -6,4 +6,4 @@ return "And the error is ... " + error; } }).call(this)); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/fat_arrow.js b/documentation/js/fat_arrow.js index f7a08321..03dfd37a 100644 --- a/documentation/js/fat_arrow.js +++ b/documentation/js/fat_arrow.js @@ -12,4 +12,4 @@ }); })(this)); }; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/functions.js b/documentation/js/functions.js index 80c17344..e1046177 100644 --- a/documentation/js/functions.js +++ b/documentation/js/functions.js @@ -6,4 +6,4 @@ cube = function cube(x) { return square(x) * x; }; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/heredocs.js b/documentation/js/heredocs.js index a523ff72..a7a75b5a 100644 --- a/documentation/js/heredocs.js +++ b/documentation/js/heredocs.js @@ -1,4 +1,4 @@ (function(){ var html; html = "\n cup of coffeescript\n"; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/multiple_return_values.js b/documentation/js/multiple_return_values.js index 1fa3edad..20e17d35 100644 --- a/documentation/js/multiple_return_values.js +++ b/documentation/js/multiple_return_values.js @@ -8,4 +8,4 @@ city = _a[0]; temp = _a[1]; forecast = _a[2]; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/object_comprehensions.js b/documentation/js/object_comprehensions.js index 0efcc499..914391d1 100644 --- a/documentation/js/object_comprehensions.js +++ b/documentation/js/object_comprehensions.js @@ -14,4 +14,4 @@ }} return _a; }).call(this); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/object_extraction.js b/documentation/js/object_extraction.js index 85c5cfca..acb099c6 100644 --- a/documentation/js/object_extraction.js +++ b/documentation/js/object_extraction.js @@ -14,4 +14,4 @@ _c = _b.address; street = _c[0]; city = _c[1]; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/objects_and_arrays.js b/documentation/js/objects_and_arrays.js index 3c7de98f..2906a153 100644 --- a/documentation/js/objects_and_arrays.js +++ b/documentation/js/objects_and_arrays.js @@ -7,4 +7,4 @@ tim: 11 }; matrix = [1, 0, 1, 0, 0, 1, 1, 1, 0]; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/overview.js b/documentation/js/overview.js index df2f08c7..7f8c01a6 100644 --- a/documentation/js/overview.js +++ b/documentation/js/overview.js @@ -40,4 +40,4 @@ } return _a; }).call(this); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/parallel_assignment.js b/documentation/js/parallel_assignment.js index a5c34853..4984f084 100644 --- a/documentation/js/parallel_assignment.js +++ b/documentation/js/parallel_assignment.js @@ -5,4 +5,4 @@ _a = [and_switch, bait]; bait = _a[0]; and_switch = _a[1]; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/range_comprehensions.js b/documentation/js/range_comprehensions.js index 55bedd5c..848f63fe 100644 --- a/documentation/js/range_comprehensions.js +++ b/documentation/js/range_comprehensions.js @@ -18,4 +18,4 @@ } return _f; }; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/scope.js b/documentation/js/scope.js index 3319f50c..f1980c6c 100644 --- a/documentation/js/scope.js +++ b/documentation/js/scope.js @@ -7,4 +7,4 @@ return num = 10; }; new_num = change_numbers(); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/slices.js b/documentation/js/slices.js index d819c4ae..a1908c4b 100644 --- a/documentation/js/slices.js +++ b/documentation/js/slices.js @@ -3,4 +3,4 @@ numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; three_to_six = numbers.slice(3, 6 + 1); numbers_copy = numbers.slice(0, numbers.length); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/soaks.js b/documentation/js/soaks.js index 8439ef6c..d4dbd13c 100644 --- a/documentation/js/soaks.js +++ b/documentation/js/soaks.js @@ -1,4 +1,4 @@ (function(){ var _a; (_a = lottery.draw_winner()) == undefined ? undefined : _a.address == undefined ? undefined : _a.address.zipcode; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/splats.js b/documentation/js/splats.js index 052437fe..eab92d9b 100644 --- a/documentation/js/splats.js +++ b/documentation/js/splats.js @@ -13,4 +13,4 @@ alert("Gold: " + gold); alert("Silver: " + silver); alert("The Field: " + the_field); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/splices.js b/documentation/js/splices.js index 0192c5e5..9af56404 100644 --- a/documentation/js/splices.js +++ b/documentation/js/splices.js @@ -2,4 +2,4 @@ var numbers; numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; numbers.splice.apply(numbers, [3, 6 - 3 + 1].concat([-3, -4, -5, -6])); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/strings.js b/documentation/js/strings.js index 0b486548..bc5f9b64 100644 --- a/documentation/js/strings.js +++ b/documentation/js/strings.js @@ -6,4 +6,4 @@ or no money in my purse, and nothing particular \ to interest me on shore, I thought I would sail \ about a little and see the watery part of the \ world..."; -})(); \ No newline at end of file +})(); diff --git a/documentation/js/super.js b/documentation/js/super.js index 210776fc..b93c939c 100644 --- a/documentation/js/super.js +++ b/documentation/js/super.js @@ -34,4 +34,4 @@ tom = new Horse("Tommy the Palomino"); sam.move(); tom.move(); -})(); \ No newline at end of file +})(); diff --git a/documentation/js/switch.js b/documentation/js/switch.js index 77e9a77d..43e5b86a 100644 --- a/documentation/js/switch.js +++ b/documentation/js/switch.js @@ -15,4 +15,4 @@ } else { go_to_work(); } -})(); \ No newline at end of file +})(); diff --git a/documentation/js/try.js b/documentation/js/try.js index a2995e6d..a12f91f6 100644 --- a/documentation/js/try.js +++ b/documentation/js/try.js @@ -7,4 +7,4 @@ } finally { clean_up(); } -})(); \ No newline at end of file +})(); diff --git a/documentation/js/while.js b/documentation/js/while.js index 326fa138..312b2399 100644 --- a/documentation/js/while.js +++ b/documentation/js/while.js @@ -19,4 +19,4 @@ One fell out and bumped his head."); } return _a; }).call(this); -})(); \ No newline at end of file +})(); diff --git a/index.html b/index.html index d57d72a7..78ed82dd 100644 --- a/index.html +++ b/index.html @@ -235,7 +235,7 @@ cubed_list = (function() {

- The CoffeeScript compiler is written in pure CoffeeScript, using a + The CoffeeScript compiler is written in pure CoffeeScript, using a small DSL on top of the Jison parser generator, and is available as a Node.js utility. The core compiler however, @@ -311,6 +311,14 @@ sudo bin/cake install conjunction with --watch) + + -s, --stdio + + Pipe in CoffeeScript to STDIN and get back JavaScript over STDOUT. + Good for use with processes written in other languages. An example:
+ cat src/cake.coffee | coffee -s + + -e, --eval @@ -1624,7 +1632,7 @@ task('test Change Log - +

0.5.1 Improvements to null soaking with the existential operator, including diff --git a/src/command_line.coffee b/src/command_line.coffee index 5a1ca774..bc9c6a29 100644 --- a/src/command_line.coffee +++ b/src/command_line.coffee @@ -19,9 +19,9 @@ SWITCHES: [ ['-l', '--lint', 'pipe the compiled JavaScript through JSLint'] ['-s', '--stdio', 'listen for and compile scripts over stdio'] ['-e', '--eval', 'compile a string from the command line'] + ['-n', '--no-wrap', 'compile without the top-level function wrapper'] ['-t', '--tokens', 'print the tokens that the lexer produces'] ['-tr','--tree', 'print the parse tree that Jison produces'] - ['-n', '--no-wrap', 'compile without the top-level function wrapper'] ['-v', '--version', 'display CoffeeScript version'] ['-h', '--help', 'display this help message'] ]