Emits ending-square-bracket in the wrong place
See original GitHub issuedecaffeinate is crashing on my CoffeeScript input:
SomeArr = [ ->
if something
lol =
count: 7
]
(repl) I get this error:
AddVariableDeclarationsStage failed to parse: Unexpected token (6:2)
4 | {count: 7};
5 | }
> 6 | ]
| ^
7 | };
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Period (Full Stop) Inside or Outside the Bracket?
Rule 2. If the brackets offer additional information that is not a complete sentence, then the period (full stop) is placed outside the...
Read more >In Bash: How to Emit Function Definitions for Function Names ...
The following code demonstrates that function names containing square brackets cannot be emitted, while other names with special characters ...
Read more >Completion for square brackets does not advance cursor ...
If there's already a ] on the REPL as a consequence of having typed [ earlier, typing ] inserts another closing bracket instead...
Read more >How to Use Brackets in Academic Writing: Some Common Rules
Use square brackets to include words within a quote that are not part of the original quote. For example, if a quoted passage...
Read more >Cannot escape square closing bracket in inlined code in ...
The actual link strips the square brackets (presumably because they're improperly encoded), this is livable but undesirable, I can url-encode ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, the fix was in the CoffeeScript lexer/parser. We recently set up a decaffeinate-specific fork of CoffeeScript (https://github.com/decaffeinate/coffeescript), and decaffeinate now depends on the decaffeinate-coffeescript package, so fortunately everything is now in place for us to make patches to CoffeeScript without having to wait for an official release. See https://github.com/decaffeinate/decaffeinate/issues/356 for more context.
Fixed with https://github.com/decaffeinate/coffeescript/pull/4.