Closed
Description
There are two places where 'Illegal token' can be triggered in haskell-indentation:
- In
haskell-indentation-with-starter
: the case there seems to be when a lexical structure expect a closing token/keyword and the token is not present:
(defun haskell-indentation-with-starter (parser &optional end where-expr?)
...
(cond
...
(end (haskell-indentation-parse-error
"Illegal token: %s" current-token))))))
The expected token at this point is one of closing ')', ']', '}'. I do not see why we could not eat everything up to a closing token, maybe treating layout as taking priority.
- In
haskell-indentation-parse-to-indentations
: top level problem.
It seems to be a variation on the same, as top level list is a layout delimited list.
Solution seems to be:
- React to leading keywords only
if
,let
,import
,case
etc. - React to following keywords only in context of a leading keyword, so
then
andelse
only as part ofif
. - Allow partial statements, that is
if
that is not followed bythen
Metadata
Metadata
Assignees
Labels
No labels