Permalink
...
Comparing changes
Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
jashkenas/coffeescript
CDR2003/coffee-script-lua
CreamCoderz/coffee-script
Crylock/coffee-script
GeoffreyBooth/coffeescript
Gregg/coffee-script
JulianBirch/coffee-script-1
JustinTulloss/coffee-script
MichaelBlume/coffee-script
NightMigera/coffeescript
PandaWood/coffee-script
ProximaMonkey/coffee-script
Remcoman/coffee-script
RicardoSaracino/coffee-script
SE7ENSKY/matescript
STRd6/coffee-script
ShawnFumo/coffee-script
StanAngeloff/coffee-script
Xepo/coffee-script
abi/coffee-script
agnoster/coffee-script
ahjohannessen/coffee-script
akiellor/coffee-script
alanning/coffee-script
allanberger/coffee-script
almost/coffee-script
alubbe/coffee-script
andrehjr/coffee-script
andrewschaaf/coffee-script
andreypopp/coffee-script
apanda/coffee-script
baoshitang/coffee-script
barberboy/coffee-script
benatkin/coffee-script
benbria/coffee-script
benekastah/coffee-script
bjouhier/coffee-script
blahutka/coffee-script
blossom/coffee-script
bolinfest/coffee-script
breckinloggins/coffee-script
carmelyne/contracts.coffee
chajath/coffee-script
charles-cai/coffee-script
charliesome/coffee-script
chetan51/coffee-script
chip/coffee-script
codelahoma/coffee-script
coffee-js/coffee-script
coffee-void/coffeescript
collin/coffee-script
danemorgridge/coffee-script
daveclarke/coffee-script
daveyoon/coffee-script
dbrans/coffee-script
deadprogram/coffee-script
devongovett/coffee-script
dget/coffee-script
disnet/contracts.coffee
dmohl/coffee-script
dohse/coffee-script
dqminh/coffee-script
drewlesueur/coffee-script
eventualbuddha/coffee-script
evilpie/coffee-script
excellentdrums/coffee-script
fitzgen/coffee-script
fizx/coffee-script
geraldalewis/coffee-script
germanocaldeira/coffee-script
gfodor/coffee-script
ghuntley/coffee-script
goodwink/coffee-script
gxela/coffee-script
hayeah/coffee-script
hbt/coffee-script
helixbass/copheescript
hleumas/coffee-script
holtwick/moccacino
hugs/coffee-script
ianthehenry/protoscript
ich/caffeine
janlelis/angular-coffee-script
jaredwy/coffee-script
jasonyandell/coffee-script
jawj/coffee-script
jbca/coffeescript
jiangmiao/toffee-script
jlstr/coffee-script
joelturnbull/coffee-script
johnsang/coffee-script
joliss/coffee-script
jondistad/coffee-script
joshprice/coffee-script
jstrachan/coffee-script
jugglinmike/irene-script
juilyoon/coffee-script
keichii/coffee-script
keithnorm/coffee-script
kewinwang/coffee-script
khaled/coffee-script
leeight/coffee-script
level1/coffee-script
lfendy/coffee-script
loganfsmyth/coffee-script
loopinfinito/coffeescript.com.br
lorensr/coffee-script
loveencounterflow/coffy-script
lukhnos/doubleshot
lynaghk/coffee-script
martco/coffee-script
maxtaco/coffee-script
mbbx6spp/coffee-script
mblinn/coffee-script
mehmeta/coffee-script
melcher/coffee-script
mental/coffee-script
mhart/coffee-script
michaelficarra/coffee-script
misfo/coffee-script
mizchi/coffee-script
mlinderm/coffee-script
mrlauer/coffee-script-monads
muratmeran/coffee-script
myang/coffee-script
nanqiu/coffee-script
neobine/coffee-script
netconstructor/coffee-script
nickjs/coffee-script
nihar/coffee-script
onilabs/coffee-script
paiq/blackcoffee
parkerl/coffee-script
paulmars/coffee-script
peick/coffee-script
pjaspers/coffee-script
plambert/coffee-script
poutyface/coffee-script
pschyska/coffee-script
ptoomey3/coffee-script
quangv/coffee-script
revence27/coffee-script
rkJun/coffee-script
robarondaz/coffee-script
robotlolita/coffee-script
rolftimmermans/coffee-script
rpl/coffee-script
runeb/coffee-script
rwaldron/coffee-script
rymohr/coffee-script
ryszard/coffee-script
samcday/coffee-script
sarang25491/coffee-script
satyr/coffee-script
seedjs/coffee-script
sequoiar/coffee-script
sgraham/coffee-script
shariefsk/coffee-script
shesek/coffee-script
shimaore/cake
siefkenj/gjscoffee-script
smhanov/coffee-script
soutaro/coffee-script
spaghetticode/coffee-script
sparecycles/coffee-script
spencerelliott/coffee-script
sstephenson/coffee-script
stephank/coffee-script
strangemonad/coffee-script
swistak/coffee-script
syg/heap.coffee
taku0/coffee-script
tanob/coffee-script
tglines/coffee-script
thdtjsdn/coffee-script
theIntuitionist/coffee-script
thedeeno/coffee-script
thejh/coffee-script
timruffles/coffee-script
tkpage/coffee-script
tlrobinson/coffee-script
tmishra/coffee-script
tobee/coffee-script
tomelam/coffee-script
tosh/coffee-script
tswicegood/coffee-script
ttilley/coffee-script
twilson63/coffee-script
up2u0609/coffee-script
vanviegen/coffee-script
vjpr/coffee-script
vol4ok/coffee-script
walski/coffee-script
wearefractal/yerbascript
willmoffat/coffee-script
xixixao/coffee-script
yihuang/coffee-script
zaach/coffee-script
zmthy/coffee-script
zot/coffee-script
Nothing to show
Choose a base branch
Choose a Head Repository
jashkenas/coffeescript
CDR2003/coffee-script-lua
CreamCoderz/coffee-script
Crylock/coffee-script
GeoffreyBooth/coffeescript
Gregg/coffee-script
JulianBirch/coffee-script-1
JustinTulloss/coffee-script
MichaelBlume/coffee-script
NightMigera/coffeescript
PandaWood/coffee-script
ProximaMonkey/coffee-script
Remcoman/coffee-script
RicardoSaracino/coffee-script
SE7ENSKY/matescript
STRd6/coffee-script
ShawnFumo/coffee-script
StanAngeloff/coffee-script
Xepo/coffee-script
abi/coffee-script
agnoster/coffee-script
ahjohannessen/coffee-script
akiellor/coffee-script
alanning/coffee-script
allanberger/coffee-script
almost/coffee-script
alubbe/coffee-script
andrehjr/coffee-script
andrewschaaf/coffee-script
andreypopp/coffee-script
apanda/coffee-script
baoshitang/coffee-script
barberboy/coffee-script
benatkin/coffee-script
benbria/coffee-script
benekastah/coffee-script
bjouhier/coffee-script
blahutka/coffee-script
blossom/coffee-script
bolinfest/coffee-script
breckinloggins/coffee-script
carmelyne/contracts.coffee
chajath/coffee-script
charles-cai/coffee-script
charliesome/coffee-script
chetan51/coffee-script
chip/coffee-script
codelahoma/coffee-script
coffee-js/coffee-script
coffee-void/coffeescript
collin/coffee-script
danemorgridge/coffee-script
daveclarke/coffee-script
daveyoon/coffee-script
dbrans/coffee-script
deadprogram/coffee-script
devongovett/coffee-script
dget/coffee-script
disnet/contracts.coffee
dmohl/coffee-script
dohse/coffee-script
dqminh/coffee-script
drewlesueur/coffee-script
eventualbuddha/coffee-script
evilpie/coffee-script
excellentdrums/coffee-script
fitzgen/coffee-script
fizx/coffee-script
geraldalewis/coffee-script
germanocaldeira/coffee-script
gfodor/coffee-script
ghuntley/coffee-script
goodwink/coffee-script
gxela/coffee-script
hayeah/coffee-script
hbt/coffee-script
helixbass/copheescript
hleumas/coffee-script
holtwick/moccacino
hugs/coffee-script
ianthehenry/protoscript
ich/caffeine
janlelis/angular-coffee-script
jaredwy/coffee-script
jasonyandell/coffee-script
jawj/coffee-script
jbca/coffeescript
jiangmiao/toffee-script
jlstr/coffee-script
joelturnbull/coffee-script
johnsang/coffee-script
joliss/coffee-script
jondistad/coffee-script
joshprice/coffee-script
jstrachan/coffee-script
jugglinmike/irene-script
juilyoon/coffee-script
keichii/coffee-script
keithnorm/coffee-script
kewinwang/coffee-script
khaled/coffee-script
leeight/coffee-script
level1/coffee-script
lfendy/coffee-script
loganfsmyth/coffee-script
loopinfinito/coffeescript.com.br
lorensr/coffee-script
loveencounterflow/coffy-script
lukhnos/doubleshot
lynaghk/coffee-script
martco/coffee-script
maxtaco/coffee-script
mbbx6spp/coffee-script
mblinn/coffee-script
mehmeta/coffee-script
melcher/coffee-script
mental/coffee-script
mhart/coffee-script
michaelficarra/coffee-script
misfo/coffee-script
mizchi/coffee-script
mlinderm/coffee-script
mrlauer/coffee-script-monads
muratmeran/coffee-script
myang/coffee-script
nanqiu/coffee-script
neobine/coffee-script
netconstructor/coffee-script
nickjs/coffee-script
nihar/coffee-script
onilabs/coffee-script
paiq/blackcoffee
parkerl/coffee-script
paulmars/coffee-script
peick/coffee-script
pjaspers/coffee-script
plambert/coffee-script
poutyface/coffee-script
pschyska/coffee-script
ptoomey3/coffee-script
quangv/coffee-script
revence27/coffee-script
rkJun/coffee-script
robarondaz/coffee-script
robotlolita/coffee-script
rolftimmermans/coffee-script
rpl/coffee-script
runeb/coffee-script
rwaldron/coffee-script
rymohr/coffee-script
ryszard/coffee-script
samcday/coffee-script
sarang25491/coffee-script
satyr/coffee-script
seedjs/coffee-script
sequoiar/coffee-script
sgraham/coffee-script
shariefsk/coffee-script
shesek/coffee-script
shimaore/cake
siefkenj/gjscoffee-script
smhanov/coffee-script
soutaro/coffee-script
spaghetticode/coffee-script
sparecycles/coffee-script
spencerelliott/coffee-script
sstephenson/coffee-script
stephank/coffee-script
strangemonad/coffee-script
swistak/coffee-script
syg/heap.coffee
taku0/coffee-script
tanob/coffee-script
tglines/coffee-script
thdtjsdn/coffee-script
theIntuitionist/coffee-script
thedeeno/coffee-script
thejh/coffee-script
timruffles/coffee-script
tkpage/coffee-script
tlrobinson/coffee-script
tmishra/coffee-script
tobee/coffee-script
tomelam/coffee-script
tosh/coffee-script
tswicegood/coffee-script
ttilley/coffee-script
twilson63/coffee-script
up2u0609/coffee-script
vanviegen/coffee-script
vjpr/coffee-script
vol4ok/coffee-script
walski/coffee-script
wearefractal/yerbascript
willmoffat/coffee-script
xixixao/coffee-script
yihuang/coffee-script
zaach/coffee-script
zmthy/coffee-script
zot/coffee-script
Nothing to show
Choose a head branch
2
contributors
Commits on Jan 27, 2010
|
|
jashkenas |
fixing instanceof, with a quick test
|
2f3a946
|
|||
|
|
jashkenas |
CoffeeScript 0.3.1, quick patch for 'instanceof'
|
5b2ab36
|
|||
|
|
jashkenas |
updating resources section with rack-coffee
|
83285fe
|
Commits on Jan 30, 2010
Commits on Jan 31, 2010
|
|
jashkenas |
the parser seems too big to compile
|
a0572f1
|
|||
|
|
jashkenas |
removing the peg grammar
|
3a74875
|
|||
|
|
jashkenas |
adding precedence to the Jison parser
|
db00cd6
|
Commits on Feb 01, 2010
|
|
jashkenas |
simplifying order of operations a bit
|
681d4f4
|
Commits on Feb 02, 2010
Commits on Feb 03, 2010
Commits on Feb 04, 2010
|
|
olsonjeffery |
work on nodes.coffee and adding scope.coffee
|
74b9545
|
Commits on Feb 06, 2010
Commits on Feb 07, 2010
|
|
jashkenas |
added a blocks example
|
47bc1d5
|
|||
|
|
jashkenas |
merging all narwhal integration into a single file, so we can merge t…
…he node branch without breaking narwhal compatibility |
5ec096e
|
|||
|
|
jashkenas |
spacing
|
293c2ff
|
|||
|
|
jashkenas |
merging node into master -- you can now pass the --narwhal flag to us…
…e narwhal instead. All tests are executing successfully against both Node.js and Narwhal/Rhino backends |
7ec0a8d
|
|||
|
|
jashkenas |
waypoint -- it's beginning to parser
|
5649998
|
|||
|
|
jashkenas |
waypoint -- parser.coffee can parse basic functions
|
a347183
|
|||
|
|
jashkenas |
merging jeff olson's work
|
1aa966b
|
Commits on Feb 08, 2010
|
|
jashkenas |
CoffeeScript 0.3.2, just in time for the Github feature
|
e2d75e6
|
Unified
Split
Showing
with
4,873 additions
and 1,467 deletions.
- +7 −3 Rakefile
- +2 −2 coffee-script.gemspec
- +2 −0 documentation/coffee/aliases.coffee
- +3 −3 documentation/coffee/fat_arrow.coffee
- +3 −3 documentation/coffee/super.coffee
- +31 −12 documentation/index.html.erb
- +1 −0 documentation/js/aliases.js
- +1 −1 documentation/js/existence.js
- +3 −3 examples/beautiful_code/binary_search.coffee
- +3 −3 examples/beautiful_code/quicksort_runtime.coffee
- +6 −6 examples/beautiful_code/regular_expression_matcher.coffee
- +57 −0 examples/blocks.coffee
- +4 −4 examples/computer_science/binary_search.coffee
- +2 −2 examples/computer_science/bubble_sort.coffee
- +10 −10 examples/computer_science/linked_list.coffee
- +3 −3 examples/computer_science/luhn_algorithm.coffee
- +2 −2 examples/computer_science/merge_sort.coffee
- +3 −3 examples/computer_science/selection_sort.coffee
- +6 −0 extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage
- +42 −20 index.html
- +1 −1 lib/coffee-script.rb
- +50 −0 lib/coffee_script/coffee-script.js
- +17 −11 lib/coffee_script/command_line.rb
- +11 −9 lib/coffee_script/grammar.y
- +363 −0 lib/coffee_script/lexer.js
- +2 −4 lib/coffee_script/lexer.rb
- +21 −5 lib/coffee_script/narwhal/{lib → }/coffee-script.js
- +0 −21 lib/coffee_script/narwhal/lib/coffee-script/loader.js
- +0 −19 lib/coffee_script/narwhal/loader.coffee
- +443 −0 lib/coffee_script/nodes.js
- +24 −9 lib/coffee_script/nodes.rb
- +477 −0 lib/coffee_script/parser.js
- +1,222 −1,140 lib/coffee_script/parser.rb
- +33 −0 lib/coffee_script/repl.js
- +377 −0 lib/coffee_script/rewriter.js
- +26 −26 lib/coffee_script/rewriter.rb
- +11 −0 lib/coffee_script/runner.js
- +73 −0 lib/coffee_script/scope.js
- +2 −3 package.json
- +45 −0 src/coffee-script.coffee
- +280 −0 src/lexer.coffee
- +36 −21 {lib/coffee_script → src}/narwhal/coffee-script.coffee
- +214 −0 src/nodes.coffee
- +468 −0 src/parser.coffee
- +26 −0 src/repl.coffee
- +244 −0 src/rewriter.coffee
- +12 −0 src/runner.coffee
- +49 −0 src/scope.coffee
- +10 −5 test/fixtures/execution/test_arguments.coffee
- +14 −8 test/fixtures/execution/test_array_comprehension.coffee
- +3 −3 test/fixtures/execution/test_assignment.coffee
- +1 −1 test/fixtures/execution/test_blocks.coffee
- +4 −4 test/fixtures/execution/test_calling_super.coffee
- +3 −3 test/fixtures/execution/test_chained_calls.coffee
- +11 −11 test/fixtures/execution/test_destructuring_assignment.coffee
- +1 −1 test/fixtures/execution/test_everything.coffee
- +14 −12 test/fixtures/execution/test_existence.coffee
- +3 −3 test/fixtures/execution/test_expressions.coffee
- +3 −3 test/fixtures/execution/test_fancy_if_statement.coffee
- +18 −17 test/fixtures/execution/test_functions.coffee
- +1 −1 test/fixtures/execution/test_funky_comments.coffee
- +6 −6 test/fixtures/execution/test_heredocs.coffee
- +2 −2 test/fixtures/execution/test_lexical_scope.coffee
- +18 −7 test/fixtures/execution/test_literals.coffee
- +3 −3 test/fixtures/execution/test_nested_comprehensions.coffee
- +1 −1 test/fixtures/execution/test_newline_escaping.coffee
- +5 −5 test/fixtures/execution/test_operations.coffee
- +3 −3 test/fixtures/execution/test_range_comprehension.coffee
- +7 −2 test/fixtures/execution/test_ranges_and_slices.coffee
- +5 −5 test/fixtures/execution/test_splats.coffee
- +1 −1 test/fixtures/execution/test_splices.coffee
- +5 −5 test/fixtures/execution/test_switch.coffee
- +3 −3 test/fixtures/execution/test_while.coffee
- +3 −3 test/fixtures/generation/statements_as_expressions.coffee
- +7 −0 test/unit/test_execution.rb
View
10
Rakefile
| @@ -17,10 +17,14 @@ namespace :build do | ||
| sh "racc #{args[:racc_args]} -o lib/coffee_script/parser.rb lib/coffee_script/grammar.y" | ||
| end | ||
| - desc "Compile the Narwhal interface for --interactive and --run" | ||
| + desc "Compile the Narwhal interface" | ||
| task :narwhal do | ||
| - sh "bin/coffee lib/coffee_script/narwhal/*.coffee -o lib/coffee_script/narwhal/lib/coffee-script" | ||
| - sh "mv lib/coffee_script/narwhal/lib/coffee-script/coffee-script.js lib/coffee_script/narwhal/lib/coffee-script.js" | ||
| + sh "bin/coffee src/narwhal/*.coffee -o lib/coffee_script/narwhal" | ||
| + end | ||
| + | ||
| + desc "Continually compile the CoffeeScript/Node.js components with --watch" | ||
| + task :node do | ||
| + sh "bin/coffee -w src/*.coffee -o lib/coffee_script/" | ||
| end | ||
| desc "Compile and install the Ultraviolet syntax highlighter" | ||
View
4
coffee-script.gemspec
| @@ -1,7 +1,7 @@ | ||
| Gem::Specification.new do |s| | ||
| s.name = 'coffee-script' | ||
| - s.version = '0.3.0' # Keep version in sync with coffee-script.rb | ||
| - s.date = '2010-1-26' | ||
| + s.version = '0.3.2' # Keep version in sync with coffee-script.rb | ||
| + s.date = '2010-2-8' | ||
| s.homepage = "http://jashkenas.github.com/coffee-script/" | ||
| s.summary = "The CoffeeScript Compiler" | ||
View
2
documentation/coffee/aliases.coffee
| @@ -5,3 +5,5 @@ volume: 10 if band isnt spinal_tap | ||
| let_the_wild_rumpus_begin() unless answer is no | ||
| if car.speed < speed_limit then accelerate() | ||
| + | ||
| +print "My name is " + @name | ||
View
6
documentation/coffee/fat_arrow.coffee
| @@ -1,6 +1,6 @@ | ||
| Account: (customer, cart) -> | ||
| - this.customer: customer | ||
| - this.cart: cart | ||
| + @customer: customer | ||
| + @cart: cart | ||
| $('.shopping_cart').bind 'click', (event) => | ||
| - this.customer.purchase this.cart | ||
| + @customer.purchase @cart |
View
6
documentation/coffee/super.coffee
| @@ -1,14 +1,14 @@ | ||
| Animal: -> | ||
| Animal::move: (meters) -> | ||
| - alert this.name + " moved " + meters + "m." | ||
| + alert @name + " moved " + meters + "m." | ||
| -Snake: (name) -> this.name: name | ||
| +Snake: (name) -> @name: name | ||
| Snake extends Animal | ||
| Snake::move: -> | ||
| alert "Slithering..." | ||
| super 5 | ||
| -Horse: (name) -> this.name: name | ||
| +Horse: (name) -> @name: name | ||
| Horse extends Animal | ||
| Horse::move: -> | ||
| alert "Galloping..." | ||
View
43
documentation/index.html.erb
| @@ -51,7 +51,7 @@ | ||
| <p> | ||
| <b>Latest Version:</b> | ||
| - <a href="http://gemcutter.org/gems/coffee-script">0.3.0</a> | ||
| + <a href="http://gemcutter.org/gems/coffee-script">0.3.2</a> | ||
| </p> | ||
| <h2>Table of Contents</h2> | ||
| @@ -118,7 +118,7 @@ gem install coffee-script</pre> | ||
| Installing the gem provides the <tt>coffee</tt> command, which can | ||
| be used to compile CoffeeScript <tt>.coffee</tt> files into JavaScript, as | ||
| well as debug them. In conjunction with | ||
| - <a href="http://narwhaljs.org/">Narwhal</a>, the <tt>coffee</tt> | ||
| + <a href="http://nodejs.org/">Node.js</a> (or <a href="http://narwhaljs.org/">Narwhal</a>), the <tt>coffee</tt> | ||
| command also provides direct evaluation and an interactive REPL. | ||
| When compiling to JavaScript, <tt>coffee</tt> writes the output | ||
| as <tt>.js</tt> files in the same directory by default, but output | ||
| @@ -130,14 +130,16 @@ gem install coffee-script</pre> | ||
| <td width="25%"><code>-i, --interactive</code></td> | ||
| <td> | ||
| Launch an interactive CoffeeScript session. | ||
| - Requires <a href="http://narwhaljs.org/">Narwhal</a>. | ||
| + Requires <a href="http://nodejs.org/">Node.js</a>, | ||
| + or <a href="http://narwhaljs.org/">Narwhal</a>, with <tt>--narwhal</tt>. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>-r, --run</code></td> | ||
| <td> | ||
| Compile and execute scripts without saving the intermediate | ||
| - JavaScript. Requires <a href="http://narwhaljs.org/">Narwhal</a>. | ||
| + JavaScript. Requires <a href="http://nodejs.org/">Node.js</a>, | ||
| + or <a href="http://narwhaljs.org/">Narwhal</a>, with <tt>--narwhal</tt>. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| @@ -194,7 +196,7 @@ gem install coffee-script</pre> | ||
| <td><code>-n, --no-wrap</code></td> | ||
| <td> | ||
| Compile the JavaScript without the top-level function safety wrapper. | ||
| - (Used for CoffeeScript as a Narwhal module.) | ||
| + (Used for CoffeeScript as a Node.js module.) | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| @@ -367,6 +369,9 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre> | ||
| <p> | ||
| For single-line statements, <tt>unless</tt> can be used as the inverse of <tt>if</tt>. | ||
| </p> | ||
| + <p> | ||
| + As a shortcut for <tt>this.property</tt>, you can use <tt>@property</tt>. | ||
| + </p> | ||
| <%= code_for('aliases') %> | ||
| <p id="splats"> | ||
| @@ -624,21 +629,22 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre> | ||
| <ul> | ||
| <li> | ||
| <a href="http://github.com/jashkenas/coffee-script/">Source Code</a><br /> | ||
| - After checking out the source, make sure to run <tt>rake build:parser</tt> | ||
| - to generate an up-to-date version of the Racc parser. | ||
| Use <tt>bin/coffee</tt> to test your changes, | ||
| <tt>rake test</tt> to run the test suite, | ||
| + <tt>rake build:parser</tt> to regenerate the Racc parser if you're | ||
| + working on the grammar, | ||
| and <tt>rake gem:install</tt> to | ||
| create and install a custom version of the gem. | ||
| </li> | ||
| <li> | ||
| - <a href="http://github.com/jashkenas/coffee-script/issues">Bugs, Feature Requests, and General Discussion</a> | ||
| + <a href="http://github.com/jashkenas/coffee-script/issues">CoffeeScript Issues</a><br /> | ||
| + Bugs reports, feature requests, and general discussion all belong here. | ||
| </li> | ||
| <li> | ||
| - <a href="http://github.com/creationix/coffeepot">CoffeePot</a><br /> | ||
| - An implementation of CoffeeScript, written in CoffeeScript, by | ||
| - <a href="http://github.com/creationix">Tim Caswell</a>. Compiles just | ||
| - a limited subset at this point. | ||
| + <a href="http://github.com/mattly/rack-coffee">rack-coffee</a><br /> | ||
| + Rack middleware for serving CoffeeScripts as JavaScript directly to | ||
| + the browser, without having to compile them first. From | ||
| + <a href="http://github.com/mattly">Matt Lyon</a>. | ||
| </li> | ||
| <li> | ||
| <a href="http://github.com/jnicklas/bistro_car">BistroCar</a><br /> | ||
| @@ -653,9 +659,22 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre> | ||
| <a href="http://github.com/inem">Ivan Nemytchenko</a>, that embeds | ||
| snippets of CoffeeScript within your HAML templates. | ||
| </li> | ||
| + <li> | ||
| + <a href="http://github.com/creationix/coffeepot">CoffeePot</a><br /> | ||
| + An implementation of CoffeeScript, written in CoffeeScript, by | ||
| + <a href="http://github.com/creationix">Tim Caswell</a>. Compiles just | ||
| + a limited subset at this point. | ||
| + </li> | ||
| </ul> | ||
| <h2 id="change_log">Change Log</h2> | ||
| + | ||
| + <p> | ||
| + <b class="header" style="margin-top: 20px;">0.3.2</b> | ||
| + <tt>@property</tt> is now a shorthand for <tt>this.property</tt>.<br /> | ||
| + Switched the default JavaScript engine from Narwhal to Node.js. Pass | ||
| + the <tt>--narwhal</tt> flag if you'd like to continue using it. | ||
| + </p> | ||
| <p> | ||
| <b class="header" style="margin-top: 20px;">0.3.0</b> | ||
View
1
documentation/js/aliases.js
| @@ -10,4 +10,5 @@ | ||
| let_the_wild_rumpus_begin(); | ||
| } | ||
| car.speed < speed_limit ? accelerate() : null; | ||
| + print("My name is " + this.name); | ||
| })(); | ||
View
2
documentation/js/existence.js
| @@ -1,6 +1,6 @@ | ||
| (function(){ | ||
| var solipsism, speed; | ||
| - if ((typeof mind !== "undefined" && mind !== null) && !(typeof world !== "undefined" && world !== null)) { | ||
| + if ((typeof mind !== "undefined" && mind !== null) && (typeof !world !== "undefined" && !world !== null)) { | ||
| solipsism = true; | ||
| } | ||
| speed = (typeof speed !== "undefined" && speed !== null) ? speed : 140; | ||
View
6
examples/beautiful_code/binary_search.coffee
| @@ -11,6 +11,6 @@ index: (list, target) -> | ||
| if val < target then low: mid + 1 else high: mid | ||
| return -1 | ||
| -print(2 is index([10, 20, 30, 40, 50], 30)) | ||
| -print(4 is index([-97, 35, 67, 88, 1200], 1200)) | ||
| -print(0 is index([0, 45, 70], 0)) | ||
| +puts 2 is index([10, 20, 30, 40, 50], 30) | ||
| +puts 4 is index([-97, 35, 67, 88, 1200], 1200) | ||
| +puts 0 is index([0, 45, 70], 0) | ||
View
6
examples/beautiful_code/quicksort_runtime.coffee
| @@ -8,6 +8,6 @@ runtime: (N) -> | ||
| t: n - 1 + sum / n | ||
| t | ||
| -print(runtime(3) is 2.6666666666666665) | ||
| -print(runtime(5) is 7.4) | ||
| -print(runtime(8) is 16.92142857142857) | ||
| +puts runtime(3) is 2.6666666666666665 | ||
| +puts runtime(5) is 7.4 | ||
| +puts runtime(8) is 16.92142857142857 | ||
View
12
examples/beautiful_code/regular_expression_matcher.coffee
| @@ -26,9 +26,9 @@ match_star: (c, regexp, text) -> | ||
| return false unless text and (text[0] is c or c is '.') | ||
| text: text.slice(1) | ||
| -print(match("ex", "some text")) | ||
| -print(match("s..t", "spit")) | ||
| -print(match("^..t", "buttercup")) | ||
| -print(match("i..$", "cherries")) | ||
| -print(match("o*m", "vrooooommm!")) | ||
| -print(match("^hel*o$", "hellllllo")) | ||
| +puts match("ex", "some text") | ||
| +puts match("s..t", "spit") | ||
| +puts match("^..t", "buttercup") | ||
| +puts match("i..$", "cherries") | ||
| +puts match("o*m", "vrooooommm!") | ||
| +puts match("^hel*o$", "hellllllo") | ||
View
57
examples/blocks.coffee
| @@ -0,0 +1,57 @@ | ||
| +# After wycats' http://yehudakatz.com/2010/02/07/the-building-blocks-of-ruby/ | ||
| + | ||
| +# Sinatra. | ||
| +get '/hello', -> | ||
| + 'Hello World' | ||
| + | ||
| + | ||
| +# Append. | ||
| +append: (location, data) -> | ||
| + path: new Pathname location | ||
| + throw "Location does not exist" unless path.exists() | ||
| + | ||
| + File.open path, 'a', (file) -> | ||
| + file.puts YAML.dump data | ||
| + | ||
| + data | ||
| + | ||
| + | ||
| +# Rubinius' File.open implementation. | ||
| +File.open: (path, mode, block) -> | ||
| + io: new File path, mode | ||
| + | ||
| + return io unless block | ||
| + | ||
| + try | ||
| + block io | ||
| + finally | ||
| + try | ||
| + io.close() unless io.closed() | ||
| + catch error | ||
| + # nothing, just swallow them. | ||
| + | ||
| + | ||
| +# Write. | ||
| +write: (location, data) -> | ||
| + path = new Pathname location | ||
| + raise "Location does not exist" unless path.exists() | ||
| + | ||
| + File.open path, 'w', (file) -> | ||
| + return false if Digest.MD5.hexdigest(file.read()) is data.hash() | ||
| + file.puts YAML.dump data | ||
| + true | ||
| + | ||
| + | ||
| +# Rails' respond_to. | ||
| +index: -> | ||
| + people: Person.find 'all' | ||
| + | ||
| + respond_to (format) -> | ||
| + format.html() | ||
| + format.xml -> render { xml: people.xml() } | ||
| + | ||
| + | ||
| +# Synchronization. | ||
| +synchronize: (block) -> | ||
| + lock() | ||
| + try block() finally unlock() |
View
8
examples/computer_science/binary_search.coffee
| @@ -19,7 +19,7 @@ binary_search: (items, value) -> | ||
| # Test the function. | ||
| -print(2 is binary_search([10, 20, 30, 40, 50], 30)) | ||
| -print(4 is binary_search([-97, 35, 67, 88, 1200], 1200)) | ||
| -print(0 is binary_search([0, 45, 70], 0)) | ||
| -print(-1 is binary_search([0, 45, 70], 10)) | ||
| +puts(2 is binary_search([10, 20, 30, 40, 50], 30)) | ||
| +puts(4 is binary_search([-97, 35, 67, 88, 1200], 1200)) | ||
| +puts(0 is binary_search([0, 45, 70], 0)) | ||
| +puts(-1 is binary_search([0, 45, 70], 10)) | ||
View
4
examples/computer_science/bubble_sort.coffee
| @@ -7,5 +7,5 @@ bubble_sort: (list) -> | ||
| # Test the function. | ||
| -print(bubble_sort([3, 2, 1]).join(' ') is '1 2 3') | ||
| -print(bubble_sort([9, 2, 7, 0, 1]).join(' ') is '0 1 2 7 9') | ||
| +puts(bubble_sort([3, 2, 1]).join(' ') is '1 2 3') | ||
| +puts(bubble_sort([9, 2, 7, 0, 1]).join(' ') is '0 1 2 7 9') | ||
View
20
examples/computer_science/linked_list.coffee
| @@ -91,16 +91,16 @@ LinkedList::toString: -> this.toArray().toString() | ||
| list: new LinkedList() | ||
| list.add("Hi") | ||
| -print(list.size() is 1) | ||
| -print(list.item(0) is "Hi") | ||
| -print(list.item(1) is null) | ||
| +puts(list.size() is 1) | ||
| +puts(list.item(0) is "Hi") | ||
| +puts(list.item(1) is null) | ||
| list: new LinkedList() | ||
| list.add("zero").add("one").add("two") | ||
| -print(list.size() is 3) | ||
| -print(list.item(2) is "two") | ||
| -print(list.remove(1) is "one") | ||
| -print(list.item(0) is "zero") | ||
| -print(list.item(1) is "two") | ||
| -print(list.size() is 2) | ||
| -print(list.item(-10) is null) | ||
| +puts(list.size() is 3) | ||
| +puts(list.item(2) is "two") | ||
| +puts(list.remove(1) is "one") | ||
| +puts(list.item(0) is "zero") | ||
| +puts(list.item(1) is "two") | ||
| +puts(list.size() is 2) | ||
| +puts(list.item(-10) is null) | ||
View
6
examples/computer_science/luhn_algorithm.coffee
| @@ -31,6 +31,6 @@ is_valid_identifier: (identifier) -> | ||
| # Tests. | ||
| -print(is_valid_identifier("49927398716") is true) | ||
| -print(is_valid_identifier("4408041234567893") is true) | ||
| -print(is_valid_identifier("4408041234567890") is false) | ||
| +puts(is_valid_identifier("49927398716") is true) | ||
| +puts(is_valid_identifier("4408041234567893") is true) | ||
| +puts(is_valid_identifier("4408041234567890") is false) | ||
View
4
examples/computer_science/merge_sort.coffee
| @@ -15,5 +15,5 @@ merge_sort: (list) -> | ||
| # Test the function. | ||
| -print(merge_sort([3, 2, 1]).join(' ') is '1 2 3') | ||
| -print(merge_sort([9, 2, 7, 0, 1]).join(' ') is '0 1 2 7 9') | ||
| +puts(merge_sort([3, 2, 1]).join(' ') is '1 2 3') | ||
| +puts(merge_sort([9, 2, 7, 0, 1]).join(' ') is '0 1 2 7 9') | ||
View
6
examples/computer_science/selection_sort.coffee
| @@ -9,7 +9,7 @@ selection_sort: (list) -> | ||
| min: i | ||
| # Check the rest of the array to see if anything is smaller. | ||
| - (min: j if list[j] < list[min]) for j in [i+1...len] | ||
| + (min: j if list[j] < list[min]) for j in [(i+1)...len] | ||
| # Swap if a smaller item has been found. | ||
| [list[i], list[min]]: [list[min], list[i]] if i isnt min | ||
| @@ -19,5 +19,5 @@ selection_sort: (list) -> | ||
| # Test the function. | ||
| -print(selection_sort([3, 2, 1]).join(' ') is '1 2 3') | ||
| -print(selection_sort([9, 2, 7, 0, 1]).join(' ') is '0 1 2 7 9') | ||
| +puts(selection_sort([3, 2, 1]).join(' ') is '1 2 3') | ||
| +puts(selection_sort([9, 2, 7, 0, 1]).join(' ') is '0 1 2 7 9') | ||
View
6
extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage
| @@ -72,6 +72,12 @@ | ||
| <key>name</key> | ||
| <string>constant.numeric.coffee</string> | ||
| </dict> | ||
| + <dict> | ||
| + <key>match</key> | ||
| + <string>(@)[a-zA-Z_$]\w*</string> | ||
| + <key>name</key> | ||
| + <string>variable.other.readwrite.instance.coffee</string> | ||
| + </dict> | ||
| <dict> | ||
| <key>name</key> | ||
| <string>string.quoted.heredoc.coffee</string> | ||
Oops, something went wrong.
Showing you all comments on commits in this comparison.
|
@var doesn't work well when you assign to it:
produces:
Still a good start! |