You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a little silly, but we could maybe recover from it I think.
> :paste
… :paste
…
purs: An internal error occurred during compilation: "handleCommand: unexpected command"
Please report this at https://github.com/purescript/purescript/issues
CallStack (from HasCallStack):
error, called at src/Language/PureScript/Crash.hs:24:3 in purescript-0.12.1-Cp6zGLfC9uqBgP73eCu6tr:Language.PureScript.Crash
internalError, called at src/Language/PureScript/Interactive.hs:115:49 in purescript-0.12.1-Cp6zGLfC9uqBgP73eCu6tr:Language.PureScript.Interactive
The text was updated successfully, but these errors were encountered:
This is perhaps a sign that we should just be using proper Parsec parsers throughout Language.PureScript.Interactive.Parser, rather than the current mixture of parsec parsers and String -> Either String a functions.
Actually I take that back, the way we're using Parsec doesn't seem to be related to this.
Having looked into it a little more I wonder if the issue is that we shouldn't be allowing any command inside :paste mode. I don't think
> :paste
… :k Int
…
Type
makes a lot of sense, for instance. Looking at the Command data type,
dataCommand--| A purescript expression=ExpressionP.Expr--| Show the help (ie, list of directives)
| ShowHelp--| Import a module from a loaded file
| ImportImportedModule--| Browse a module
| BrowseModuleP.ModuleName--| Exit PSCI
| QuitPSCi--| Reload all the imported modules of the REPL
| ReloadState--| Clear the state of the REPL
| ClearState--| Add some declarations to the current evaluation context
| Decls [P.Declaration]
--| Find the type of an expression
| TypeOfP.Expr--| Find the kind of an expression
| KindOfP.SourceType--| Shows information about the current state of the REPL
| ShowInfoReplQuery--| Paste multiple lines
| PasteLines--| Return auto-completion output as if pressing <tab>
| CompleteStrString--| Set the interactive printing function
| SetInteractivePrint (P.ModuleName, P.Ident)
derivingShow
I think the only constructors which make sense inside a :paste would be Expression, Decls, and Import. How about disallowing everything else inside :paste? We can probably give more helpful syntax errors that way, too.
It's a little silly, but we could maybe recover from it I think.
The text was updated successfully, but these errors were encountered: