2976 Commits

Author SHA1 Message Date
Julian Rosse
71750554c3 Allow computed class properties (#5206)
* fix broken JS output

* static computed properties
2019-04-28 15:45:57 -07:00
Julian Rosse
0574b664e8 Fix #5201: allow leading breaking elision (#5202)
* allow simple breaking elision

* add tests

* use OptComma

* more tests

* trigger CI
2019-04-22 10:21:37 -07:00
Julian Rosse
ca0ac814b3 parse array ending in empty function (#5200) 2019-04-18 15:36:04 -07:00
Julian Rosse
c0b3217766 Class AST: static methods/properties (#5199)
@GeoffreyBooth PR for class static methods/static properties

Remaining parts of class ASTs include bound/computed methods/properties and executable class bodies
2019-04-15 10:06:00 -07:00
Julian Rosse
12a5271489 object property at LEVEL_LIST (#5197) 2019-04-09 23:19:04 -07:00
Geoffrey Booth
92f69b2bca Release 2.4.1 (#5195)
* Fix #5133: Document that braces are required for object shorthand.

* Changelog for 2.4.1

* Update output
2019-04-07 20:41:37 -07:00
Geoffrey Booth
742224471f Actually publish the browser compilers to NPM (#5186)
* Actually publish the browser compilers to NPM

* Transpile and minify modern browser compiler; add to lib/ folder; update docs
2019-04-07 16:09:44 -07:00
Julian Rosse
086430840e basic class ast (#5194) 2019-04-05 21:31:25 -07:00
Julian Rosse
82f92fea97 allow indented property index (#5193) 2019-04-04 08:33:51 -07:00
Julian Rosse
ada35d8951 handle jsx element as expression (#5190) 2019-04-01 09:12:52 -07:00
Julian Rosse
7e0eb6a92d JSX empty expression location data (#5189) 2019-03-31 15:04:08 -07:00
Julian Rosse
28a1a1d304 AST: "CSX" -> "JSX" (#5188)
* updated grammar

* restore JSXIdentifier::astType()
2019-03-31 12:13:05 -07:00
Julian Rosse
0c2d3673d3 ast for jsx content (#5187) 2019-03-31 10:24:58 -07:00
Geoffrey Booth
c09d8fbedb Release 2.4.0 (#5182)
* cake doc:site:watch should also watch the changelog files

* Changelog for 2.4.0

* 2.4.0 output
2019-03-30 11:31:22 -07:00
Julian Rosse
730a4bcdad Tagged template literal AST (#5185)
* tagged template literal ast

* add comment
2019-03-30 11:31:00 -07:00
Julian Rosse
7466c81414 Index at LEVEL_PAREN (#5184) 2019-03-29 12:05:42 -07:00
Julian Rosse
b79ea321a3 regex ast (#5183) 2019-03-29 12:05:03 -07:00
Julian Rosse
ae2f72e15d Heregex AST (#5181)
* heregex ast

* fix from code review
2019-03-28 23:15:09 -07:00
Geoffrey Booth
f6d63776c3 ES module version of compiler for use in browsers; dynamic import() docs; revised Stage 3 policy (#5177)
* Build both a legacy and modern browser compiler

* Dynamic import example and documentation

* Update the docs to use the modern browser compiler if the browser supports it

* Update policy regarding Stage 3 features

* This never made sense, and assigning a string to index 0 *of a string* throws in Module mode (and silently does nothing in Script mode) so remove this unneeded code that throws when compiling `fn for i from from iterable` in Module mode

* Have browser-based tests use the ES module version if supported

* Simplify building logic

* Update output

* For the ES module version of the browser compiler, don't automatically attach the runScripts event handler

* Consistent comments

* Fix comment
2019-03-26 23:55:31 -07:00
Julian Rosse
b982b7cd0e dynamic import AST (#5180) 2019-03-26 08:20:12 -07:00
Geoffrey Booth
0b5bac666f Merge branch 'master' into ast
# Conflicts:
#	lib/coffeescript/grammar.js
#	lib/coffeescript/nodes.js
#	lib/coffeescript/parser.js
#	package-lock.json
#	src/nodes.coffee
#	test/error_messages.coffee
2019-03-24 19:22:33 -07:00
Ruben Bridgewater
41b31c7293 Fix repl.rli deprecation (#5178)
The `rli` property is just a reference to itself. It still exists
for legacy reasons but it will likely be removed in a future major
version. This makes sure everything works as expected.
2019-03-24 19:12:32 -07:00
Julian Rosse
eaeb77a527 String interpolation AST (#5175)
* updated grammar

* empty chunks

* remove unused

* remove unused

* add comment
2019-03-24 19:00:44 -07:00
Geoffrey Booth
ec034e2673 Fix tests (#5176)
* Fix cake test:integrations per newer Webpack

* Update dependencies

* Update dependencies
2019-03-23 23:28:13 -07:00
Julian Rosse
ff24e5ce52 Dynamic import (#5169)
* dynamic import

* updated grammar

* specify callable

* DynamicImportCall

* Fix from code review

Co-Authored-By: helixbass <julian@helixbass.net>

* recompile
2019-03-20 13:08:10 -07:00
Julian Rosse
4549f9a4c5 AST: Preserve infinity literal (#5172)
* updated grammar

* tests
2019-03-17 22:28:51 -07:00
Julian Rosse
d0be6391c6 For AST (#5173)
* updated grammar

* adding tests

* location data tests
2019-03-17 22:27:21 -07:00
Julian Rosse
f70f4f09b7 conditional else as simple expression (#5171) 2019-03-17 00:01:46 -07:00
Julian Rosse
3f5abb3c60 MetaProperty AST (new.target) (#5170)
* updated grammar

* updated grammar

* passing tests

* test errors ast
2019-03-16 18:51:39 -07:00
Julian Rosse
ca275c2a1c Fix #5128: parens around default param (#5167)
* compile params at LEVEL_PAREN

* test
2019-03-14 18:14:35 -07:00
Julian Rosse
99b7826f1b While AST (#5161)
* updated grammar

* tests

* add tests
2019-02-25 10:03:18 -08:00
Julian Rosse
806a442894 If AST (#5160)
* updated grammar

* updated grammar

* tests

* location data tests

* fix from code review
2019-02-14 19:51:33 -08:00
Alex
63ffe0aead Fix 5085 (#5145)
* Add test for #5085

    $ cake test
    failed 1 and passed 1274 tests in 4.81 seconds

      #5085: Bug: @ reference to class not maintained in do block
      AssertionError [ERR_ASSERTION]: Expected undefined to equal 2

* Fix #5085: @ reference to class in "do" block

Assuming that a bound Code node inside an ExecutableClassBody without a
name must be a "do" block.

* Additional tests

https://github.com/jashkenas/coffeescript/pull/5145#issuecomment-462127244

Also switched to concat'g strings for test values, as opposed to
incrementing numbers: makes the tests a bit easier to read.
2019-02-11 07:28:04 -08:00
Julian Rosse
74e0798f89 Return AST (#5157)
* updated grammar

* FuncDirectiveReturn class

* error tests
2019-02-10 08:48:48 -08:00
Julian Rosse
6a8e6a4078 AST: Track exclusive end line/column (#5156)
* updated grammar (with patched Jison)

* passing tests

* updated grammar

* updated grammar

* updated grammar

* updated grammar

* cleanup

* refactor
2019-02-07 21:55:11 -08:00
Julian Rosse
42402da526 Code AST (#5155)
* adding tests

* updated grammar

* tests

* fixes from code review
2019-02-07 11:13:46 -08:00
Julian Rosse
42622b15a9 Switch AST (#5154)
* updated grammar

* ast

* fix merge

* tests

* location data tests

* fix from code review

* SwitchCase

* fix from code review
2019-02-02 13:28:06 -08:00
Julian Rosse
1879af6585 fixes (#5152)
Thank you for fixing this! This all looks great.
2019-01-22 11:32:51 -08:00
Julian Rosse
a7b1fa51e7 Try AST (#5140)
* root ast

* updated grammar

* preserve CoffeeScript.nodes() API

* root ast methods

* try ast

* updated grammar

* updated grammar

* updated grammar

* updated grammar

* finally location data

* remove unused

* updates from code review
2019-01-18 11:57:04 -08:00
Julian Rosse
38c8b2f35f Root AST (#5137)
* root ast

* updated grammar

* preserve CoffeeScript.nodes() API

* root ast methods

* updates from code review

* Style

* Fix a few missing returns

* Expand sourceType explanation

* Simplify

* Refactor Block.astProperties: use expression.astLocationData() to get location data, rather than extracting it from the whole AST object; move all the logic into one function, rather than spreading it out across several functions on the Block class that all appear to be internal

* testing root location data

* Fix location end data for root/File » Program AST node
2019-01-16 13:10:08 -08:00
Julian Rosse
4392d26985 JSX fragment/attribute AST (#5138)
* fragment ast

* attributes ast

* working on attribute classes

* passing tests
2018-11-30 11:30:50 -08:00
Adrian
2f82b75862 implement coffeescript.registerCompiled method (#5130)
* implement coffeescript._addSoucrse method

This method enables an external module to implement caching of
compilation results. When the compiled js source is loaded from cache,
the original coffee code should be added with this method in order to
enable the Error.prepareStackTrace below to correctly adjust the stack
trace for the corresponding file (the source map will be generated on
demand).

* replace _addSource with registerCompiled

* extract the logic from _compileFile into _compileRawFileContent

_compileFile takes care of logging the file and calls _compileRawFileContent

this way an external caching implementation which computes cache key
based on raw content of the sources file, can reuse the logic of
_compileFile and avoid having calling `fs.readFileSync` for the file
more twice in case of cache miss

* remove 'output' argument from registerCompiled
2018-11-28 09:09:06 -08:00
Julian Rosse
459814f58d JSX element AST (#5136)
* existence/throw/expansion ast

* updated grammar

* passing tests

* passing ast tests

* location data tests

* updates from code review

* add comment comments

* CSXElement

* jisonLocationDataToAstLocationData

* remove comment

* Style tweaks
2018-11-27 21:46:09 -08:00
Julian Rosse
088659f893 Existence/Throw/Expansion AST (#5135)
* existence/throw/expansion ast

* Style
2018-11-17 18:02:48 -08:00
Julian Rosse
0e37130f2e Assign AST (#5126)
* updated grammar

* tests

* ObjectProperty

* LHS shorthand with default needs @value

* remove unused Assign @shorthand

* assign ast

* test operator

* Format comment
2018-10-30 15:46:11 -07:00
Julian Rosse
fb539579c3 Object AST (#5124)
* updated grammar

* tests

* ObjectProperty

* LHS shorthand with default needs @value

* remove unused Assign @shorthand

* Format comments, cleanup style
2018-10-29 23:29:28 -07:00
Julian Rosse
7c54532010 Import/export AST (#5123)
* updated grammar

* tests

* Try to be a little clearer that we're assembling objects that we're returning

* explanatory comment
2018-10-22 09:53:11 -07:00
Julian Rosse
5d57ea785c array ast (#5120) 2018-10-15 21:17:45 -07:00
Julian Rosse
94e29c9a95 Range/Slice AST (#5119)
* op ast

* test expected errors

* use new ast methods

* remove unused abstraction

* logical ?

* fix rebase

* follow convention

* fixes from code review

* test helper naming

* always convert new to Call

* new cases

* don't mutate locationData

* updated grammar

* tests

* Rebuild

* always expose generated

* todo for OptionalMemberExpression

* range/slice ast

* Style tweaks
2018-10-15 10:00:14 -07:00
Julian Rosse
fe7377aed5 Call AST (#5117)
* op ast

* test expected errors

* use new ast methods

* remove unused abstraction

* logical ?

* fix rebase

* follow convention

* fixes from code review

* test helper naming

* always convert new to Call

* new cases

* don't mutate locationData

* updated grammar

* tests

* Rebuild

* always expose generated

* todo for OptionalMemberExpression
2018-10-14 19:07:12 -07:00