Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CS2] Comments #4572

Merged
merged 103 commits into from
Aug 3, 2017
Merged
Show file tree
Hide file tree
Changes from 99 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
e7f7756
Make `addLocationDataFn` more DRY
GeoffreyBooth May 18, 2017
4f23ee4
Style fixes
GeoffreyBooth May 28, 2017
b9eae0f
Provide access to full parser inside our custom function running in p…
GeoffreyBooth May 28, 2017
87193af
Fix style.
GeoffreyBooth May 28, 2017
a95f228
Merge branch '2' into comments
GeoffreyBooth May 30, 2017
2f90a5a
Fix style.
GeoffreyBooth May 30, 2017
3078126
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jun 8, 2017
3ee5fe3
Label test comments
GeoffreyBooth Jun 8, 2017
17e5724
Update grammar to remove comment tokens; update DSL to call new helpe…
GeoffreyBooth Jun 14, 2017
feef8ca
New implementation of compiling block comments: the lexer pulls them …
GeoffreyBooth Jun 14, 2017
51bbf09
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jun 14, 2017
3e56925
If a comment follows a class declaration, move the comment inside the…
GeoffreyBooth Jun 21, 2017
8b735b6
Style
GeoffreyBooth Jun 21, 2017
0ac1135
Improve indentation of multiline comments
GeoffreyBooth Jun 22, 2017
8a6d24d
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jun 22, 2017
7df3ea5
Fix indentation for block comments, at least in the cases covered by …
GeoffreyBooth Jun 23, 2017
4d1fe1b
Don’t reverse the order of unshifted comments
GeoffreyBooth Jun 23, 2017
6c73b54
Simplify rewriter’s handling of comments, generalizing the special case
GeoffreyBooth Jun 23, 2017
7ce8514
Expand the list of tokens we need to avoid for passing comments throu…
GeoffreyBooth Jun 23, 2017
115bffc
Improve comments; fix multiline flag
GeoffreyBooth Jun 26, 2017
d8bc20d
Prepare HereComments for processing line comments
GeoffreyBooth Jun 28, 2017
d9334bb
Line comments, first draft: the tests pass, but the line comments are…
GeoffreyBooth Jun 28, 2017
1636c90
Updated compiler, now with line comments
GeoffreyBooth Jun 28, 2017
2d321c6
Update parser output
GeoffreyBooth Jun 28, 2017
9c5a55d
`process` doesn’t exist in the browser, so we should check for its ex…
GeoffreyBooth Jun 28, 2017
03ddfba
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jun 30, 2017
51c76ed
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jul 5, 2017
52b1b11
Test that proves #4290 is fixed
GeoffreyBooth Jul 5, 2017
b9b31be
Indent line comments, first pass
GeoffreyBooth Jul 5, 2017
8741074
Compiled output with indented line comments
GeoffreyBooth Jul 5, 2017
26065d0
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jul 6, 2017
d8a1dec
Comments that start a new line shouldn’t trail; don’t skip comments a…
GeoffreyBooth Jul 6, 2017
3db7ab7
Revised output
GeoffreyBooth Jul 6, 2017
b53a310
Cleanup
GeoffreyBooth Jul 7, 2017
e288de6
Split “multiline” line comment tokens, shifting them forward or back …
GeoffreyBooth Jul 7, 2017
1864956
Fix comments in module specifiers
GeoffreyBooth Jul 7, 2017
9ff5dd3
Abstract attaching comments to a node
GeoffreyBooth Jul 9, 2017
cfedcbc
Line comments in interpolated strings
GeoffreyBooth Jul 9, 2017
46c9191
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jul 9, 2017
75649ee
Line comments can’t be multiline anymore
GeoffreyBooth Jul 9, 2017
0230980
Improve handling of blank lines and indentation of following comments…
GeoffreyBooth Jul 9, 2017
f250e67
Make comments compilation more object-oriented
GeoffreyBooth Jul 10, 2017
23ecce4
Remove lots of dead code that we don’t need anymore because a comment…
GeoffreyBooth Jul 10, 2017
0c6364b
Improve eqJS helper
GeoffreyBooth Jul 10, 2017
08a6f60
Fix #4290 definitively, with improved output for arrays with interspe…
GeoffreyBooth Jul 10, 2017
40b6283
Add support for line comments output interspersed within arrays
GeoffreyBooth Jul 10, 2017
f0a88e8
Fix mistake, don’t lose the variable we’re working on
GeoffreyBooth Jul 11, 2017
d78016c
Remove redundant replacements
GeoffreyBooth Jul 11, 2017
e0fae48
Check for indentation only from the start of the string
GeoffreyBooth Jul 12, 2017
076d1f7
Indentations in generated JS are always multiples of two spaces (neve…
GeoffreyBooth Jul 13, 2017
255d9a8
Update package versions; run Babel twice, once for each preset, tempo…
GeoffreyBooth Jul 13, 2017
3c08f74
Don’t rely on `fragment.type`, which can break when the compiler is m…
GeoffreyBooth Jul 13, 2017
ed189b0
Updated generated docs and browser compiler
GeoffreyBooth Jul 13, 2017
414d339
Output block comments after function arguments
GeoffreyBooth Jul 14, 2017
7dbc279
Comments appear above scope `var` declarations; better tracking of ge…
GeoffreyBooth Jul 14, 2017
1f9a320
Create new FuncGlyph node, to hold comments we want to output near th…
GeoffreyBooth Jul 14, 2017
0b9d150
Block comments between `)` and `->`/`=>` get output between `)` and `{`.
GeoffreyBooth Jul 14, 2017
3cf5331
Fix indentation of comments that are the first line inside a bare mod…
GeoffreyBooth Jul 14, 2017
af6ba84
Updated output
GeoffreyBooth Jul 14, 2017
9371b4c
Full Flow example
GeoffreyBooth Jul 14, 2017
4f82240
Updated browser compiler
GeoffreyBooth Jul 14, 2017
a6361ca
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jul 16, 2017
201ba6f
Abstract and organize comment fragment generation code; store more pr…
GeoffreyBooth Jul 18, 2017
59f1517
Abstract token insertion code
GeoffreyBooth Jul 18, 2017
5bdef12
Add missing locationData to STRING_START token, giving it the locatio…
GeoffreyBooth Jul 19, 2017
8f3fd66
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jul 20, 2017
66a9899
Allow `SUPER` tokens to carry comments
GeoffreyBooth Jul 20, 2017
bdbca6d
Rescue comments from `Existence` nodes and `If` nodes’ conditions
GeoffreyBooth Jul 20, 2017
e4fce49
Rescue comments after `\` line continuation tokens
GeoffreyBooth Jul 20, 2017
dd74205
Updated compiled output
GeoffreyBooth Jul 20, 2017
3997211
Updated browser compiler
GeoffreyBooth Jul 20, 2017
a8a7f6d
Output block comments in the same `compileFragments` method as line c…
GeoffreyBooth Jul 23, 2017
1120649
Comments before splice
GeoffreyBooth Jul 23, 2017
624fedc
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jul 23, 2017
3d0a9a7
Updated browser compiler
GeoffreyBooth Jul 23, 2017
93b47ad
Track compiledComments as a property of Base, to ensure that it’s not…
GeoffreyBooth Jul 25, 2017
1feafce
Merge branch '2' of github.com:jashkenas/coffeescript into comments
GeoffreyBooth Jul 25, 2017
964de05
Docs: split up the Usage section
GeoffreyBooth Jul 25, 2017
055a588
Docs for type annotations via Flow; updated docs output
GeoffreyBooth Jul 25, 2017
52028a7
Update regular comments documentation
GeoffreyBooth Jul 25, 2017
0d0ce1f
Updated browser compiler
GeoffreyBooth Jul 25, 2017
caefcce
Comments before soak
GeoffreyBooth Jul 26, 2017
1c80f05
Comments before static methods, and probably before `@variable =` (th…
GeoffreyBooth Jul 27, 2017
4f97962
Comments before ‘if exists?’, refactor comment before ‘if this.var’ t…
GeoffreyBooth Jul 27, 2017
0f3c6ba
Comments before a method that contains ‘super()’ should output above …
GeoffreyBooth Jul 27, 2017
339257f
Fix missing comments before `if not` (i.e. before a UNARY token)
GeoffreyBooth Jul 27, 2017
050dbd4
Fix comments before ‘for’; add test for comment before assignment if …
GeoffreyBooth Jul 28, 2017
3f006b3
Comments within heregexes
GeoffreyBooth Jul 28, 2017
5028554
Updated browser compiler
GeoffreyBooth Jul 28, 2017
6f2dd79
Update description to reflect what’s now happening in compileCommentF…
GeoffreyBooth Jul 30, 2017
cd7db4a
Preserve blank lines between line comments; output “whitespace-only” …
GeoffreyBooth Jul 30, 2017
6cc56d8
Better future-proof comments tests
GeoffreyBooth Jul 30, 2017
3fafb43
Comments before object destructuring; abstract method for setting com…
GeoffreyBooth Jul 30, 2017
ce7421f
Handle more cases of comments before or after `for` loop declaration …
GeoffreyBooth Jul 30, 2017
ac6239d
Fix indentation of comments preceding `for` loops
GeoffreyBooth Jul 30, 2017
58c7846
Fix comment before splat function parameter
GeoffreyBooth Jul 30, 2017
3dd91a0
Catch another RegexWithInterpolations comment edge case
GeoffreyBooth Jul 30, 2017
33e3ad7
Updated browser compiler
GeoffreyBooth Jul 30, 2017
e116c85
Change heregex example to one that’s more readable; update output
GeoffreyBooth Jul 31, 2017
9b02439
Remove a few last references to the defunct HERECOMMENT token
GeoffreyBooth Aug 1, 2017
154dc32
Abstract location hash creation into a function
GeoffreyBooth Aug 1, 2017
458d134
Improved clarity per code review notes
GeoffreyBooth Aug 1, 2017
29ba5c0
Updated browser compiler
GeoffreyBooth Aug 1, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ CoffeeScript = require './lib/coffeescript'
helpers = require './lib/coffeescript/helpers'

# ANSI Terminal Colors.
bold = red = green = reset = ''
bold = red = green = yellow = reset = ''
unless process.env.NODE_DISABLE_COLORS
bold = '\x1B[0;1m'
red = '\x1B[0;31m'
green = '\x1B[0;32m'
reset = '\x1B[0m'
bold = '\x1B[0;1m'
red = '\x1B[0;31m'
green = '\x1B[0;32m'
yellow = '\x1B[0;33m'
reset = '\x1B[0m'

# Built file header.
header = """
Expand Down Expand Up @@ -145,7 +146,14 @@ task 'build:browser', 'merge the built scripts into a single file for use in a b
# Exclude the `modules` plugin in order to not break the `}(this));`
# at the end of the above code block.
presets.push ['env', {modules: no}] unless process.env.TRANSFORM is 'false'
presets.push 'babili' unless process.env.MINIFY is 'false'
babelOptions =
presets: presets
sourceType: 'script'
{ code } = babel.transform code, babelOptions unless presets.length is 0
# Running Babel twice due to https://github.com/babel/babili/issues/614.
# Once that issue is fixed, move the `babili` preset back up into the
# `presets` array and run Babel once with both presets together.
presets = if process.env.MINIFY is 'false' then [] else ['babili']
babelOptions =
compact: process.env.MINIFY isnt 'false'
presets: presets
Expand Down Expand Up @@ -377,11 +385,12 @@ runTests = (CoffeeScript) ->

# Convenience aliases.
global.CoffeeScript = CoffeeScript
global.Repl = require './lib/coffeescript/repl'
global.bold = bold
global.red = red
global.green = green
global.reset = reset
global.Repl = require './lib/coffeescript/repl'
global.bold = bold
global.red = red
global.green = green
global.yellow = yellow
global.reset = reset

# Our test helper function for delimiting different test cases.
global.test = (description, fn) ->
Expand Down
2 changes: 1 addition & 1 deletion docs/v2/browser-compiler/coffeescript.js

Large diffs are not rendered by default.

Loading