-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
This label seems backward:
DeadEnd: Unmatched `]` detected
file: /tmp/scratch.rb
simplified:
1 def foo
❯ 2 foo = [ 1,1,1
3 end
The problem isn't an unmatched "]", the problem is an unmatched "[", to fix it a "]" is needed.
$ ruby -wc /tmp/scratch.rb
/tmp/scratch.rb:3: syntax error, unexpected `end', expecting ']'
I think we should change the label/banner to be
Unmatched `[` it appears `]` is missing
The cases I know off the top of my head for these single character chases are:
- Square brackets
[] - Curly brackets
{} - Parens
() - Pipe chars
||(but these are not directional)
My thought would be to make a hash map from one char to it's logical inverse and use that for the display. Also, all of this banner/label logic is bundled together in DisplayInvalidBlocks. It might be worth making the banner/label stuff it's own class and have it be consumed by DisplayInvalidBlocks instead.
Metadata
Metadata
Assignees
Labels
No labels