haml-more 0.4.0.a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. data/README.md +79 -0
  2. data/lib/haml/more/coffee_script.rb +137 -0
  3. data/lib/haml/more/content_for.rb +25 -0
  4. data/lib/haml/more.rb +45 -0
  5. data/lib/haml-more.rb +1 -0
  6. data/lib/sass/more.rb +16 -0
  7. data/lib/sass-more.rb +1 -0
  8. data/spec/sass/more_spec.rb +21 -0
  9. data/vendor/coffee-script/Cakefile +57 -0
  10. data/vendor/coffee-script/LICENSE +22 -0
  11. data/vendor/coffee-script/README +41 -0
  12. data/vendor/coffee-script/Rakefile +20 -0
  13. data/vendor/coffee-script/bin/cake +7 -0
  14. data/vendor/coffee-script/bin/coffee +7 -0
  15. data/vendor/coffee-script/documentation/coffee/aliases.coffee +9 -0
  16. data/vendor/coffee-script/documentation/coffee/arguments.coffee +4 -0
  17. data/vendor/coffee-script/documentation/coffee/array_comprehensions.coffee +7 -0
  18. data/vendor/coffee-script/documentation/coffee/assignment.coffee +2 -0
  19. data/vendor/coffee-script/documentation/coffee/cake_tasks.coffee +5 -0
  20. data/vendor/coffee-script/documentation/coffee/comparisons.coffee +5 -0
  21. data/vendor/coffee-script/documentation/coffee/conditionals.coffee +9 -0
  22. data/vendor/coffee-script/documentation/coffee/embedded.coffee +5 -0
  23. data/vendor/coffee-script/documentation/coffee/existence.coffee +8 -0
  24. data/vendor/coffee-script/documentation/coffee/expressions.coffee +9 -0
  25. data/vendor/coffee-script/documentation/coffee/expressions_assignment.coffee +1 -0
  26. data/vendor/coffee-script/documentation/coffee/expressions_comprehension.coffee +3 -0
  27. data/vendor/coffee-script/documentation/coffee/expressions_try.coffee +6 -0
  28. data/vendor/coffee-script/documentation/coffee/fat_arrow.coffee +6 -0
  29. data/vendor/coffee-script/documentation/coffee/functions.coffee +2 -0
  30. data/vendor/coffee-script/documentation/coffee/heredocs.coffee +5 -0
  31. data/vendor/coffee-script/documentation/coffee/multiple_return_values.coffee +5 -0
  32. data/vendor/coffee-script/documentation/coffee/object_comprehensions.coffee +4 -0
  33. data/vendor/coffee-script/documentation/coffee/object_extraction.coffee +13 -0
  34. data/vendor/coffee-script/documentation/coffee/objects_and_arrays.coffee +13 -0
  35. data/vendor/coffee-script/documentation/coffee/overview.coffee +29 -0
  36. data/vendor/coffee-script/documentation/coffee/parallel_assignment.coffee +4 -0
  37. data/vendor/coffee-script/documentation/coffee/range_comprehensions.coffee +6 -0
  38. data/vendor/coffee-script/documentation/coffee/scope.coffee +5 -0
  39. data/vendor/coffee-script/documentation/coffee/slices.coffee +6 -0
  40. data/vendor/coffee-script/documentation/coffee/soaks.coffee +1 -0
  41. data/vendor/coffee-script/documentation/coffee/splats.coffee +25 -0
  42. data/vendor/coffee-script/documentation/coffee/splices.coffee +5 -0
  43. data/vendor/coffee-script/documentation/coffee/strings.coffee +8 -0
  44. data/vendor/coffee-script/documentation/coffee/super.coffee +34 -0
  45. data/vendor/coffee-script/documentation/coffee/switch.coffee +10 -0
  46. data/vendor/coffee-script/documentation/coffee/try.coffee +7 -0
  47. data/vendor/coffee-script/documentation/coffee/while.coffee +10 -0
  48. data/vendor/coffee-script/documentation/css/docs.css +213 -0
  49. data/vendor/coffee-script/documentation/css/idle.css +63 -0
  50. data/vendor/coffee-script/documentation/css/logo.png +0 -0
  51. data/vendor/coffee-script/documentation/index.html.erb +967 -0
  52. data/vendor/coffee-script/documentation/js/aliases.js +14 -0
  53. data/vendor/coffee-script/documentation/js/arguments.js +8 -0
  54. data/vendor/coffee-script/documentation/js/array_comprehensions.js +26 -0
  55. data/vendor/coffee-script/documentation/js/assignment.js +5 -0
  56. data/vendor/coffee-script/documentation/js/cake_tasks.js +14 -0
  57. data/vendor/coffee-script/documentation/js/comparisons.js +5 -0
  58. data/vendor/coffee-script/documentation/js/conditionals.js +12 -0
  59. data/vendor/coffee-script/documentation/js/embedded.js +6 -0
  60. data/vendor/coffee-script/documentation/js/existence.js +7 -0
  61. data/vendor/coffee-script/documentation/js/expressions.js +13 -0
  62. data/vendor/coffee-script/documentation/js/expressions_assignment.js +4 -0
  63. data/vendor/coffee-script/documentation/js/expressions_comprehension.js +12 -0
  64. data/vendor/coffee-script/documentation/js/expressions_try.js +9 -0
  65. data/vendor/coffee-script/documentation/js/fat_arrow.js +15 -0
  66. data/vendor/coffee-script/documentation/js/functions.js +9 -0
  67. data/vendor/coffee-script/documentation/js/heredocs.js +4 -0
  68. data/vendor/coffee-script/documentation/js/intro.js +7 -0
  69. data/vendor/coffee-script/documentation/js/multiple_return_values.js +11 -0
  70. data/vendor/coffee-script/documentation/js/object_comprehensions.js +17 -0
  71. data/vendor/coffee-script/documentation/js/object_extraction.js +17 -0
  72. data/vendor/coffee-script/documentation/js/objects_and_arrays.js +10 -0
  73. data/vendor/coffee-script/documentation/js/overview.js +43 -0
  74. data/vendor/coffee-script/documentation/js/parallel_assignment.js +8 -0
  75. data/vendor/coffee-script/documentation/js/punctuation.js +8 -0
  76. data/vendor/coffee-script/documentation/js/range_comprehensions.js +21 -0
  77. data/vendor/coffee-script/documentation/js/scope.js +10 -0
  78. data/vendor/coffee-script/documentation/js/slices.js +6 -0
  79. data/vendor/coffee-script/documentation/js/soaks.js +4 -0
  80. data/vendor/coffee-script/documentation/js/splats.js +16 -0
  81. data/vendor/coffee-script/documentation/js/splices.js +5 -0
  82. data/vendor/coffee-script/documentation/js/strings.js +9 -0
  83. data/vendor/coffee-script/documentation/js/super.js +37 -0
  84. data/vendor/coffee-script/documentation/js/switch.js +18 -0
  85. data/vendor/coffee-script/documentation/js/try.js +10 -0
  86. data/vendor/coffee-script/documentation/js/while.js +22 -0
  87. data/vendor/coffee-script/documentation/underscore.html +627 -0
  88. data/vendor/coffee-script/examples/beautiful_code/binary_search.coffee +16 -0
  89. data/vendor/coffee-script/examples/beautiful_code/quicksort_runtime.coffee +13 -0
  90. data/vendor/coffee-script/examples/beautiful_code/regular_expression_matcher.coffee +34 -0
  91. data/vendor/coffee-script/examples/blocks.coffee +57 -0
  92. data/vendor/coffee-script/examples/code.coffee +173 -0
  93. data/vendor/coffee-script/examples/computer_science/README +4 -0
  94. data/vendor/coffee-script/examples/computer_science/binary_search.coffee +25 -0
  95. data/vendor/coffee-script/examples/computer_science/bubble_sort.coffee +11 -0
  96. data/vendor/coffee-script/examples/computer_science/linked_list.coffee +106 -0
  97. data/vendor/coffee-script/examples/computer_science/luhn_algorithm.coffee +36 -0
  98. data/vendor/coffee-script/examples/computer_science/merge_sort.coffee +19 -0
  99. data/vendor/coffee-script/examples/computer_science/selection_sort.coffee +23 -0
  100. data/vendor/coffee-script/examples/poignant.coffee +186 -0
  101. data/vendor/coffee-script/examples/potion.coffee +205 -0
  102. data/vendor/coffee-script/examples/underscore.coffee +603 -0
  103. data/vendor/coffee-script/examples/web_server.coffee +12 -0
  104. data/vendor/coffee-script/extras/CoffeeScript.tmbundle/Preferences/CoffeeScript.tmPreferences +24 -0
  105. data/vendor/coffee-script/extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage +361 -0
  106. data/vendor/coffee-script/extras/CoffeeScript.tmbundle/info.plist +10 -0
  107. data/vendor/coffee-script/extras/EXTRAS +20 -0
  108. data/vendor/coffee-script/extras/coffee.vim +117 -0
  109. data/vendor/coffee-script/index.html +1847 -0
  110. data/vendor/coffee-script/lib/bin/cake +7 -0
  111. data/vendor/coffee-script/lib/bin/coffee +7 -0
  112. data/vendor/coffee-script/lib/cake.js +80 -0
  113. data/vendor/coffee-script/lib/coffee-script.js +61 -0
  114. data/vendor/coffee-script/lib/command_line.js +201 -0
  115. data/vendor/coffee-script/lib/grammar.js +564 -0
  116. data/vendor/coffee-script/lib/lexer.js +405 -0
  117. data/vendor/coffee-script/lib/narwhal.js +44 -0
  118. data/vendor/coffee-script/lib/nodes.js +1328 -0
  119. data/vendor/coffee-script/lib/optparse.js +117 -0
  120. data/vendor/coffee-script/lib/parser.js +536 -0
  121. data/vendor/coffee-script/lib/repl.js +32 -0
  122. data/vendor/coffee-script/lib/rewriter.js +383 -0
  123. data/vendor/coffee-script/lib/scope.js +114 -0
  124. data/vendor/coffee-script/package.json +7 -0
  125. data/vendor/coffee-script/src/cake.coffee +45 -0
  126. data/vendor/coffee-script/src/coffee-script.coffee +45 -0
  127. data/vendor/coffee-script/src/command_line.coffee +130 -0
  128. data/vendor/coffee-script/src/grammar.coffee +456 -0
  129. data/vendor/coffee-script/src/lexer.coffee +327 -0
  130. data/vendor/coffee-script/src/narwhal.coffee +42 -0
  131. data/vendor/coffee-script/src/nodes.coffee +1045 -0
  132. data/vendor/coffee-script/src/optparse.coffee +79 -0
  133. data/vendor/coffee-script/src/repl.coffee +23 -0
  134. data/vendor/coffee-script/src/rewriter.coffee +253 -0
  135. data/vendor/coffee-script/src/scope.coffee +75 -0
  136. data/vendor/coffee-script/test/test_arguments.coffee +34 -0
  137. data/vendor/coffee-script/test/test_array_comprehension.coffee +42 -0
  138. data/vendor/coffee-script/test/test_assignment.coffee +26 -0
  139. data/vendor/coffee-script/test/test_blocks.coffee +4 -0
  140. data/vendor/coffee-script/test/test_calling_super.coffee +42 -0
  141. data/vendor/coffee-script/test/test_chained_calls.coffee +25 -0
  142. data/vendor/coffee-script/test/test_destructuring_assignment.coffee +62 -0
  143. data/vendor/coffee-script/test/test_everything.coffee +29 -0
  144. data/vendor/coffee-script/test/test_exceptions.coffee +2 -0
  145. data/vendor/coffee-script/test/test_existence.coffee +81 -0
  146. data/vendor/coffee-script/test/test_expressions.coffee +30 -0
  147. data/vendor/coffee-script/test/test_fancy_if_statement.coffee +26 -0
  148. data/vendor/coffee-script/test/test_functions.coffee +80 -0
  149. data/vendor/coffee-script/test/test_funky_comments.coffee +25 -0
  150. data/vendor/coffee-script/test/test_heredocs.coffee +46 -0
  151. data/vendor/coffee-script/test/test_lexical_scope.coffee +10 -0
  152. data/vendor/coffee-script/test/test_literals.coffee +56 -0
  153. data/vendor/coffee-script/test/test_nested_comprehensions.coffee +11 -0
  154. data/vendor/coffee-script/test/test_newline_escaping.coffee +6 -0
  155. data/vendor/coffee-script/test/test_operations.coffee +18 -0
  156. data/vendor/coffee-script/test/test_range_comprehension.coffee +20 -0
  157. data/vendor/coffee-script/test/test_ranges_and_slices.coffee +16 -0
  158. data/vendor/coffee-script/test/test_splats.coffee +47 -0
  159. data/vendor/coffee-script/test/test_splices.coffee +5 -0
  160. data/vendor/coffee-script/test/test_switch.coffee +64 -0
  161. data/vendor/coffee-script/test/test_while.coffee +30 -0
  162. data/vendor/coffee-script/vendor/jison/Jakefile +31 -0
  163. data/vendor/coffee-script/vendor/jison/README.md +347 -0
  164. data/vendor/coffee-script/vendor/jison/bin/jison +3 -0
  165. data/vendor/coffee-script/vendor/jison/bin/json2jison +3 -0
  166. data/vendor/coffee-script/vendor/jison/examples/ansic.jison +415 -0
  167. data/vendor/coffee-script/vendor/jison/examples/basic.json +8 -0
  168. data/vendor/coffee-script/vendor/jison/examples/basic2.json +9 -0
  169. data/vendor/coffee-script/vendor/jison/examples/basic2_lex.json +16 -0
  170. data/vendor/coffee-script/vendor/jison/examples/basic_lex.json +15 -0
  171. data/vendor/coffee-script/vendor/jison/examples/calculator.jison +38 -0
  172. data/vendor/coffee-script/vendor/jison/examples/calculator.jisonlex +14 -0
  173. data/vendor/coffee-script/vendor/jison/examples/calculator.json +42 -0
  174. data/vendor/coffee-script/vendor/jison/examples/classy.json +105 -0
  175. data/vendor/coffee-script/vendor/jison/examples/classy_ast.json +126 -0
  176. data/vendor/coffee-script/vendor/jison/examples/dism.json +25 -0
  177. data/vendor/coffee-script/vendor/jison/examples/dism_lr0.json +26 -0
  178. data/vendor/coffee-script/vendor/jison/examples/json.js +80 -0
  179. data/vendor/coffee-script/vendor/jison/examples/json_ast.js +83 -0
  180. data/vendor/coffee-script/vendor/jison/examples/precedence.json +26 -0
  181. data/vendor/coffee-script/vendor/jison/examples/reduce_conflict.json +13 -0
  182. data/vendor/coffee-script/vendor/jison/lib/jison/bnf.js +43 -0
  183. data/vendor/coffee-script/vendor/jison/lib/jison/jisonlex.js +18 -0
  184. data/vendor/coffee-script/vendor/jison/lib/jison/json2jison.js +146 -0
  185. data/vendor/coffee-script/vendor/jison/lib/jison/lexer.js +224 -0
  186. data/vendor/coffee-script/vendor/jison/lib/jison/util/bnf-parser.js +383 -0
  187. data/vendor/coffee-script/vendor/jison/lib/jison/util/lex-parser.js +407 -0
  188. data/vendor/coffee-script/vendor/jison/lib/jison/util/set.js +94 -0
  189. data/vendor/coffee-script/vendor/jison/lib/jison/util/typal.js +90 -0
  190. data/vendor/coffee-script/vendor/jison/lib/jison.js +1414 -0
  191. data/vendor/coffee-script/vendor/jison/package.json +14 -0
  192. data/vendor/coffee-script/vendor/jison/src/bnf.jison +110 -0
  193. data/vendor/coffee-script/vendor/jison/src/bnf.jisonlex +25 -0
  194. data/vendor/coffee-script/vendor/jison/src/bnf.lex.json +24 -0
  195. data/vendor/coffee-script/vendor/jison/src/jisonlex.jison +129 -0
  196. data/vendor/coffee-script/vendor/jison/src/jisonlex.jisonlex +31 -0
  197. data/vendor/coffee-script/vendor/jison/src/jisonlex.lex.json +30 -0
  198. data/vendor/coffee-script/vendor/jison/tests/all-tests.js +8 -0
  199. data/vendor/coffee-script/vendor/jison/tests/grammar/bnf.js +91 -0
  200. data/vendor/coffee-script/vendor/jison/tests/grammar/bnf_parse.js +65 -0
  201. data/vendor/coffee-script/vendor/jison/tests/grammar/grammar-tests.js +10 -0
  202. data/vendor/coffee-script/vendor/jison/tests/grammar/json2jison.js +24 -0
  203. data/vendor/coffee-script/vendor/jison/tests/grammar/lex/ansic.jisonlex +115 -0
  204. data/vendor/coffee-script/vendor/jison/tests/grammar/lex/bnf.jisonlex +25 -0
  205. data/vendor/coffee-script/vendor/jison/tests/grammar/lex/bnf.lex.json +24 -0
  206. data/vendor/coffee-script/vendor/jison/tests/grammar/lex/lex_grammar.jisonlex +31 -0
  207. data/vendor/coffee-script/vendor/jison/tests/grammar/lex/lex_grammar.lex.json +30 -0
  208. data/vendor/coffee-script/vendor/jison/tests/grammar/lex.jison +119 -0
  209. data/vendor/coffee-script/vendor/jison/tests/grammar/lex.js +58 -0
  210. data/vendor/coffee-script/vendor/jison/tests/grammar/lex_parse.js +117 -0
  211. data/vendor/coffee-script/vendor/jison/tests/lexer/lexer-tests.js +6 -0
  212. data/vendor/coffee-script/vendor/jison/tests/lexer/regexplexer.js +417 -0
  213. data/vendor/coffee-script/vendor/jison/tests/parser/actions.js +311 -0
  214. data/vendor/coffee-script/vendor/jison/tests/parser/api.js +236 -0
  215. data/vendor/coffee-script/vendor/jison/tests/parser/generator.js +196 -0
  216. data/vendor/coffee-script/vendor/jison/tests/parser/lalr.js +183 -0
  217. data/vendor/coffee-script/vendor/jison/tests/parser/lr0.js +72 -0
  218. data/vendor/coffee-script/vendor/jison/tests/parser/lr1.js +119 -0
  219. data/vendor/coffee-script/vendor/jison/tests/parser/parser-tests.js +14 -0
  220. data/vendor/coffee-script/vendor/jison/tests/parser/precedence.js +237 -0
  221. data/vendor/coffee-script/vendor/jison/tests/parser/slr.js +52 -0
  222. data/vendor/coffee-script/vendor/jison/tests/parser/tables.js +126 -0
  223. data/vendor/coffee-script/vendor/jison/tests/performance.js +110 -0
  224. data/vendor/coffee-script/vendor/jison/tests/setup.js +3 -0
  225. metadata +324 -0
