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
8
contributors
Commits on Oct 02, 2016
|
|
shreeve |
strip \r (if present) before final \n
|
7c7bc8e
|
Commits on Oct 04, 2016
|
|
lydell |
Merge pull request #4329 from shreeve/strip-cr-if-present
strip \r (if present) before final \n |
11561dd
|
Commits on Oct 07, 2016
|
|
alangpierce |
Change OUTDENT tokens to be positioned at the end of the previous token
This commit adds another post-processing step after normal lexing that sets the locationData on all OUTDENT tokens to be at the last character of the previous token. This does feel like a little bit of a hack. Ideally the location data would be set correctly in the first place and not in a post-processing step, but I tried that and some temporary intermediate tokens were causing problems, so I decided to set the location data once those intermediate tokens were removed. Also, having this as a separate processing step makes it more robust and isolated. This fixes the problem in decaffeinate/decaffeinate#371 . In that issue, the CoffeeScript tokens had three OUTDENT tokens in a row, and the last two overlapped with the `]`. Since at least one of those OUTDENT tokens was considered part of the function body, the function expression had an ending position just after the end of the `]`. OUTDENT tokens are sort of a weird case in the lexer anyway, since they often don't correspond to an actual location in the source code. It seems like the code in `lexer.coffee` makes an attempt at finding a good place for them, but in some cases, it has a bad result. This seems hard to avoid in the general case. For example, in this code: ```coffee [-> a] ``` There must be an OUTDENT between the `a` and the `]`, but CoffeeScript tokens have an inclusive start and end, so they must always be at least one character wide (I think). In this case, the lexer was choosing the `]` as the location, and the parser ended up generating correct location data, I believe because it ignores the outermost INDENT and OUTDENT tokens. However, with multiple OUTDENT tokens in a row, the parser ends up producing location data that is wrong. It seems to me like there isn't a solid answer to "what location do OUTDENT tokens have", since it hasn't mattered much, but for this commit, I'm defining it: they always have the location of the last character of the previous token. This should hopefully be fairly safe because tokens are still in the same order relative to each other. Also, it's worth noting that this makes the start location for OUTDENT tokens awkward. However, OUTDENT tokens are always used to mark the end of something, so their `last_line` and `last_column` values are always what matter when determining AST node bounds, so it is most important for those to be correct. |
ce971b7
|
|||
|
|
alangpierce |
Fix location data for implicit CALL_END tokens
Fixes decaffeinate/decaffeinate#446 In addition to OUTDENT tokens, CALL_END tokens can also be virtual tokens without a real location, and sometimes they end up with a location that's incorrect. |
88693e4
|
Commits on Oct 09, 2016
|
|
alangpierce |
Define proper operator precedence for bitwise/logical operators
This is an upstream port for the patch decaffeinate#8 See decaffeinate/decaffeinate#291 for the bug that this fixed. For the most part, CoffeeScript and JavaScript have the same precedence rules, but in some cases, the intermediate AST format didn't represent the actual evaluation order. For example, in the expression `a or b and c`, the `and` is evaluated first, but the parser treated the two operators with equal precedence. This was still correct end-to-end because CoffeeScript simply emitted the result without parens, but any intermediate tools using the CoffeeScript parser could become confused. Here are the JS operator precedence rules: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence For the most part, CoffeeScript already follows these. `COMPARE` operators already behave differently due to chained comparisons, so I think we don't need to worry about following JS precedence for those. So I think the only case where it was behaving differently in an important way was for the binary/bitwise operators that are being changed here. As part of this change, I also introduced a new token tag, `BIN?`, for the binary form of the `?` operator. |
e14946b
|
Commits on Oct 10, 2016
|
|
lydell |
Merge pull request #4335 from alangpierce/fix-operator-precedence
Define proper operator precedence for bitwise/logical operators |
a75fe28
|
|||
|
|
lydell |
Merge pull request #4296 from alangpierce/move-outdents-to-previous-t…
…oken Change OUTDENT tokens to be positioned at the end of the previous token |
0853b41
|
Commits on Oct 16, 2016
|
|
GeoffreyBooth |
The CoffeeScript compiler should error on trying to export anonymous …
…classes (previously we were outputting invalid JavaScript that the runtime was erroring on) |
48e00d8
|
|||
|
|
lydell |
Merge pull request #4339 from GeoffreyBooth/fix-export-anonymous-class
Disallow exporting anonymous classes |
4d3d735
|
Commits on Oct 19, 2016
|
|
GeoffreyBooth |
Node 7-nightly throws deprecation warnings when calling `fs` non-`Syn…
…c` functions without callbacks; but we always want the synchronous versions, so we should just call those in the first place |
be44ebd
|
|||
|
|
lydell |
Merge pull request #4340 from GeoffreyBooth/node-deprecations
Call synchronous `fs` methods using the `Sync` variants |
3c42b40
|
Commits on Oct 23, 2016
|
|
GeoffreyBooth |
Fix typo
|
0521c35
|
|||
|
|
alangpierce |
Properly set location for string tokens ending in a newline (#4344)
This is an upstream port of decaffeinate#9 The existing logic for computing the end location of a string was to take the end of the string contents, then add the delimiter length to last_column. For example, `"""abc"""` would have an end position three characters after the `c`. However, if a string ended in a newline, then the end location for the string contents would be one line above the end location for the string, so the proper fix is to move the end location to the next line, not just to shift it to the right. This avoids a bug where the location data would sometimes reference a non-existent location (one past the end of its line). It fixes the AST location data, although as far as I know, it never has caused correctness issues in the CoffeeScript output. |
6087c2c
|
Commits on Oct 24, 2016
|
|
GeoffreyBooth |
Merge branch 'master' of github.com:jashkenas/coffeescript
|
887052d
|
Commits on Oct 26, 2016
|
|
GabrielRatener |
Selectively ignore CS-only keywords in ES imports and exports (#4347)
|
26ad6d4
|
|||
|
|
GeoffreyBooth |
Resolve conflicts with `2` branch
|
0d13231
|
Commits on Oct 31, 2016
|
|
alangpierce |
Include generated } tokens when fixing closing token positions
This is an upstream port of decaffeinate#10 See that PR for links to the issues that this fixes. Just like OUTDENT and CALL_END tokens, close-curly-brace tokens can be generated without having a real location, and if that position overlaps with a later token, it can cause the AST to have bad location data. Just like the other two token types, we now give `}` tokens the position of the previous real token, which makes all AST nodes have reasonable locations. |
c5afb4e
|
|||
|
|
lydell |
Merge pull request #4350 from alangpierce/upstream-fix-generated-clos…
…e-curly-location Include generated } tokens when fixing closing token positions |
aca72f9
|
Commits on Nov 08, 2016
|
|
GeoffreyBooth |
Add a `for .. from ..` loop for generators, see #4306, #3832 (#4355)
* Added support for for-from loop, see #3832 * for-from: remove extra newline and add support for ranges * for-from: tidy up the lexer * for-from: add support for patterns * for-from: fix bad alignment * for-from: add two more tests * for-from: fix test "for-from loops over generators" See explanation here: #4306 (comment) * for-from: delete leftover console.log * Refactor the big `if` block in the lexer to be as minimal a change from `master` as we can get away with * Cleanup to make more idiomatic, remove trailing whitespace, minor performance improvements * for-from: move code from one file to another * for-from: clean up whitespace * for-from: lexer bikeshedding * Move "own is not supported in for-from loops" test into error_messages.coffee; improve error message so that "own" is underlined * Revert unnecessary changes, to minimize the lines of code modified by this PR |
b3896d0
|
Commits on Nov 15, 2016
|
|
GeoffreyBooth |
Update dev dependencies; update template rendering to use new Undersc…
…ore syntax |
6f09d36
|
Commits on Nov 16, 2016
|
|
GeoffreyBooth |
Use Google-hosted jQuery
|
3b0b002
|
|||
|
|
GeoffreyBooth |
Move v1 documentation under `docs/v1`, with `docs/index.html` symlink…
…ing to `docs/v1/index.html` (with `.nojekyll` file to hopefully make the symlink work) |
3739954
|
|||
|
|
GeoffreyBooth |
Update `cake doc:source` to output to new `docs/v{1|2}/annotated-sour…
…ce`; collapse `doc:underscore` into it and generate missing underscore.html (closes #4295) |
eb46975
|
|||
|
|
GeoffreyBooth |
Update `cake build:browser` to reflect new path to coffee-script.js
|
3736b0f
|
|||
|
|
GeoffreyBooth |
Even 1.x doesn’t need to limit generators tests to --harmony mode any…
…more; minor cleanup |
846c0e4
|
|||
|
|
GeoffreyBooth |
coffeescript.org goes HTTPS!
|
a95d986
|
|||
|
|
GeoffreyBooth |
Fix links to annotated source
|
7bc5b73
|
|||
|
|
GeoffreyBooth |
Fix missing hunk
|
4ab6fbc
|
|||
|
|
GeoffreyBooth |
Revert unintended changes to generated index.html
|
bebc581
|
Commits on Nov 17, 2016
|
|
jashkenas |
Merge pull request #4360 from GeoffreyBooth/branch-docs
Reorganize docs for v1/v2 split |
|
f32740c
|
||
|
|
jashkenas |
move CNAME
|
|
24033eb
|
||
|
|
GeoffreyBooth |
Revert to http://coffeescript.org until GitHub pages supports HTTPS f…
…or custom domains (#4363) |
|
a49c5c5
|
Commits on Nov 18, 2016
|
|
greghuc |
CS1 tagged template literals (and CS2 interpolated strings as templat…
…e literals) (#4352) * Add initial support for template literals with no interpolation * Change ‘unexpected string’ error message tests to use number not identifier prefix. Identifer prefixes are now valid as tagged template literals * Test tagged template literals for non-interpolated strings and tag function. * Tagged template literals work for pure Strings. Pull tagged template definition up to Invocation level in grammar, enabling chained invocation calls. We can view a tagged template is a special form of function call. * Readying for StringWithInterpolations work. * Tweaks. * Fix style * Pass StringWithInterpolations parameter straight into Call constructor. StringWithInterpolations will be output as template literal, so already in correct form for outputting tagged template literal. * Strip down compileNode for StringWithInterpolations * Done StringLiteral case for interpolated Strings * Remove need for TemplateLiteral * Simplify code. * Small code tidy * Interpolated strings now outputting as template literals. Still needs comprehensive testing. * Move error message tests into error_messages.coffee; remove test that is testing for a Node runtime error * Split up tests that were testing multiple things per test, so that each test tests only one thing * Edge cases: tagged template literals containing interpolated strings or even internal tagged template literals * Make more concise, more idiomatic style * Pull back extreme indentation * Restore and fix commented-out tests * Edge case: tagged template literal with empty string * Only use new ES2015 interpolated string syntax if we’re inside a tagged template literal; this keeps this PR safe to merge into CoffeeScript 1.x. Remove the code from this commit to make all interpolated strings use ES2015 syntax, for CoffeeScript 2. * Compiler now _doesn’t_ use template literals. * Expand tagged template literal tests * Move ‘Unexpected string’ error message tests into tagged template literal section. ‘Unexpected string’ is not reported in these test scenarios anymore. Instead, we error that the prefixing literal is not a function. * Don’t unwrap StringWithInterpolations. Saw bug with program consisting of “#{2}” not compiling with template literals. Root cause was that Block.compileNode was unwrapping interpolated string and so didn’t use compileNode logic at StringWithInterpolations level. * No need to bracket interpolated strings any more. When interpolated string looks like `hello ${2}`, no extract brackets are needed, as the `s mark the beginning and end. * Show html templating with tagged template literals * Multiline should match multiline * Comment out unnecessary `unwrap`, which is only needed for CoffeeScript 2 all-ES2015 syntax output |
|
78e1f43
|
Commits on Nov 19, 2016
|
|
GeoffreyBooth |
Triple backticks to allow creation of JavaScript blocks (#4357)
* Support JavaScript code blocks set apart by triple backticks (``` ... ```) * Add test for escaped backticks * Remove TODOs for things we’re never going to support * Convert escaped backticks to backticks; update tests * Block inline JavaScript can end with an escaped backtick character * Updated JavaScript token regexes per @lydell * In JavaScript blocks, escape backslashes when they immediately precede backticks; additional tests * Test that we don’t break backslash escaping in JavaScript literals |
|
073e147
|
Commits on Nov 21, 2016
|
|
GeoffreyBooth |
Docs improvements (#4367)
* The generated JavaScript for the examples in the docs ends up within index.html, so we don’t need the intermediate generated .js files committed in the repo; also, even while .gitignored they should be under `docs`, with the rest of the generated files, not under `documentation`, where the source files are. * Add “Existential Operator” to the table of contents. Closes #4361 * Updated output due to newer version of highlight.js * Generated the JavaScript for the docs examples should be synchronous, so that index.html isn’t generated before the JavaScript is * In “Try CoffeeScript,” if you press the tab key it should type a tab character. Closes #3342. * Rename doc example folders from `js` and `coffee` to just `examples` * Add missing `yield` to the list of keywords to highlight until highlight.js catches up; update the class used to match highlight.js’ `keyword` * `cake doc:site` should watch the example files too, not just index.html.js * Remove examples folder, including underscore.coffee; remove link to annotated underscore.coffee |
|
cc3be71
|
||
|
|
danielbayley |
Docs shorthand object notation (#4356)
* Docs shorthand object notation A simple but slightly more imaginative example of shorthand object notation. Closes #1808. Signed-off-by: Daniel Bayley <[email protected]> * Update for new documentation folder structure * Fix typo |
|
6c759d4
|
Commits on Nov 22, 2016
|
|
GeoffreyBooth |
Docs for `for…from` (#4368)
* Documentation of `for...from` for iterating over generator functions * Add note that the CoffeeScript compiler does not, in fact, generate JavaScript that runs in every JavaScript runtime |
|
56482a3
|
Commits on Nov 23, 2016
|
|
GeoffreyBooth |
Update Bower.json per latest spec (#4371)
* Remove moot `version` property from bower.json Per bower/spec@a325da3 * No need for bower to know about dev dependencies, and this is one less thing to keep in sync |
|
8ea67ff
|
||
|
|
GeoffreyBooth |
Docs for triple-backticks and escaping backticks (#4369)
* Documentation for triple backticks and escaping backticks * Better explanation of escaped backticks within triple-backticks block |
|
992eb49
|
Commits on Nov 27, 2016
|
|
greghuc |
Docs for tagged template literals (#4372)
* Correct tagged template literal test. Should use Coffeescript form of interpolated strings, not Javascript! * First pass at docs for tagged template literals. * Correct alerted variable. * Add note re checking runtime for tagged template literals * Fixed broken example. * Consistent style * Clarify that CoffeeScript isn’t handling the tagged template literal, the runtime is; fix CoffeeScript spelling * Collapse notes about generator functions and tagged template literals into the same sentence * Make tagged template literals example into a function * Make text less clunky. * More clarity on what CoffeeScript is doing versus what the runtime is doing, and emphasize runtimes vs Babel/Traceur |
|
555e47d
|
Commits on Nov 28, 2016
|
|
GeoffreyBooth |
Fix path to browser compiler (#4374)
|
|
02c5641
|
||
|
|
GeoffreyBooth |
Add `for…from` to list of ES2015 exceptions in the introduction (#4373)
|
|
5c765f4
|
||
|
|
GeoffreyBooth |
Browser compiler should convert the string to load to UTF-8, in case …
…it is UTF-16 like the contents of a <script> block generally are (#4375) |
|
ac20f66
|
Commits on Nov 29, 2016
|
|
GeoffreyBooth |
Replace Uglify.js with Google Closure Compiler, JS version; let NPM f…
…inally reformat package.json the way it likes (#4376) |
|
ac26360
|
||
|
|
Geoffrey Booth |
Organize Cakefile: move helper functions that are only used by `doc:s…
…ite` into the `doc:site` task |
a401f58
|
|||
|
|
Geoffrey Booth |
Standardize on .html file extension; move test.html into its new home
|
6d29086
|
Commits on Nov 30, 2016
Commits on Dec 01, 2016
Commits on Dec 02, 2016
Commits on Dec 03, 2016
|
|
Geoffrey Booth |
Handle tagged template literals (and future CS2 interpolated strings)…
… with “invalidly escaped” backticks or `${`—one backslash instead of two |
d8abfae
|
|||
|
|
GeoffreyBooth |
Improve tests and comments
|
d45d780
|
|||
|
|
lydell |
Merge pull request #4383 from GeoffreyBooth/escape-template-literals
Escape backticks and `${` within template literals; fixes #4380 |
|
c9de5be
|
Commits on Dec 04, 2016
Unified
Split
Showing
with
13,449 additions
and 12,895 deletions.
- 0 .nojekyll
- +140 −108 Cakefile
- +0 −8 bower.json
- 0 { → docs}/CNAME
- +1 −0 docs/index.html
- +1 −0 docs/v1/.gitignore
- 0 {documentation/docs → docs/v1/annotated-source}/browser.html
- 0 {documentation/docs → docs/v1/annotated-source}/cake.html
- +84 −66 {documentation/docs → docs/v1/annotated-source}/coffee-script.html
- 0 {documentation/docs → docs/v1/annotated-source}/command.html
- 0 {documentation/docs → docs/v1/annotated-source}/docco.css
- +19 −6 {documentation/docs → docs/v1/annotated-source}/grammar.html
- +1 −1 {documentation/docs → docs/v1/annotated-source}/helpers.html
- 0 {documentation/docs → docs/v1/annotated-source}/index.html
- +198 −160 {documentation/docs → docs/v1/annotated-source}/lexer.html
- +444 −274 {documentation/docs → docs/v1/annotated-source}/nodes.html
- 0 {documentation/docs → docs/v1/annotated-source}/optparse.html
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/aller-bold.eot
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/aller-bold.ttf
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/aller-bold.woff
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/aller-light.eot
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/aller-light.ttf
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/aller-light.woff
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/roboto-black.eot
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/roboto-black.ttf
- BIN {documentation/docs → docs/v1/annotated-source}/public/fonts/roboto-black.woff
- 0 {documentation/docs → docs/v1/annotated-source}/public/stylesheets/normalize.css
- 0 {documentation/docs → docs/v1/annotated-source}/register.html
- +3 −3 {documentation/docs → docs/v1/annotated-source}/repl.html
- +60 −31 {documentation/docs → docs/v1/annotated-source}/rewriter.html
- 0 {documentation/docs → docs/v1/annotated-source}/scope.html
- 0 {documentation/docs → docs/v1/annotated-source}/sourcemap.html
- +395 −0 docs/v1/browser-compiler/coffee-script.js
- +4 −0 {documentation → docs/v1}/css/docs.css
- 0 {documentation → docs/v1}/css/tomorrow.css
- BIN {documentation → docs/v1}/images/background.png
- BIN {documentation → docs/v1}/images/banding.png
- BIN {documentation → docs/v1}/images/button_bg.png
- BIN {documentation → docs/v1}/images/button_bg_dark.gif
- BIN {documentation → docs/v1}/images/button_bg_green.gif
- BIN {documentation → docs/v1}/images/favicon.ico
- 0 {documentation → docs/v1}/images/just_logo.svg
- BIN {documentation → docs/v1}/images/logo.png
- 0 {documentation → docs/v1}/images/logo.svg
- BIN {documentation → docs/v1}/images/screenshadow.png
- +609 −330 { → docs/v1}/index.html
- +9,897 −0 docs/v1/test.html
- 0 documentation/{coffee → examples}/aliases.coffee
- 0 documentation/{coffee → examples}/array_comprehensions.coffee
- 0 documentation/{coffee → examples}/block_comment.coffee
- 0 documentation/{coffee → examples}/cake_tasks.coffee
- 0 documentation/{coffee → examples}/chaining.coffee
- 0 documentation/{coffee → examples}/classes.coffee
- 0 documentation/{coffee → examples}/comparisons.coffee
- 0 documentation/{coffee → examples}/conditionals.coffee
- 0 documentation/{coffee → examples}/constructor_destructuring.coffee
- 0 documentation/{coffee → examples}/default_args.coffee
- 0 documentation/{coffee → examples}/do.coffee
- 0 documentation/{coffee → examples}/embedded.coffee
- +5 −0 documentation/examples/embedded_block.coffee
- +3 −0 documentation/examples/embedded_escaped.coffee
- 0 documentation/{coffee → examples}/existence.coffee
- 0 documentation/{coffee → examples}/expansion.coffee
- 0 documentation/{coffee → examples}/expressions.coffee
- 0 documentation/{coffee → examples}/expressions_assignment.coffee
- 0 documentation/{coffee → examples}/expressions_comprehension.coffee
- 0 documentation/{coffee → examples}/expressions_try.coffee
- 0 documentation/{coffee → examples}/fat_arrow.coffee
- 0 documentation/{coffee → examples}/functions.coffee
- +13 −0 documentation/examples/generator_iteration.coffee
- 0 documentation/{coffee → examples}/generators.coffee
- 0 documentation/{coffee → examples}/heredocs.coffee
- 0 documentation/{coffee → examples}/heregexes.coffee
- 0 documentation/{coffee → examples}/interpolation.coffee
- 0 documentation/{coffee → examples}/modules.coffee
- 0 documentation/{coffee → examples}/modulo.coffee
- 0 documentation/{coffee → examples}/multiple_return_values.coffee
- 0 documentation/{coffee → examples}/object_comprehensions.coffee
- 0 documentation/{coffee → examples}/object_extraction.coffee
- 0 documentation/{coffee → examples}/objects_and_arrays.coffee
- 0 documentation/{coffee → examples}/objects_reserved.coffee
- +5 −0 documentation/examples/objects_shorthand.coffee
- 0 documentation/{coffee → examples}/overview.coffee
- 0 documentation/{coffee → examples}/parallel_assignment.coffee
- 0 documentation/{coffee → examples}/patterns_and_splats.coffee
- 0 documentation/{coffee → examples}/prototypes.coffee
- 0 documentation/{coffee → examples}/range_comprehensions.coffee
- 0 documentation/{coffee → examples}/scope.coffee
- 0 documentation/{coffee → examples}/slices.coffee
- 0 documentation/{coffee → examples}/soaks.coffee
- 0 documentation/{coffee → examples}/splats.coffee
- 0 documentation/{coffee → examples}/splices.coffee
- 0 documentation/{coffee → examples}/strings.coffee
- 0 documentation/{coffee → examples}/switch.coffee
- 0 documentation/{coffee → examples}/switch_with_no_expression.coffee
- +8 −0 documentation/examples/tagged_template_literals.coffee
- 0 documentation/{coffee → examples}/try.coffee
- 0 documentation/{coffee → examples}/while.coffee
- +302 −172 documentation/{index.html.js → index.html}
- +0 −24 documentation/js/aliases.js
- +0 −24 documentation/js/array_comprehensions.js
- +0 −7 documentation/js/block_comment.js
- +0 −14 documentation/js/cake_tasks.js
- +0 −4 documentation/js/chaining.js
- +0 −57 documentation/js/classes.js
- +0 −6 documentation/js/comparisons.js
- +0 −15 documentation/js/conditionals.js
- +0 −17 documentation/js/constructor_destructuring.js
- +0 −9 documentation/js/default_args.js
- +0 −12 documentation/js/do.js
- +0 −6 documentation/js/embedded.js
- +0 −14 documentation/js/existence.js
- +0 −6 documentation/js/expansion.js
- +0 −18 documentation/js/expressions.js
- +0 −4 documentation/js/expressions_assignment.js
- +0 −11 documentation/js/expressions_comprehension.js
- +0 −11 documentation/js/expressions_try.js
- +0 −12 documentation/js/fat_arrow.js
- +0 −10 documentation/js/functions.js
- +0 −13 documentation/js/generators.js
- +0 −4 documentation/js/heredocs.js
- +0 −4 documentation/js/heregexes.js
- +0 −8 documentation/js/interpolation.js
- +0 −66 documentation/js/modules.js
- +0 −8 documentation/js/modulo.js
- +0 −8 documentation/js/multiple_return_values.js
- +0 −18 documentation/js/object_comprehensions.js
- +0 −13 documentation/js/object_extraction.js
- +0 −22 documentation/js/objects_and_arrays.js
- +0 −6 documentation/js/objects_reserved.js
- +0 −45 documentation/js/overview.js
- +0 −8 documentation/js/parallel_assignment.js
- +0 −7 documentation/js/patterns_and_splats.js
- +0 −4 documentation/js/prototypes.js
- +0 −11 documentation/js/range_comprehensions.js
- +0 −12 documentation/js/scope.js
- +0 −12 documentation/js/slices.js
- +0 −4 documentation/js/soaks.js
- +0 −23 documentation/js/splats.js
- +0 −6 documentation/js/splices.js
- +0 −4 documentation/js/strings.js
- +0 −24 documentation/js/switch.js
- +0 −19 documentation/js/switch_with_no_expression.js
- +0 −12 documentation/js/try.js
- +0 −22 documentation/js/while.js
- +114 −0 documentation/test.html
- +0 −9,046 documentation/vendor/jquery-1.6.4.js
- +0 −16 examples/beautiful_code/binary_search.coffee
- +0 −13 examples/beautiful_code/quicksort_runtime.coffee
- +0 −34 examples/beautiful_code/regular_expression_matcher.coffee
- +0 −54 examples/blocks.coffee
- +0 −167 examples/code.coffee
- +0 −4 examples/computer_science/README
- +0 −25 examples/computer_science/binary_search.coffee
- +0 −11 examples/computer_science/bubble_sort.coffee
- +0 −108 examples/computer_science/linked_list.coffee
- +0 −36 examples/computer_science/luhn_algorithm.coffee
- +0 −18 examples/computer_science/merge_sort.coffee
- +0 −23 examples/computer_science/selection_sort.coffee
- +0 −20 examples/custom_repl.coffee
- +0 −181 examples/poignant.coffee
- +0 −206 examples/potion.coffee
- +0 −682 examples/underscore.coffee
- +0 −12 examples/web_server.coffee
- +0 −12 extras/coffee-script.js
- +1 −1 lib/coffee-script/browser.js
- +1 −1 lib/coffee-script/cake.js
- +5 −3 lib/coffee-script/coffee-script.js
- +1 −1 lib/coffee-script/command.js
- +29 −4 lib/coffee-script/grammar.js
- +1 −1 lib/coffee-script/helpers.js
- +1 −1 lib/coffee-script/index.js
- +45 −24 lib/coffee-script/lexer.js
- +93 −16 lib/coffee-script/nodes.js
- +1 −1 lib/coffee-script/optparse.js
- +111 −93 lib/coffee-script/parser.js
- +1 −1 lib/coffee-script/register.js
- +4 −4 lib/coffee-script/repl.js
- +19 −1 lib/coffee-script/rewriter.js
- +1 −1 lib/coffee-script/scope.js
- +1 −1 lib/coffee-script/sourcemap.js
- +7 −7 package.json
- +7 −2 src/coffee-script.coffee
- +19 −6 src/grammar.coffee
- +1 −1 src/helpers.coffee
- +44 −20 src/lexer.coffee
- +81 −12 src/nodes.coffee
- +3 −3 src/repl.coffee
- +18 −1 src/rewriter.coffee
- +40 −0 test/arrays.coffee
- +30 −26 test/comments.coffee
- +1 −1 test/compilation.coffee
- +80 −42 test/error_messages.coffee
- +38 −0 test/generators.coffee
- +67 −7 test/javascript_literals.coffee
- +116 −0 test/location.coffee
- +29 −0 test/modules.coffee
- +40 −0 test/parser.coffee
- +14 −0 test/ranges.coffee
- +1 −1 test/repl.coffee
- +4 −0 test/scope.coffee
- +17 −0 test/support/helpers.coffee
- +171 −0 test/tagged_template_literals.coffee
- +0 −121 test/test.html
View
0
.nojekyll
No changes.
View
248
Cakefile
| @@ -1,9 +1,9 @@ | ||
| -fs = require 'fs' | ||
| -path = require 'path' | ||
| -_ = require 'underscore' | ||
| -CoffeeScript = require './lib/coffee-script' | ||
| -{spawn, exec} = require 'child_process' | ||
| -helpers = require './lib/coffee-script/helpers' | ||
| +fs = require 'fs' | ||
| +path = require 'path' | ||
| +_ = require 'underscore' | ||
| +{ spawn, exec, execSync } = require 'child_process' | ||
| +CoffeeScript = require './lib/coffee-script' | ||
| +helpers = require './lib/coffee-script/helpers' | ||
| # ANSI Terminal Colors. | ||
| bold = red = green = reset = '' | ||
| @@ -24,6 +24,9 @@ header = """ | ||
| */ | ||
| """ | ||
| +# Used in folder names like docs/v1 | ||
| +majorVersion = CoffeeScript.VERSION.split('.')[0] | ||
| + | ||
| # Build the CoffeeScript language from source. | ||
| build = (cb) -> | ||
| files = fs.readdirSync 'src' | ||
| @@ -35,76 +38,23 @@ run = (args, cb) -> | ||
| proc = spawn 'node', ['bin/coffee'].concat(args) | ||
| proc.stderr.on 'data', (buffer) -> console.log buffer.toString() | ||
| proc.on 'exit', (status) -> | ||
| - process.exit(1) if status != 0 | ||
| + process.exit(1) if status isnt 0 | ||
| cb() if typeof cb is 'function' | ||
| # Log a message with a color. | ||
| log = (message, color, explanation) -> | ||
| console.log color + message + reset + ' ' + (explanation or '') | ||
| -codeFor = -> | ||
| - counter = 0 | ||
| - hljs = require 'highlight.js' | ||
| - hljs.configure classPrefix: '' | ||
| - (file, executable = false, showLoad = true) -> | ||
| - counter++ | ||
| - return unless fs.existsSync "documentation/js/#{file}.js" | ||
| - cs = fs.readFileSync "documentation/coffee/#{file}.coffee", 'utf-8' | ||
| - js = fs.readFileSync "documentation/js/#{file}.js", 'utf-8' | ||
| - js = js.replace /^\/\/ generated.*?\n/i, '' | ||
| - | ||
| - cshtml = "<pre><code>#{hljs.highlight('coffeescript', cs).value}</code></pre>" | ||
| - # Temporary fix until highlight.js adds support for newer CoffeeScript reserved words | ||
| - if file is 'modules' | ||
| - cshtml = cshtml.replace /(import|export|from|as|default) /g, '<span class="reserved">$1</span> ' | ||
| - jshtml = "<pre><code>#{hljs.highlight('javascript', js).value}</code></pre>" | ||
| - append = if executable is yes then '' else "alert(#{executable});" | ||
| - if executable and executable != yes | ||
| - cs.replace /(\S)\s*\Z/m, "$1\n\nalert #{executable}" | ||
| - run = if executable is true then 'run' else "run: #{executable}" | ||
| - name = "example#{counter}" | ||
| - script = "<script>window.#{name} = #{JSON.stringify cs}</script>" | ||
| - load = if showLoad then "<div class='minibutton load' onclick='javascript: loadConsole(#{name});'>load</div>" else '' | ||
| - button = if executable then "<div class='minibutton ok' onclick='javascript: #{js};#{append}'>#{run}</div>" else '' | ||
| - "<div class='code'>#{cshtml}#{jshtml}#{script}#{load}#{button}<br class='clear' /></div>" | ||
| - | ||
| -monthNames = [ | ||
| - 'January' | ||
| - 'February' | ||
| - 'March' | ||
| - 'April' | ||
| - 'May' | ||
| - 'June' | ||
| - 'July' | ||
| - 'August' | ||
| - 'September' | ||
| - 'October' | ||
| - 'November' | ||
| - 'December' | ||
| -] | ||
| - | ||
| -formatDate = (date) -> | ||
| - date.replace /^(\d\d\d\d)-(\d\d)-(\d\d)$/, (match, $1, $2, $3) -> | ||
| - "#{monthNames[$2 - 1]} #{+$3}, #{$1}" | ||
| - | ||
| -releaseHeader = (date, version, prevVersion) -> """ | ||
| - <div class="anchor" id="#{version}"></div> | ||
| - <b class="header"> | ||
| - #{prevVersion and "<a href=\"https://github.com/jashkenas/coffeescript/compare/#{prevVersion}...#{version}\">#{version}</a>" or version} | ||
| - <span class="timestamp"> — <time datetime="#{date}">#{formatDate date}</time></span> | ||
| - </b> | ||
| -""" | ||
| - | ||
| option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`' | ||
| task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) -> | ||
| base = options.prefix or '/usr/local' | ||
| lib = "#{base}/lib/coffee-script" | ||
| bin = "#{base}/bin" | ||
| node = "~/.node_libraries/coffee-script" | ||
| - console.log "Installing CoffeeScript to #{lib}" | ||
| - console.log "Linking to #{node}" | ||
| - console.log "Linking 'coffee' to #{bin}/coffee" | ||
| + console.log "Installing CoffeeScript to #{lib}" | ||
| + console.log "Linking to #{node}" | ||
| + console.log "Linking 'coffee' to #{bin}/coffee" | ||
| exec([ | ||
| "mkdir -p #{lib} #{bin}" | ||
| "cp -rf bin lib LICENSE README.md package.json src #{lib}" | ||
| @@ -133,10 +83,11 @@ task 'build:full', 'rebuild the source twice, and run the tests', -> | ||
| task 'build:parser', 'rebuild the Jison parser (run build first)', -> | ||
| - helpers.extend global, require('util') | ||
| + helpers.extend global, require 'util' | ||
| require 'jison' | ||
| parser = require('./lib/coffee-script/grammar').parser | ||
| - fs.writeFile 'lib/coffee-script/parser.js', parser.generate() | ||
| + fs.writeFileSync 'lib/coffee-script/parser.js', parser.generate() | ||
| + | ||
| task 'build:browser', 'rebuild the merged script for inclusion in the browser', -> | ||
| code = '' | ||
| @@ -164,37 +115,139 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser', | ||
| }(this)); | ||
| """ | ||
| unless process.env.MINIFY is 'false' | ||
| - {code} = require('uglify-js').minify code, fromString: true | ||
| - fs.writeFileSync 'extras/coffee-script.js', header + '\n' + code | ||
| + {compiledCode} = require('google-closure-compiler-js').compile | ||
| + jsCode: [ | ||
| + src: code | ||
| + languageOut: if majorVersion is 1 then 'ES5' else 'ES6' | ||
| + ] | ||
| + outputFolder = "docs/v#{majorVersion}/browser-compiler" | ||
| + fs.mkdirSync outputFolder unless fs.existsSync outputFolder | ||
| + fs.writeFileSync "#{outputFolder}/coffee-script.js", header + '\n' + compiledCode | ||
| console.log "built ... running browser tests:" | ||
| invoke 'test:browser' | ||
| task 'doc:site', 'watch and continually rebuild the documentation for the website', -> | ||
| - source = 'documentation/index.html.js' | ||
| - exec 'bin/coffee -bc -o documentation/js documentation/coffee/*.coffee' | ||
| + # Helpers | ||
| + codeFor = -> | ||
| + counter = 0 | ||
| + hljs = require 'highlight.js' | ||
| + hljs.configure classPrefix: '' | ||
| + (file, executable = false, showLoad = true) -> | ||
| + counter++ | ||
| + return unless fs.existsSync "docs/v#{majorVersion}/examples/#{file}.js" | ||
| + cs = fs.readFileSync "documentation/examples/#{file}.coffee", 'utf-8' | ||
| + js = fs.readFileSync "docs/v#{majorVersion}/examples/#{file}.js", 'utf-8' | ||
| + js = js.replace /^\/\/ generated.*?\n/i, '' | ||
| + | ||
| + cshtml = "<pre><code>#{hljs.highlight('coffeescript', cs).value}</code></pre>" | ||
| + # Temporary fix until highlight.js adds support for newer CoffeeScript keywords | ||
| + # Added in https://github.com/isagalaev/highlight.js/pull/1357, awaiting release | ||
| + if file in ['generator_iteration', 'generators', 'modules'] | ||
| + cshtml = cshtml.replace /(yield|import|export|from|as|default) /g, '<span class="keyword">$1</span> ' | ||
| + jshtml = "<pre><code>#{hljs.highlight('javascript', js).value}</code></pre>" | ||
| + append = if executable is yes then '' else "alert(#{executable});".replace /"/g, '"' | ||
| + if executable and executable isnt yes | ||
| + cs.replace /(\S)\s*\Z/m, "$1\n\nalert #{executable}" | ||
| + run = if executable is true then 'run' else "run: #{executable}" | ||
| + name = "example#{counter}" | ||
| + script = "<script>window.#{name} = #{JSON.stringify cs}</script>" | ||
| + load = if showLoad then "<div class='minibutton load' onclick='javascript: loadConsole(#{name});'>load</div>" else '' | ||
| + button = if executable then """<div class="minibutton ok" onclick="javascript: #{js.replace /"/g, '"'};#{append}">#{run}</div>""" else '' | ||
| + "<div class='code'>#{cshtml}#{jshtml}#{script}#{load}#{button}<br class='clear' /></div>" | ||
| + | ||
| + monthNames = [ | ||
| + 'January' | ||
| + 'February' | ||
| + 'March' | ||
| + 'April' | ||
| + 'May' | ||
| + 'June' | ||
| + 'July' | ||
| + 'August' | ||
| + 'September' | ||
| + 'October' | ||
| + 'November' | ||
| + 'December' | ||
| + ] | ||
| + | ||
| + formatDate = (date) -> | ||
| + date.replace /^(\d\d\d\d)-(\d\d)-(\d\d)$/, (match, $1, $2, $3) -> | ||
| + "#{monthNames[$2 - 1]} #{+$3}, #{$1}" | ||
| + | ||
| + releaseHeader = (date, version, prevVersion) -> """ | ||
| + <div class="anchor" id="#{version}"></div> | ||
| + <b class="header"> | ||
| + #{prevVersion and "<a href=\"https://github.com/jashkenas/coffeescript/compare/#{prevVersion}...#{version}\">#{version}</a>" or version} | ||
| + <span class="timestamp"> — <time datetime="#{date}">#{formatDate date}</time></span> | ||
| + </b> | ||
| + """ | ||
| + testHelpers = fs.readFileSync('test/support/helpers.coffee', 'utf-8').replace /exports\./g, '@' | ||
| + | ||
| + testsInScriptBlocks = -> | ||
| + output = '' | ||
| + excludedTestFiles = ['error_messages.coffee'] | ||
| + for filename in fs.readdirSync 'test' | ||
| + continue if filename in excludedTestFiles | ||
| + | ||
| + if filename.indexOf('.coffee') isnt -1 | ||
| + type = 'coffeescript' | ||
| + else if filename.indexOf('.litcoffee') isnt -1 | ||
| + type = 'literate-coffeescript' | ||
| + else | ||
| + continue | ||
| + | ||
| + # Set the type to text/x-coffeescript or text/x-literate-coffeescript | ||
| + # to prevent the browser compiler from automatically running the script | ||
| + output += """ | ||
| + <script type="text/x-#{type}" class="test" id="#{filename.split('.')[0]}"> | ||
| + #{fs.readFileSync "test/#{filename}", 'utf-8'} | ||
| + </script>\n | ||
| + """ | ||
| + output | ||
| + | ||
| + # Task | ||
| + examplesSourceFolder = 'documentation/examples' | ||
| + examplesOutputFolder = "docs/v#{majorVersion}/examples" | ||
| + fs.mkdirSync examplesOutputFolder unless fs.existsSync examplesOutputFolder | ||
| + do renderExamples = -> | ||
| + execSync "bin/coffee -bc -o #{examplesOutputFolder} #{examplesSourceFolder}/*.coffee" | ||
| + | ||
| + indexFile = 'documentation/index.html' | ||
| do renderIndex = -> | ||
| - codeSnippetCounter = 0 | ||
| - rendered = _.template fs.readFileSync(source, 'utf-8'), | ||
| + render = _.template fs.readFileSync(indexFile, 'utf-8') | ||
| + output = render | ||
| codeFor: codeFor() | ||
| releaseHeader: releaseHeader | ||
| - fs.writeFileSync 'index.html', rendered | ||
| - log "compiled", green, "#{source}" | ||
| - | ||
| - fs.watchFile source, interval: 200, renderIndex | ||
| - log "watching..." , green | ||
| + majorVersion: majorVersion | ||
| + fullVersion: CoffeeScript.VERSION | ||
| + fs.writeFileSync "docs/v#{majorVersion}/index.html", output | ||
| + log 'compiled', green, "#{indexFile} → docs/v#{majorVersion}/index.html" | ||
| + | ||
| + testFile = 'documentation/test.html' | ||
| + do renderTest = -> | ||
| + render = _.template fs.readFileSync(testFile, 'utf-8') | ||
| + output = render | ||
| + testHelpers: testHelpers | ||
| + tests: testsInScriptBlocks() | ||
| + majorVersion: majorVersion | ||
| + fs.writeFileSync "docs/v#{majorVersion}/test.html", output | ||
| + log 'compiled', green, "#{testFile} → docs/v#{majorVersion}/test.html" | ||
| + | ||
| + fs.watch examplesSourceFolder, interval: 200, -> | ||
| + renderExamples() | ||
| + renderIndex() | ||
| + fs.watch indexFile, interval: 200, renderIndex | ||
| + fs.watch testFile, interval: 200, renderTest | ||
| + fs.watch 'test', interval: 200, renderTest | ||
| + log 'watching...' , green | ||
| + | ||
| + | ||
| +task 'doc:source', 'rebuild the annotated source documentation', -> | ||
| + exec "node_modules/docco/bin/docco src/*.*coffee --output docs/v#{majorVersion}/annotated-source", (err) -> throw err if err | ||
| -task 'doc:source', 'rebuild the internal documentation', -> | ||
| - exec 'node_modules/.bin/docco src/*.*coffee && cp -rf docs documentation && rm -r docs', (err) -> | ||
| - throw err if err | ||
| - | ||
| - | ||
| -task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', -> | ||
| - exec 'node_modules/.bin/docco examples/underscore.coffee && cp -rf docs documentation && rm -r docs', (err) -> | ||
| - throw err if err | ||
| - | ||
| task 'bench', 'quick benchmark of compilation time', -> | ||
| {Rewriter} = require './lib/coffee-script/rewriter' | ||
| sources = ['coffee-script', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter'] | ||
| @@ -244,23 +297,7 @@ runTests = (CoffeeScript) -> | ||
| description: description if description? | ||
| source: fn.toString() if fn.toString? | ||
| - # See http://wiki.ecmascript.org/doku.php?id=harmony:egal | ||
| - egal = (a, b) -> | ||
| - if a is b | ||
| - a isnt 0 or 1/a is 1/b | ||
| - else | ||
| - a isnt a and b isnt b | ||
| - | ||
| - # A recursive functional equivalence helper; uses egal for testing equivalence. | ||
| - arrayEgal = (a, b) -> | ||
| - if egal a, b then yes | ||
| - else if a instanceof Array and b instanceof Array | ||
| - return no unless a.length is b.length | ||
| - return no for el, idx in a when not arrayEgal el, b[idx] | ||
| - yes | ||
| - | ||
| - global.eq = (a, b, msg) -> ok egal(a, b), msg ? "Expected #{a} to equal #{b}" | ||
| - global.arrayEq = (a, b, msg) -> ok arrayEgal(a,b), msg ? "Expected #{a} to deep equal #{b}" | ||
| + helpers.extend global, require './test/support/helpers' | ||
| # When all the tests have run, collect and print errors. | ||
| # If a stacktrace is available, output the compiled function source. | ||
| @@ -280,11 +317,6 @@ runTests = (CoffeeScript) -> | ||
| # Run every test in the `test` folder, recording failures. | ||
| files = fs.readdirSync 'test' | ||
| - # Ignore generators test file if generators are not available | ||
| - generatorsAreAvailable = '--harmony' in process.execArgv or | ||
| - '--harmony-generators' in process.execArgv | ||
| - files.splice files.indexOf('generators.coffee'), 1 if not generatorsAreAvailable | ||
| - | ||
| for file in files when helpers.isCoffee file | ||
| literate = helpers.isLiterate file | ||
| currentFile = filename = path.join 'test', file | ||
| @@ -301,7 +333,7 @@ task 'test', 'run the CoffeeScript language test suite', -> | ||
| task 'test:browser', 'run the test suite against the merged browser script', -> | ||
| - source = fs.readFileSync 'extras/coffee-script.js', 'utf-8' | ||
| + source = fs.readFileSync "docs/v#{majorVersion}/browser-compiler/coffee-script.js", 'utf-8' | ||
| result = {} | ||
| global.testingBrowser = yes | ||
| (-> eval source).call result | ||
View
8
bower.json
| @@ -1,6 +1,5 @@ | ||
| { | ||
| "name": "coffee-script", | ||
| - "version": "1.11.1", | ||
| "main": [ | ||
| "lib/coffee-script/coffee-script.js" | ||
| ], | ||
| @@ -11,13 +10,6 @@ | ||
| "coffeescript", | ||
| "compiler" | ||
| ], | ||
| - "devDependencies": { | ||
| - "uglify-js": "~2.2", | ||
| - "jison": ">=0.2.0", | ||
| - "highlight.js": "~9.6.0", | ||
| - "underscore": "~1.5.2", | ||
| - "docco": "~0.6.2" | ||
| - }, | ||
| "author": { | ||
| "name": "Jeremy Ashkenas" | ||
| }, | ||
View
0
CNAME → docs/CNAME
File renamed without changes.
View
1
docs/index.html
| @@ -0,0 +1 @@ | ||
| +v1/index.html |
View
1
docs/v1/.gitignore
| @@ -0,0 +1 @@ | ||
| +examples/ |
View
0
documentation/docs/browser.html → docs/v1/annotated-source/browser.html
File renamed without changes.
View
0
documentation/docs/cake.html → docs/v1/annotated-source/cake.html
File renamed without changes.
Oops, something went wrong.