-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently the function pattern matches up function and end keywords by looking for an end that is indented to the same level as the opening function.
This is brittle as all get-out—it will, for example, break if one half of the pair is indented with tabs and the other with spaces—and, ideally, should be changed.
In theory, since the number of fish language constructs which are terminated by end is fairly small, it should be possible to define a subpattern which explicitly captures those constructs inside function_body, thereby preventing them from being matched as candidates for function_terminator.
However, there are two problems:
- It's unclear how to handle nested blocks, e.g.:
function foobar for i in $argv if test $argv[i] = "top sekrit" echo "ssssssh!" end end end
- This is getting perilously close to parsing HTML with regex, and nobody wants eldritch abominations in their syntax highlighting.
Metadata
Metadata
Assignees
Labels
No labels