@@ -0,0 +1,14 @@
1
+ (function(){
2
+ var volume;
3
+ if (ignition === true) {
4
+ launch();
5
+ }
6
+ if (band !== spinal_tap) {
7
+ volume = 10;
8
+ }
9
+ if (!(answer === false)) {
10
+ let_the_wild_rumpus_begin();
11
+ }
12
+ car.speed < speed_limit ? accelerate() : null;
13
+ print("My name is " + this.name);
14
+ })();
@@ -0,0 +1,8 @@
1
+ (function(){
2
+ var backwards;
3
+ backwards = function backwards() {
4
+ arguments = Array.prototype.slice.call(arguments, 0);
5
+ return alert(arguments.reverse());
6
+ };
7
+ backwards("stairway", "to", "heaven");
8
+ })();
@@ -0,0 +1,26 @@
1
+ (function(){
2
+ var _a, _b, _c, _d, _e, _f, _g, food, lunch, roid, roid2;
3
+ // Eat lunch.
4
+ lunch = (function() {
5
+ _a = []; _b = ['toast', 'cheese', 'wine'];
6
+ for (_c = 0; _c < _b.length; _c++) {
7
+ food = _b[_c];
8
+ _a.push(eat(food));
9
+ }
10
+ return _a;
11
+ }).call(this);
12
+ // Naive collision detection.
13
+ _d = asteroids;
14
+ for (_e = 0; _e < _d.length; _e++) {
15
+ roid = _d[_e];
16
+ _f = asteroids;
17
+ for (_g = 0; _g < _f.length; _g++) {
18
+ roid2 = _f[_g];
19
+ if (roid !== roid2) {
20
+ if (roid.overlaps(roid2)) {
21
+ roid.explode();
22
+ }
23
+ }
24
+ }
25
+ }
26
+ })();
@@ -0,0 +1,5 @@
1
+ (function(){
2
+ var difficulty, greeting;
3
+ greeting = "Hello CoffeeScript";
4
+ difficulty = 0.5;
5
+ })();
@@ -0,0 +1,14 @@
1
+ (function(){
2
+ process.mixin(require('assert'));
3
+ task('test', 'run each of the unit tests', function() {
4
+ var _a, _b, _c, test;
5
+ _a = []; _b = test_files;
6
+ for (_c = 0; _c < _b.length; _c++) {
7
+ test = _b[_c];
8
+ _a.push(fs.readFile(test, function(err, code) {
9
+ return eval(coffee.compile(code));
10
+ }));
11
+ }
12
+ return _a;
13
+ });
14
+ })();
@@ -0,0 +1,5 @@
1
+ (function(){
2
+ var cholesterol, healthy;
3
+ cholesterol = 127;
4
+ healthy = (200 > cholesterol) && (cholesterol > 60);
5
+ })();
@@ -0,0 +1,12 @@
1
+ (function(){
2
+ var date, expensive, mood;
3
+ if (singing) {
4
+ mood = greatly_improved;
5
+ }
6
+ if (happy && knows_it) {
7
+ claps_hands();
8
+ cha_cha_cha();
9
+ }
10
+ date = friday ? sue : jill;
11
+ expensive = expensive || do_the_math();
12
+ })();
@@ -0,0 +1,6 @@
1
+ (function(){
2
+ var hi;
3
+ hi = function() {
4
+ return [document.title, "Hello JavaScript"].join(": ");
5
+ };
6
+ })();
@@ -0,0 +1,7 @@
1
+ (function(){
2
+ var solipsism, speed;
3
+ if ((typeof mind !== "undefined" && mind !== null) && !(typeof world !== "undefined" && world !== null)) {
4
+ solipsism = true;
5
+ }
6
+ speed = (typeof speed !== "undefined" && speed !== null) ? speed : 140;
7
+ })();
@@ -0,0 +1,13 @@
1
+ (function(){
2
+ var eldest, grade;
3
+ grade = function grade(student) {
4
+ if (student.excellent_work) {
5
+ return "A+";
6
+ } else if (student.okay_stuff) {
7
+ return student.tried_hard ? "B" : "B-";
8
+ } else {
9
+ return "C";
10
+ }
11
+ };
12
+ eldest = 24 > 21 ? "Liz" : "Ike";
13
+ })();
@@ -0,0 +1,4 @@
1
+ (function(){
2
+ var one, six, three, two;
3
+ six = ((one = 1)) + ((two = 2)) + ((three = 3));
4
+ })();
@@ -0,0 +1,12 @@
1
+ (function(){
2
+ var _a, _b, globals, name;
3
+ var __hasProp = Object.prototype.hasOwnProperty;
4
+ // The first ten global properties.
5
+ globals = (function() {
6
+ _a = []; _b = window;
7
+ for (name in _b) { if (__hasProp.call(_b, name)) {
8
+ _a.push(name);
9
+ }}
10
+ return _a;
11
+ }).call(this).slice(0, 10);
12
+ })();
@@ -0,0 +1,9 @@
1
+ (function(){
2
+ alert((function() {
3
+ try {
4
+ return nonexistent / undefined;
5
+ } catch (error) {
6
+ return "And the error is ... " + error;
7
+ }
8
+ }).call(this));
9
+ })();
@@ -0,0 +1,15 @@
1
+ (function(){
2
+ var Account;
3
+ Account = function Account(customer, cart) {
4
+ this.customer = customer;
5
+ this.cart = cart;
6
+ return $('.shopping_cart').bind('click', (function(__this) {
7
+ var __func = function(event) {
8
+ return this.customer.purchase(this.cart);
9
+ };
10
+ return (function() {
11
+ return __func.apply(__this, arguments);
12
+ });
13
+ })(this));
14
+ };
15
+ })();
@@ -0,0 +1,9 @@
1
+ (function(){
2
+ var cube, square;
3
+ square = function square(x) {
4
+ return x * x;
5
+ };
6
+ cube = function cube(x) {
7
+ return square(x) * x;
8
+ };
9
+ })();
@@ -0,0 +1,4 @@
1
+ (function(){
2
+ var html;
3
+ html = "<strong>\n cup of coffeescript\n</strong>";
4
+ })();
@@ -0,0 +1,7 @@
1
+ (function(){
2
+
3
+ // CoffeeScript on the left, JS on the right.
4
+ var square = function(x) {
5
+ return x * x;
6
+ };
7
+ })();
@@ -0,0 +1,11 @@
1
+ (function(){
2
+ var _a, city, forecast, temp, weather_report;
3
+ weather_report = function weather_report(location) {
4
+ // Make an Ajax request to fetch the weather...
5
+ return [location, 72, "Mostly Sunny"];
6
+ };
7
+ _a = weather_report("Berkeley, CA");
8
+ city = _a[0];
9
+ temp = _a[1];
10
+ forecast = _a[2];
11
+ })();
@@ -0,0 +1,17 @@
1
+ (function(){
2
+ var _a, _b, age, ages, child, years_old;
3
+ var __hasProp = Object.prototype.hasOwnProperty;
4
+ years_old = {
5
+ max: 10,
6
+ ida: 9,
7
+ tim: 11
8
+ };
9
+ ages = (function() {
10
+ _a = []; _b = years_old;
11
+ for (child in _b) { if (__hasProp.call(_b, child)) {
12
+ age = _b[child];
13
+ _a.push(child + " is " + age);
14
+ }}
15
+ return _a;
16
+ }).call(this);
17
+ })();
@@ -0,0 +1,17 @@
1
+ (function(){
2
+ var _a, _b, _c, city, futurists, poet, street;
3
+ futurists = {
4
+ sculptor: "Umberto Boccioni",
5
+ painter: "Vladimir Burliuk",
6
+ poet: {
7
+ name: "F.T. Marinetti",
8
+ address: ["Via Roma 42R", "Bellagio, Italy 22021"]
9
+ }
10
+ };
11
+ _a = futurists;
12
+ _b = _a.poet;
13
+ poet = _b.name;
14
+ _c = _b.address;
15
+ street = _c[0];
16
+ city = _c[1];
17
+ })();
@@ -0,0 +1,10 @@
1
+ (function(){
2
+ var ages, matrix, song;
3
+ song = ["do", "re", "mi", "fa", "so"];
4
+ ages = {
5
+ max: 10,
6
+ ida: 9,
7
+ tim: 11
8
+ };
9
+ matrix = [1, 0, 1, 0, 0, 1, 1, 1, 0];
10
+ })();
@@ -0,0 +1,43 @@
1
+ (function(){
2
+ var _a, _b, _c, cubed_list, list, math, num, number, opposite_day, race, square;
3
+ // Assignment:
4
+ number = 42;
5
+ opposite_day = true;
6
+ // Conditions:
7
+ if (opposite_day) {
8
+ number = -42;
9
+ }
10
+ // Functions:
11
+ square = function square(x) {
12
+ return x * x;
13
+ };
14
+ // Arrays:
15
+ list = [1, 2, 3, 4, 5];
16
+ // Objects:
17
+ math = {
18
+ root: Math.sqrt,
19
+ square: square,
20
+ cube: function cube(x) {
21
+ return x * square(x);
22
+ }
23
+ };
24
+ // Splats:
25
+ race = function race(winner) {
26
+ var runners;
27
+ runners = Array.prototype.slice.call(arguments, 1);
28
+ return print(winner, runners);
29
+ };
30
+ // Existence:
31
+ if ((typeof elvis !== "undefined" && elvis !== null)) {
32
+ alert("I knew it!");
33
+ }
34
+ // Array comprehensions:
35
+ cubed_list = (function() {
36
+ _a = []; _b = list;
37
+ for (_c = 0; _c < _b.length; _c++) {
38
+ num = _b[_c];
39
+ _a.push(math.cube(num));
40
+ }
41
+ return _a;
42
+ }).call(this);
43
+ })();
@@ -0,0 +1,8 @@
1
+ (function(){
2
+ var _a, and_switch, bait;
3
+ bait = 1000;
4
+ and_switch = 0;
5
+ _a = [and_switch, bait];
6
+ bait = _a[0];
7
+ and_switch = _a[1];
8
+ })();
@@ -0,0 +1,8 @@
1
+ (function(){
2
+
3
+ // Comments start with hash marks. Periods mark the end of a block.
4
+ var left_hand = raining ? umbrella : parasol;
5
+ // To signal the beginning of the next expression,
6
+ // use "then", or a newline.
7
+ left_hand = raining ? umbrella : parasol;
8
+ })();
@@ -0,0 +1,21 @@
1
+ (function(){
2
+ var _a, _b, _c, _d, _e, countdown, egg_delivery, num;
3
+ countdown = (function() {
4
+ _a = []; _d = 10; _e = 1;
5
+ for (_c = 0, num=_d; (_d <= _e ? num <= _e : num >= _e); (_d <= _e ? num += 1 : num -= 1), _c++) {
6
+ _a.push(num);
7
+ }
8
+ return _a;
9
+ }).call(this);
10
+ egg_delivery = function egg_delivery() {
11
+ var _f, _g, _h, _i, _j, dozen_eggs, i;
12
+ _f = []; _i = 0; _j = eggs.length;
13
+ for (_h = 0, i=_i; (_i <= _j ? i < _j : i > _j); (_i <= _j ? i += 12 : i -= 12), _h++) {
14
+ _f.push((function() {
15
+ dozen_eggs = eggs.slice(i, i + 12);
16
+ return deliver(new egg_carton(dozen));
17
+ }).call(this));
18
+ }
19
+ return _f;
20
+ };
21
+ })();
@@ -0,0 +1,10 @@
1
+ (function(){
2
+ var change_numbers, new_num, num;
3
+ num = 1;
4
+ change_numbers = function change_numbers() {
5
+ var new_num;
6
+ new_num = -1;
7
+ return num = 10;
8
+ };
9
+ new_num = change_numbers();
10
+ })();
@@ -0,0 +1,6 @@
1
+ (function(){
2
+ var numbers, numbers_copy, three_to_six;
3
+ numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
4
+ three_to_six = numbers.slice(3, 6 + 1);
5
+ numbers_copy = numbers.slice(0, numbers.length);
6
+ })();
@@ -0,0 +1,4 @@
1
+ (function(){
2
+ var _a;
3
+ (_a = lottery.draw_winner()) == undefined ? undefined : _a.address == undefined ? undefined : _a.address.zipcode;
4
+ })();
@@ -0,0 +1,16 @@
1
+ (function(){
2
+ var award_medals, contenders, gold, silver, the_field;
3
+ gold = (silver = (the_field = "unknown"));
4
+ award_medals = function award_medals(first, second) {
5
+ var rest;
6
+ rest = Array.prototype.slice.call(arguments, 2);
7
+ gold = first;
8
+ silver = second;
9
+ return the_field = rest;
10
+ };
11
+ contenders = ["Michael Phelps", "Liu Xiang", "Yao Ming", "Allyson Felix", "Shawn Johnson", "Roman Sebrle", "Guo Jingjing", "Tyson Gay", "Asafa Powell", "Usain Bolt"];
12
+ award_medals.apply(this, contenders);
13
+ alert("Gold: " + gold);
14
+ alert("Silver: " + silver);
15
+ alert("The Field: " + the_field);
16
+ })();
@@ -0,0 +1,5 @@
1
+ (function(){
2
+ var numbers;
3
+ numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
4
+ numbers.splice.apply(numbers, [3, 6 - 3 + 1].concat([-3, -4, -5, -6]));
5
+ })();
@@ -0,0 +1,9 @@
1
+ (function(){
2
+ var moby_dick;
3
+ moby_dick = "Call me Ishmael. Some years ago -- \
4
+ never mind how long precisely -- having little \
5
+ or no money in my purse, and nothing particular \
6
+ to interest me on shore, I thought I would sail \
7
+ about a little and see the watery part of the \
8
+ world...";
9
+ })();
@@ -0,0 +1,37 @@
1
+ (function(){
2
+ var Animal, Horse, Snake, _a, _b, sam, tom;
3
+ Animal = function Animal() { };
4
+ Animal.prototype.move = function move(meters) {
5
+ return alert(this.name + " moved " + meters + "m.");
6
+ };
7
+ Snake = function Snake(name) {
8
+ this.name = name;
9
+ return this;
10
+ };
11
+ _a = function(){};
12
+ _a.prototype = Animal.prototype;
13
+ Snake.__superClass__ = Animal.prototype;
14
+ Snake.prototype = new _a();
15
+ Snake.prototype.constructor = Snake;
16
+ Snake.prototype.move = function move() {
17
+ alert("Slithering...");
18
+ return Snake.__superClass__.move.call(this, 5);
19
+ };
20
+ Horse = function Horse(name) {
21
+ this.name = name;
22
+ return this;
23
+ };
24
+ _b = function(){};
25
+ _b.prototype = Animal.prototype;
26
+ Horse.__superClass__ = Animal.prototype;
27
+ Horse.prototype = new _b();
28
+ Horse.prototype.constructor = Horse;
29
+ Horse.prototype.move = function move() {
30
+ alert("Galloping...");
31
+ return Horse.__superClass__.move.call(this, 45);
32
+ };
33
+ sam = new Snake("Sammy the Python");
34
+ tom = new Horse("Tommy the Palomino");
35
+ sam.move();
36
+ tom.move();
37
+ })();
@@ -0,0 +1,18 @@
1
+ (function(){
2
+ if (day === "Mon") {
3
+ go_to_work();
4
+ } else if (day === "Tue") {
5
+ go_to_the_park();
6
+ } else if (day === "Thu") {
7
+ go_ice_fishing();
8
+ } else if (day === "Fri" || day === "Sat") {
9
+ if (day === bingo_day) {
10
+ go_to_bingo();
11
+ go_dancing();
12
+ }
13
+ } else if (day === "Sun") {
14
+ go_to_church();
15
+ } else {
16
+ go_to_work();
17
+ }
18
+ })();
@@ -0,0 +1,10 @@
1
+ (function(){
2
+ try {
3
+ all_hell_breaks_loose();
4
+ cats_and_dogs_living_together();
5
+ } catch (error) {
6
+ print(error);
7
+ } finally {
8
+ clean_up();
9
+ }
10
+ })();
@@ -0,0 +1,22 @@
1
+ (function(){
2
+ var _a, lyrics, num;
3
+ // Econ 101
4
+ if (this.studying_economics) {
5
+ while (supply > demand) {
6
+ buy();
7
+ }
8
+ while (supply < demand) {
9
+ sell();
10
+ }
11
+ }
12
+ // Nursery Rhyme
13
+ num = 6;
14
+ lyrics = (function() {
15
+ _a = [];
16
+ while (num -= 1) {
17
+ _a.push(num + " little monkeys, jumping on the bed. \
18
+ One fell out and bumped his head.");
19
+ }
20
+ return _a;
21
+ }).call(this);
22
+ })();