question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Emits ending-square-bracket in the wrong place

See original GitHub issue

decaffeinate 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:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alangpiercecommented, Aug 10, 2016

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.

0reactions
alangpiercecommented, Aug 14, 2016
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found