Comparing changes
Open a pull request
|
|
jamierumbelow |
Adding Testing with CoffeeScript to books list
|
7c53d8c
|
|
|
jashkenas |
ignore litcoffee files
|
76a25dc
|
|||
|
|
jashkenas |
removing export of RESERVED ... more progress.
|
9167b3a
|
|||
|
|
jashkenas |
start with comments...
|
bb194dc
|
|
|
jashkenas |
first working version of literate coffeescript
|
82fadea
|
|||
|
|
jashkenas |
fixing block comment indentation
|
4fb3a31
|
|||
|
|
jashkenas |
pretty decent initial test.
|
b4e13b2
|
|
|
epidemian |
Remove return statement on auto-generated constructors
|
e46b129
|
|||
|
|
epidemian |
Prevent constructors from returning values
|
52b0f76
|
|
|
lihanli |
tests for the repl: ignoring comments, output in inspect mode, variab…
…le saving |
3284f6a
|
|
|
jwalton |
Remove debug logging from Cakefile.
|
d5d772d
|
|||
|
|
jwalton |
Add location data to nodes without passing it in constructors.
|
25126e2
|
|
|
jwalton |
Lexer now adds location data, including first/last line/column to all…
… generated tokens. |
bb94e02
|
|
|
jwalton |
Add location data to tokens generated by the rewriter.
|
12625cc
|
|||
|
|
jwalton |
Clean up TODOs
|
df6c497
|
|
|
jwalton |
Fix TODO in interpolateString.
|
969e45a
|
|
|
jwalton |
Hook up new token location data to parser.
|
3142b23
|
|
|
jwalton |
Fix broken case for generated explicit indentation.
|
183e124
|
|
|
int3 |
Parse compound assignment followed by a terminator.
Closes #2532. |
847ab4d
|
|
|
caseywebdev |
gh-2631 Update to uglifyjs's new API
|
9e3d431
|
|||
|
|
jashkenas |
Merge pull request #2632 from caseywebdev/update-uglify
gh-2631 Update to uglifyjs's new API |
de29613
|
|
|
jwalton |
Location test.
|
cee4f4a
|
|
|
jashkenas |
Merge branch 'master' into literate
|
48d6258
|
|||
|
|
jashkenas |
bumping version to 1.5.0-pre
|
ba08a21
|
|||
|
|
jashkenas |
add litcoffee to supported file formats
|
27551b2
|
|
|
jashkenas |
Fixes #2645 -- block comments should always be closed
|
cd2444e
|
|||
|
|
jashkenas |
Merge pull request #2627 from int3/master
Parse compound assignment operator followed by a terminator. Closes #2532. |
547a271
|
|||
|
|
jashkenas |
adding one more compound operator test for #2627
|
f8c751b
|
|||
|
|
jashkenas |
Fixes #2622 -- better document how --nodejs flag works
|
2c20ac6
|
|||
|
|
jashkenas |
Fixes #2621 -- buggy function parameter name detection with complex d…
…estructuring in param list. |
cc6f045
|
|
|
michaelficarra |
rebuilding after cdde576
|
dfe91d1
|
|||
|
|
michaelficarra |
revert broken parts of cdde576
Thanks @alagopus. |
66bbef4
|
|||
|
|
michaelficarra |
fix 'litcoffee' extension support
|
f672e0c
|
|
|
satyr |
fix tabbed literate code
|
9595b30
|
|
|
jwalton |
Use .explicit when deciding whether or not to add location data.
|
a9aa52d
|
|||
|
|
jwalton |
Merge remote-tracking branch 'origin/master'
Conflicts: lib/coffee-script/coffee-script.js lib/coffee-script/lexer.js lib/coffee-script/parser.js src/lexer.coffee |
a1ba0a8
|
|||
|
|
jashkenas |
Reverting the unthrow of the error.
|
6becd8f
|
|||
|
|
jashkenas |
do not try to compile traces of coffee within node_modules
|
d11fa57
|
|||
|
|
jwalton |
Put location data in token[2] instead of in token.locationData
|
bbbf612
|
|||
|
|
jwalton |
Add quick unit test for location data.
|
97bc9f4
|
|||
|
|
jwalton |
Remove files committed by accident.
|
923739e
|
|||
|
|
jwalton |
Add unit tests, fix last_column reporting.
|
f67da27
|
|
|
asalant |
Merge branch 'repl-tests' of https://github.com/lihanli/coffee-script …
…into node_repl |
1f051e6
|
|
|
asalant |
Multiline WIP
|
4a52814
|
|
|
michaelficarra |
Merge branch 'node_repl_multiline' of https://github.com/asalant/coff…
…ee-script into repl-rewrite |
2e191dc
|
|
|
michaelficarra |
finish multiline support for REPL rewrite
|
041033a
|
|||
|
|
michaelficarra |
fix some issues pointed out in 041033a
|
537c5f4
|
|
|
asalant |
REPL tests based on direct interaction with input and output stream. …
…Includes multiline tests. |
47bd05e
|
|
|
asalant |
Remove testing TODO
|
7020715
|
|||
|
|
michaelficarra |
final tweaks to REPL rewrite
We can still use some more extensive tests, but it's already much better tested than the current REPL. |
be9707f
|
|||
|
|
michaelficarra |
fix typo; thanks @Nami-Doc
|
b1300bd
|
|||
|
|
jashkenas |
Merge pull request #2682 from jashkenas/repl-rewrite
REPL rewrite |
a106fb4
|
|
|
jordimassaguerpla |
add license information to gemspec
this way you can get this info from the rubygems.org API |
64fe56a
|
|
|
jordimassaguerpla |
fix spacing in Rakefile
previous commit was not following the right indentation when adding the license field. |
bf4d91d
|
|||
|
|
jashkenas |
Merge pull request #2685 from jordimassaguerpla/master
add license information to the gemspec |
7239074
|
|
|
jwalton |
Merge remote-tracking branch 'upstream/master'
Conflicts: lib/coffee-script/grammar.js lib/coffee-script/rewriter.js src/grammar.coffee src/rewriter.coffee |
fe45f1b
|
|||
|
|
jwalton |
Update js files.
|
c31bc6d
|
|
|
raganwald |
CLoses #2700
Signed-off-by: Reg Braithwaite <[email protected]> |
46ecfd3
|
|||
|
|
jashkenas |
Merge pull request #2480 from jamierumbelow/patch-1
Adding Testing with CoffeeScript to books list |
31dd0b7
|
|||
|
|
jashkenas |
moving book link to the proper place to be rebuilt
|
1aa57bf
|
|
|
jashkenas |
Fixes #2359 -- tweak grammar to use new name
|
fa1ffa6
|
|||
|
|
jwalton |
Merge remote-tracking branch 'upstream/master'
Conflicts: lib/coffee-script/grammar.js src/grammar.coffee |
5e49df8
|
|
|
jwalton |
Fix merge problem, and rebuild parser.js
|
e1a2e11
|
|
|
troels |
Use the newly compiled code when running tests under build:full
|
7f8b56e
|
|||
|
|
michaelficarra |
Merge pull request #2710 from troels/fix-full-build-tests
Build:full sometimes uses old code when running tests. |
8f0a777
|
|||
|
|
troels |
Fix #1435 by amending away sign reversal.
|
a320e1e
|
|||
|
|
michaelficarra |
Merge pull request #2711 from troels/fix-1435
Fix #1435 by amending away sign reversal. |
3d3fe0d
|
- +1 −0 .gitignore
- +31 −33 Cakefile
- +1 −0 Rakefile
- +1 −1 documentation/coffee/block_comment.coffee
- +1 −1 documentation/docs/browser.html
- +1 −1 documentation/docs/cake.html
- +28 −23 documentation/docs/coffee-script.html
- +30 −33 documentation/docs/command.html
- +113 −99 documentation/docs/grammar.html
- +25 −2 documentation/docs/helpers.html
- +1 −1 documentation/docs/index.html
- +225 −120 documentation/docs/lexer.html
- +188 −162 documentation/docs/nodes.html
- +1 −1 documentation/docs/optparse.html
- +53 −138 documentation/docs/repl.html
- +40 −20 documentation/docs/rewriter.html
- +106 −43 documentation/index.html.erb
- +1 −1 documentation/js/aliases.js
- +1 −1 documentation/js/array_comprehensions.js
- +2 −2 documentation/js/block_comment.js
- +1 −1 documentation/js/cake_tasks.js
- +3 −3 documentation/js/classes.js
- +1 −1 documentation/js/comparisons.js
- +1 −1 documentation/js/conditionals.js
- +1 −1 documentation/js/default_args.js
- +1 −1 documentation/js/do.js
- +1 −1 documentation/js/embedded.js
- +2 −2 documentation/js/existence.js
- +1 −1 documentation/js/expressions.js
- +1 −1 documentation/js/expressions_assignment.js
- +1 −1 documentation/js/expressions_comprehension.js
- +1 −1 documentation/js/expressions_try.js
- +1 −1 documentation/js/fat_arrow.js
- +1 −1 documentation/js/functions.js
- +1 −1 documentation/js/heredocs.js
- +1 −1 documentation/js/heregexes.js
- +1 −1 documentation/js/interpolation.js
- +1 −1 documentation/js/multiple_return_values.js
- +1 −1 documentation/js/object_comprehensions.js
- +1 −1 documentation/js/object_extraction.js
- +1 −1 documentation/js/objects_and_arrays.js
- +1 −1 documentation/js/objects_reserved.js
- +1 −1 documentation/js/overview.js
- +1 −1 documentation/js/parallel_assignment.js
- +1 −1 documentation/js/patterns_and_splats.js
- +1 −1 documentation/js/prototypes.js
- +1 −1 documentation/js/range_comprehensions.js
- +1 −1 documentation/js/scope.js
- +1 −1 documentation/js/slices.js
- +1 −1 documentation/js/soaks.js
- +1 −1 documentation/js/splats.js
- +1 −1 documentation/js/splices.js
- +1 −1 documentation/js/strings.js
- +1 −1 documentation/js/switch.js
- +1 −1 documentation/js/try.js
- +1 −1 documentation/js/while.js
- +5 −2 extras/coffee-script.js
- +115 −52 index.html
- +1 −1 lib/coffee-script/browser.js
- +1 −1 lib/coffee-script/cake.js
- +37 −32 lib/coffee-script/coffee-script.js
- +28 −35 lib/coffee-script/command.js
- +57 −41 lib/coffee-script/grammar.js
- +38 −2 lib/coffee-script/helpers.js
- +1 −1 lib/coffee-script/index.js
- +185 −74 lib/coffee-script/lexer.js
- +141 −113 lib/coffee-script/nodes.js
- +1 −1 lib/coffee-script/optparse.js
- +262 −336 lib/coffee-script/parser.js
- +81 −253 lib/coffee-script/repl.js
- +42 −10 lib/coffee-script/rewriter.js
- +1 −1 lib/coffee-script/scope.js
- +2 −2 package.json
- +25 −17 src/coffee-script.coffee
- +16 −22 src/command.coffee
- +59 −39 src/grammar.coffee
- +34 −0 src/helpers.coffee
- +234 −74 src/lexer.coffee
- +116 −89 src/nodes.coffee
- +72 −192 src/repl.coffee
- +33 −10 src/rewriter.coffee
- +0 −101 src/scope.coffee
- +117 −0 src/scope.litcoffee
- +18 −3 test/assignment.coffee
- +25 −5 test/classes.coffee
- +43 −4 test/comprehensions.coffee
- +13 −0 test/exception_handling.coffee
- +8 −0 test/function_invocation.coffee
- +21 −2 test/functions.coffee
- +48 −0 test/literate.litcoffee
- +46 −0 test/location.coffee
- +14 −2 test/operators.coffee
- +79 −1 test/repl.coffee
- +0 −1 test/test.html
| @@ -1,6 +1,7 @@ | ||
| raw | ||
| presentation | ||
| test.coffee | ||
| +test.litcoffee | ||
| parser.output | ||
| test/fixtures/underscore | ||
| test/*.js | ||
| @@ -5,12 +5,8 @@ CoffeeScript = require './lib/coffee-script' | ||
| {spawn, exec} = require 'child_process' | ||
| # ANSI Terminal Colors. | ||
| -enableColors = no | ||
| -unless process.platform is 'win32' | ||
| - enableColors = not process.env.NODE_DISABLE_COLORS | ||
| - | ||
| bold = red = green = reset = '' | ||
| -if enableColors | ||
| +unless process.env.NODE_DISABLE_COLORS | ||
| bold = '\x1B[0;1m' | ||
| red = '\x1B[0;31m' | ||
| green = '\x1B[0;32m' | ||
| @@ -27,11 +23,6 @@ header = """ | ||
| */ | ||
| """ | ||
| -sources = [ | ||
| - 'coffee-script', 'grammar', 'helpers' | ||
| - 'lexer', 'nodes', 'rewriter', 'scope' | ||
| -].map (filename) -> "src/#{filename}.coffee" | ||
| - | ||
| # Run a CoffeeScript through our node/coffee interpreter. | ||
| run = (args, cb) -> | ||
| proc = spawn 'node', ['bin/coffee'].concat(args) | ||
| @@ -68,15 +59,19 @@ task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) | ||
| task 'build', 'build the CoffeeScript language from source', build = (cb) -> | ||
| files = fs.readdirSync 'src' | ||
| - files = ('src/' + file for file in files when file.match(/\.coffee$/)) | ||
| + files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/)) | ||
| run ['-c', '-o', 'lib/coffee-script'].concat(files), cb | ||
| task 'build:full', 'rebuild the source twice, and run the tests', -> | ||
| build -> | ||
| build -> | ||
| csPath = './lib/coffee-script' | ||
| - delete require.cache[require.resolve csPath] | ||
| + csDir = path.dirname require.resolve csPath | ||
| + | ||
| + for mod of require.cache when csDir is mod[0 ... csDir.length] | ||
| + delete require.cache[mod] | ||
| + | ||
| unless runTests require csPath | ||
| process.exit 1 | ||
| @@ -113,14 +108,13 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser', | ||
| if (typeof define === 'function' && define.amd) { | ||
| define(function() { return CoffeeScript; }); | ||
| - } else { | ||
| - root.CoffeeScript = CoffeeScript; | ||
| + } else { | ||
| + root.CoffeeScript = CoffeeScript; | ||
| } | ||
| }(this)); | ||
| """ | ||
| unless process.env.MINIFY is 'false' | ||
| - {parser, uglify} = require 'uglify-js' | ||
| - code = uglify.gen_code uglify.ast_squeeze uglify.ast_mangle parser.parse code | ||
| + {code} = require('uglify-js').minify code, fromString: true | ||
| fs.writeFileSync 'extras/coffee-script.js', header + '\n' + code | ||
| console.log "built ... running browser tests:" | ||
| invoke 'test:browser' | ||
| @@ -142,25 +136,25 @@ task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', -> | ||
| task 'bench', 'quick benchmark of compilation time', -> | ||
| {Rewriter} = require './lib/coffee-script/rewriter' | ||
| - co = sources.map((name) -> fs.readFileSync name).join '\n' | ||
| + sources = ['coffee-script', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter'] | ||
| + coffee = sources.map((name) -> fs.readFileSync "src/#{name}.coffee").join '\n' | ||
| + litcoffee = fs.readFileSync("src/scope.litcoffee").toString() | ||
| fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms" | ||
| total = 0 | ||
| now = Date.now() | ||
| time = -> total += ms = -(now - now = Date.now()); fmt ms | ||
| - tokens = CoffeeScript.tokens co, rewrite: false | ||
| + tokens = CoffeeScript.tokens coffee, rewrite: no | ||
| + littokens = CoffeeScript.tokens litcoffee, rewrite: no, literate: yes | ||
| + tokens = tokens.concat(littokens) | ||
| console.log "Lex #{time()} (#{tokens.length} tokens)" | ||
| tokens = new Rewriter().rewrite tokens | ||
| console.log "Rewrite#{time()} (#{tokens.length} tokens)" | ||
| nodes = CoffeeScript.nodes tokens | ||
| console.log "Parse #{time()}" | ||
| - js = nodes.compile bare: true | ||
| + js = nodes.compile bare: yes | ||
| console.log "Compile#{time()} (#{js.length} chars)" | ||
| console.log "total #{ fmt total }" | ||
| -task 'loc', 'count the lines of source code in the CoffeeScript compiler', -> | ||
| - exec "cat #{ sources.join(' ') } | grep -v '^\\( *#\\|\\s*$\\)' | wc -l | tr -s ' '", (err, stdout) -> | ||
| - console.log stdout.trim() | ||
| - | ||
| # Run the CoffeeScript test suite. | ||
| runTests = (CoffeeScript) -> | ||
| @@ -173,6 +167,7 @@ runTests = (CoffeeScript) -> | ||
| # Convenience aliases. | ||
| global.CoffeeScript = CoffeeScript | ||
| + global.Repl = require './lib/coffee-script/repl' | ||
| # Our test helper function for delimiting different test cases. | ||
| global.test = (description, fn) -> | ||
| @@ -181,9 +176,11 @@ runTests = (CoffeeScript) -> | ||
| fn.call(fn) | ||
| ++passedTests | ||
| catch e | ||
| - e.description = description if description? | ||
| - e.source = fn.toString() if fn.toString? | ||
| - failures.push filename: currentFile, error: e | ||
| + failures.push | ||
| + filename: currentFile | ||
| + error: e | ||
| + description: description if description? | ||
| + source: fn.toString() if fn.toString? | ||
| # See http://wiki.ecmascript.org/doku.php?id=harmony:egal | ||
| egal = (a, b) -> | ||
| @@ -200,8 +197,8 @@ runTests = (CoffeeScript) -> | ||
| return no for el, idx in a when not arrayEgal el, b[idx] | ||
| yes | ||
| - global.eq = (a, b, msg) -> ok egal(a, b), msg | ||
| - global.arrayEq = (a, b, msg) -> ok arrayEgal(a,b), msg | ||
| + 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}" | ||
| # When all the tests have run, collect and print errors. | ||
| # If a stacktrace is available, output the compiled function source. | ||
| @@ -211,25 +208,26 @@ runTests = (CoffeeScript) -> | ||
| return log(message, green) unless failures.length | ||
| log "failed #{failures.length} and #{message}", red | ||
| for fail in failures | ||
| - {error, filename} = fail | ||
| + {error, filename, description, source} = fail | ||
| jsFilename = filename.replace(/\.coffee$/,'.js') | ||
| match = error.stack?.match(new RegExp(fail.file+":(\\d+):(\\d+)")) | ||
| match = error.stack?.match(/on line (\d+):/) unless match | ||
| [match, line, col] = match if match | ||
| console.log '' | ||
| - log " #{error.description}", red if error.description | ||
| + log " #{description}", red if description | ||
| log " #{error.stack}", red | ||
| log " #{jsFilename}: line #{line ? 'unknown'}, column #{col ? 'unknown'}", red | ||
| - console.log " #{error.source}" if error.source | ||
| + console.log " #{source}" if source | ||
| return | ||
| # Run every test in the `test` folder, recording failures. | ||
| files = fs.readdirSync 'test' | ||
| - for file in files when file.match /\.coffee$/i | ||
| + for file in files when file.match /\.(lit)?coffee$/i | ||
| + literate = path.extname(file) is '.litcoffee' | ||
| currentFile = filename = path.join 'test', file | ||
| code = fs.readFileSync filename | ||
| try | ||
| - CoffeeScript.run code.toString(), {filename} | ||
| + CoffeeScript.run code.toString(), {filename, literate} | ||
| catch error | ||
| failures.push {filename, error} | ||
| return !failures.length | ||
| @@ -49,6 +49,7 @@ task :gem do | ||
| s.authors = ['Jeremy Ashkenas'] | ||
| s.email = '[email protected]' | ||
| s.rubyforge_project = 'coffee-script-source' | ||
| + s.license = "MIT" | ||
| end | ||
| file = File.open("coffee-script-source.gem", "w") | ||
| @@ -1,5 +1,5 @@ | ||
| ### | ||
| -CoffeeScript Compiler v1.4.0 | ||
| +CoffeeScript Compiler v1.5.0 | ||
| Released under the MIT License | ||
| ### | ||
| @@ -1,4 +1,4 @@ | ||
| -<!DOCTYPE html> <html> <head> <title>browser.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> <a class="source" href="scope.html"> scope.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> browser.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p>Override exported methods for non-Node.js engines.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript = </span><span class="nx">require</span> <span class="s">'./coffee-script'</span> | ||
| +<!DOCTYPE html> <html> <head> <title>browser.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> browser.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p>Override exported methods for non-Node.js engines.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript = </span><span class="nx">require</span> <span class="s">'./coffee-script'</span> | ||
| <span class="nv">CoffeeScript.require = </span><span class="nx">require</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>Use standard JavaScript <code>eval</code> to eval code.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript.eval = </span><span class="nf">(code, options = {}) -></span> | ||
| <span class="nx">options</span><span class="p">.</span><span class="nx">bare</span> <span class="o">?=</span> <span class="kc">on</span> | ||
| <span class="nb">eval</span> <span class="nx">CoffeeScript</span><span class="p">.</span><span class="nx">compile</span> <span class="nx">code</span><span class="p">,</span> <span class="nx">options</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">¶</a> </div> <p>Running code does not provide access to this scope.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript.run = </span><span class="nf">(code, options = {}) -></span> | ||
| @@ -1,4 +1,4 @@ | ||
| -<!DOCTYPE html> <html> <head> <title>cake.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> <a class="source" href="scope.html"> scope.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> cake.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p><code>cake</code> is a simplified version of <a href="http://www.gnu.org/software/make/">Make</a> | ||
| +<!DOCTYPE html> <html> <head> <title>cake.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> cake.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p><code>cake</code> is a simplified version of <a href="http://www.gnu.org/software/make/">Make</a> | ||
| (<a href="http://rake.rubyforge.org/">Rake</a>, <a href="http://github.com/280north/jake">Jake</a>) | ||
| for CoffeeScript. You define tasks with names and descriptions in a Cakefile, | ||
| and can call them from the command line, or invoke them from other tasks.</p> | ||
Showing you all comments on commits in this comparison.
|
Hello friend thank you very much for creating "coffee script" syntax is the best I've used, I want to make an extention to generate "coffee script" to "PHP" using the source code of "Coffee Script" which library should I change?, please help me: ( |
|
This was already on master... f672e0c |
|
This, too: 66bbef4 |
|
This should reference #1829. |
|
Given that the prompt is configurable as an argument to the repl, having a hardcoded prompt results in weird alignment when the prompt changes. For example, it's totally reasonable for a user to want their prompt to just be '>'. Also, the node repl just uses '...' when in multiline mode. Why not be consistent with that and drop the '>'? |
|
@michaelficarra These changes aren't working for me:
I believe you're only eval-ing the first line. I saw you removed my hack for passing the multiline coffee-script through node's line listener back to our eval. Something like that (though not what I did) I think is necessary. I'd like to see a basic test or two in the suite for cases like this so we at least have a smoke test. |
|
Is this the prescribed coffee-script style - always omit parens when possible? I though I was pretty aggressive about omitting parens but definitely like to keep them when they improve readability. Looking at this line again, I'd probably go for
Is there an agreed upon parens style for the coffee-script project? |
Basically what you said -- try to be readable. |
|
Will do. How about this? initialPrompt: repl.prompt.replace(/^[^> ]*/, (x) -> x.replace /./g, '-')
prompt: repl.prompt.replace(/^[^> ]*>?/, (x) -> x.replace /./g, '.') |
|
Yeah, sorry about that. I was testing improperly and couldn't reproduce, so saw no need for it. I've re-added it, this time using a unicode-reserved character. It's still a hack, but less so. It will do until we can find something better. |
|
My personal rule for these cases is to add parentheses to the nested function call whenever it has more than one param and is inside a function call with more than one param (i.e. the nested call commas would end up at the same "level" of the enclosing call commas if no parentheses were added, making it hard to read): cb null, (vm.runInContext js, context, filename) |
|
@epidemian: Although you use parentheses in the non-@jashkenas-approved method that I prefer. That style is unfortunately explicitly disallowed in this repo. |
|
Ups, sorry, i forgot about that (i thought this was in Redux hehe). Well, my argument about the unreadability of the non parenthesized version still holds, so i think @asalant's version, |
|
Seems a little indulgent somehow - why the two states? Plain |
|
I guess this option was not meant to be used for this kind of thing |
|
@epidemian: Funny, I thought that was the only use for it. |
|
Bummer! I wanted to make a function that I could use to re-load requires. epidemian pointed this out for me and now it looks like it's going away. What do you guys think about loading a .crc (e.g. .irbrc) file instead? Maybe like |
|
I got what I needed with this:
This will be useful, until the -r option is gone from the main repo. Edit: actually, the "-r ~/utils.coffee" option isn't working. global.unload is there but it doesn't work. When I add the function to global after starting up the console, it will work fine. I don't want to mess around with getting it working since the -r will be going away soon. |
|
@jashkenas: This has broken Github compiled file detection (which, admittedly, can be fixed) and made the comment much less useful, as readers may not be aware that the file is compiled until reaching the bottom, which they may never do. I propose we revert this commit. |
|
... 2402f97 |
|
That's because you forgot to pull my revert before making your own, then your merge made it a no-op. |
|
Jeremy, what was the reasoning behind no longer exporting |
|
Oh, probably just thought we no longer needed it. Do you think it would be better to put it back in, or just have them keep their own list of reserved words? They're not likely to change much... |
|
I'm not sure, actually. Exporting it seems kind of weird for a compiler. It would be nice if they were programmatically accessible, though. I guess I would lean toward exporting them again. The question is now: how much of the internals do we want to expose for extensibility/integration purposes? |
|
I'd lean towards just the pieces that are generally useful (tokens, AST, compiling interface) and hard to reproduce. In this case, it's just copying and pasting an array that's not likely to change. Let's leave it out. |
But it still can change and requiring coffee-script and asking for required tokens is much cleaner than copy pasta programming. |