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
6
contributors
Commits on Mar 26, 2010
|
|
chrislloyd |
Optional sentence descriptions for cake tasks.
|
c9b6e82
|
Commits on Apr 04, 2010
Commits on Apr 05, 2010
|
|
Tim Jones |
Added Statement to the grammar.
|
de955da
|
|||
|
|
Tim Jones |
Realigning function arrows.
|
538e518
|
Commits on Apr 06, 2010
|
|
noonat |
Renamed Lexer.tag() argument to new_tag, due to Rhino scope confusion
|
2351948
|
Commits on Apr 07, 2010
|
|
jashkenas |
Merge branch 'master' of git://github.com/noonat/coffee-script
|
75b260e
|
|||
|
|
jashkenas |
Adding noonat to the contributor list
|
3eedf8e
|
Commits on Apr 10, 2010
Commits on Apr 11, 2010
Commits on Apr 13, 2010
|
|
jashkenas |
CoffeeScript 0.6.1, for Node.js v0.1.90
|
92540d5
|
Unified
Split
Showing
with
806 additions
and 617 deletions.
- +7 −7 Cakefile
- +2 −0 README
- +5 −3 documentation/docs/cake.html
- +2 −2 documentation/docs/coffee-script.html
- +17 −15 documentation/docs/command.html
- +88 −104 documentation/docs/grammar.html
- +7 −3 documentation/docs/lexer.html
- +11 −2 documentation/docs/nodes.html
- +1 −1 documentation/docs/optparse.html
- +4 −4 documentation/docs/repl.html
- +1 −1 documentation/docs/rewriter.html
- +1 −1 documentation/docs/scope.html
- +36 −6 documentation/index.html.erb
- +1 −1 documentation/js/array_comprehensions.js
- +1 −1 documentation/js/expressions_comprehension.js
- +1 −1 documentation/js/expressions_try.js
- +1 −1 documentation/js/interpolation.js
- +2 −2 documentation/js/interpolation_expression.js
- +1 −1 documentation/js/object_comprehensions.js
- +1 −1 documentation/js/overview.js
- +2 −2 documentation/js/range_comprehensions.js
- +1 −1 documentation/js/while.js
- +1 −1 examples/web_server.coffee
- +1 −1 extras/coffee-script.js
- +57 −27 index.html
- +13 −6 lib/cake.js
- +2 −2 lib/coffee-script.js
- +52 −47 lib/command.js
- +40 −23 lib/grammar.js
- +1 −1 lib/helpers.js
- +35 −24 lib/lexer.js
- +92 −76 lib/nodes.js
- +6 −6 lib/optparse.js
- +196 −179 lib/parser.js
- +6 −6 lib/repl.js
- +7 −7 lib/rewriter.js
- +1 −1 lib/scope.js
- +1 −1 package.json
- +5 −3 src/cake.coffee
- +2 −2 src/coffee-script.coffee
- +16 −14 src/command.coffee
- +30 −17 src/grammar.coffee
- +7 −3 src/lexer.coffee
- +11 −2 src/nodes.coffee
- +1 −1 src/optparse.coffee
- +5 −5 src/repl.coffee
- +1 −1 src/rewriter.coffee
- +1 −1 src/scope.coffee
- +7 −0 test/test_comprehensions.coffee
- +9 −0 test/test_functions.coffee
- +7 −0 test/test_string_interpolation.coffee
View
14
Cakefile
| @@ -1,10 +1,11 @@ | ||
| -fs: require 'fs' | ||
| -helpers: require('./lib/helpers').helpers | ||
| +fs: require 'fs' | ||
| +helpers: require('./lib/helpers').helpers | ||
| CoffeeScript: require './lib/coffee-script' | ||
| +{spawn: spawn, exec: exec}: require('child_process') | ||
| # Run a CoffeeScript through our node/coffee interpreter. | ||
| run: (args) -> | ||
| - proc: process.createChildProcess 'bin/coffee', args | ||
| + proc: spawn 'bin/coffee', args | ||
| proc.addListener 'error', (err) -> if err then puts err | ||
| @@ -73,20 +74,19 @@ task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', -> | ||
| task 'test', 'run the CoffeeScript language test suite', -> | ||
| helpers.extend global, require 'assert' | ||
| passed_tests: failed_tests: 0 | ||
| - start_time: new Date() | ||
| - original_ok: ok | ||
| + start_time: new Date() | ||
| + original_ok: ok | ||
| helpers.extend global, { | ||
| ok: (args...) -> passed_tests += 1; original_ok(args...) | ||
| CoffeeScript: CoffeeScript | ||
| } | ||
| red: '\033[0;31m' | ||
| green: '\033[0;32m' | ||
| reset: '\033[0m' | ||
| - on_exit: -> | ||
| + process.addListener 'exit', -> | ||
| time: ((new Date() - start_time) / 1000).toFixed(2) | ||
| message: "passed $passed_tests tests in $time seconds$reset" | ||
| puts(if failed_tests then "${red}failed $failed_tests and $message" else "$green$message") | ||
| - process.addListener 'exit', on_exit | ||
| fs.readdir 'test', (err, files) -> | ||
| files.forEach (file) -> | ||
| return unless file.match(/\.coffee$/i) | ||
View
2
README
| @@ -51,8 +51,10 @@ | ||
| Chris Hoffman (cehoffman) | ||
| Jason Huggins (hugs) | ||
| Tim Jones (Tesco) | ||
| + Chris Lloyd (chrislloyd) | ||
| Matt Lyon (mattly) | ||
| Jeff Olson (olsonjeffery) | ||
| + Nathan Ostgard (noonat) | ||
| Samuel Reis (grgh) | ||
| Tom Robinson (tlrobinson) | ||
| Tim Smart (Tim-Smart) | ||
View
8
documentation/docs/cake.html
| @@ -11,8 +11,9 @@ | ||
| <span class="nv">CoffeeScript: </span><span class="nx">require</span> <span class="s1">'./coffee-script'</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-3">#</a> </div> <p>Keep track of the list of defined tasks, the accepted options, and so on.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">tasks: </span><span class="p">{}</span> | ||
| <span class="nv">options: </span><span class="p">{}</span> | ||
| <span class="nv">switches: </span><span class="p">[]</span> | ||
| -<span class="nv">oparse: </span><span class="kc">null</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-4">#</a> </div> <p>Mixin the top-level Cake functions for Cakefiles to use directly.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">helpers</span><span class="p">.</span><span class="nx">extend</span> <span class="nx">global</span><span class="p">,</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-5">#</a> </div> <p>Define a Cake task with a short name, a sentence description, | ||
| +<span class="nv">oparse: </span><span class="kc">null</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-4">#</a> </div> <p>Mixin the top-level Cake functions for Cakefiles to use directly.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">helpers</span><span class="p">.</span><span class="nx">extend</span> <span class="nx">global</span><span class="p">,</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-5">#</a> </div> <p>Define a Cake task with a short name, an optional sentence description, | ||
| and the function to run as the action itself.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">task: </span><span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">description</span><span class="p">,</span> <span class="nx">action</span><span class="p">)</span> <span class="o">-></span> | ||
| + <span class="p">[</span><span class="nx">action</span><span class="p">,</span> <span class="nx">description</span><span class="p">]</span><span class="o">:</span> <span class="p">[</span><span class="nx">description</span><span class="p">,</span> <span class="nx">action</span><span class="p">]</span> <span class="nx">unless</span> <span class="nx">action</span> | ||
| <span class="nx">tasks</span><span class="p">[</span><span class="nx">name</span><span class="p">]</span><span class="o">:</span> <span class="p">{</span><span class="nv">name: </span><span class="nx">name</span><span class="p">,</span> <span class="nv">description: </span><span class="nx">description</span><span class="p">,</span> <span class="nv">action: </span><span class="nx">action</span><span class="p">}</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-6">#</a> </div> <p>Define an option that the Cakefile accepts. The parsed options hash, | ||
| containing all of the command-line options passed, will be made available | ||
| as the first argument to the action.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">option: </span><span class="p">(</span><span class="nx">letter</span><span class="p">,</span> <span class="nx">flag</span><span class="p">,</span> <span class="nx">description</span><span class="p">)</span> <span class="o">-></span> | ||
| @@ -35,9 +36,10 @@ | ||
| <span class="k">for</span> <span class="nx">name</span><span class="p">,</span> <span class="nx">task</span> <span class="k">of</span> <span class="nx">tasks</span> | ||
| <span class="nv">spaces: </span><span class="mi">20</span> <span class="o">-</span> <span class="nx">name</span><span class="p">.</span><span class="nx">length</span> | ||
| <span class="nv">spaces: </span><span class="k">if</span> <span class="nx">spaces</span> <span class="o">></span> <span class="mi">0</span> <span class="k">then</span> <span class="p">(</span><span class="s1">' '</span> <span class="k">for</span> <span class="nx">i</span> <span class="k">in</span> <span class="p">[</span><span class="mi">0</span><span class="p">..</span><span class="nx">spaces</span><span class="p">]).</span><span class="nx">join</span><span class="p">(</span><span class="s1">''</span><span class="p">)</span> <span class="k">else</span> <span class="s1">''</span> | ||
| - <span class="nx">puts</span> <span class="s2">"cake $name$spaces # ${task.description}"</span> | ||
| + <span class="nv">desc: </span> <span class="k">if</span> <span class="nx">task</span><span class="p">.</span><span class="nx">description</span> <span class="k">then</span> <span class="s2">"# $task.description"</span> <span class="k">else</span> <span class="s1">''</span> | ||
| + <span class="nx">puts</span> <span class="s2">"cake $name$spaces $desc"</span> | ||
| <span class="nx">puts</span> <span class="nx">oparse</span><span class="p">.</span><span class="nx">help</span><span class="p">()</span> <span class="k">if</span> <span class="nx">switches</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-10">#</a> </div> <p>Print an error and exit when attempting to all an undefined task.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">no_such_task: </span><span class="p">(</span><span class="nx">task</span><span class="p">)</span> <span class="o">-></span> | ||
| - <span class="nx">process</span><span class="p">.</span><span class="nx">stdio</span><span class="p">.</span><span class="nx">writeError</span> <span class="s2">"No such task: \"$task\"\n"</span> | ||
| + <span class="nx">puts</span> <span class="s2">"No such task: \"$task\"\n"</span> | ||
| <span class="nx">process</span><span class="p">.</span><span class="nx">exit</span> <span class="mi">1</span> | ||
| </pre></div> </td> </tr> </tbody> </table> </div> </body> </html> | ||
View
4
documentation/docs/coffee-script.html
| @@ -16,13 +16,13 @@ | ||
| <span class="k">this</span><span class="p">.</span><span class="nv">exports: </span><span class="k">this</span><span class="p">.</span><span class="nv">CoffeeScript: </span><span class="p">{}</span> | ||
| <span class="nv">Lexer: </span> <span class="k">this</span><span class="p">.</span><span class="nx">Lexer</span> | ||
| <span class="nv">parser: </span> <span class="k">this</span><span class="p">.</span><span class="nx">parser</span> | ||
| - <span class="nv">helpers: </span> <span class="k">this</span><span class="p">.</span><span class="nx">helpers</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-3">#</a> </div> <p>The current CoffeeScript version number.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.VERSION: </span><span class="s1">'0.6.0'</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-4">#</a> </div> <p>Instantiate a Lexer for our use here.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">lexer: </span><span class="k">new</span> <span class="nx">Lexer</span><span class="p">()</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-5">#</a> </div> <p>Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison | ||
| + <span class="nv">helpers: </span> <span class="k">this</span><span class="p">.</span><span class="nx">helpers</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-3">#</a> </div> <p>The current CoffeeScript version number.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.VERSION: </span><span class="s1">'0.6.1'</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-4">#</a> </div> <p>Instantiate a Lexer for our use here.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">lexer: </span><span class="k">new</span> <span class="nx">Lexer</span><span class="p">()</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-5">#</a> </div> <p>Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison | ||
| compiler.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.compile: compile: </span><span class="p">(</span><span class="nx">code</span><span class="p">,</span> <span class="nx">options</span><span class="p">)</span> <span class="o">-></span> | ||
| <span class="nv">options: </span><span class="o">or</span> <span class="p">{}</span> | ||
| <span class="k">try</span> | ||
| <span class="p">(</span><span class="nx">parser</span><span class="p">.</span><span class="nx">parse</span> <span class="nx">lexer</span><span class="p">.</span><span class="nx">tokenize</span> <span class="nx">code</span><span class="p">).</span><span class="nx">compile</span> <span class="nx">options</span> | ||
| <span class="k">catch</span> <span class="nx">err</span> | ||
| - <span class="nv">err.message: </span><span class="s2">"In ${options.source}, ${err.message}"</span> <span class="k">if</span> <span class="nx">options</span><span class="p">.</span><span class="nx">source</span> | ||
| + <span class="nv">err.message: </span><span class="s2">"In $options.source, $err.message"</span> <span class="k">if</span> <span class="nx">options</span><span class="p">.</span><span class="nx">source</span> | ||
| <span class="k">throw</span> <span class="nx">err</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-6">#</a> </div> <p>Tokenize a string of CoffeeScript code, and return the array of tokens.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.tokens: </span><span class="p">(</span><span class="nx">code</span><span class="p">)</span> <span class="o">-></span> | ||
| <span class="nx">lexer</span><span class="p">.</span><span class="nx">tokenize</span> <span class="nx">code</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-7">#</a> </div> <p>Tokenize and parse a string of CoffeeScript code, and return the AST. You can | ||
| then compile it by calling <code>.compile()</code> on the root, or traverse it by using | ||
Oops, something went wrong.