summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Interactive.hs
AgeCommit message (Collapse)Author
2025-08-02explicitly import join, when, (<=<) from Control.MonadInari Listenmaa
2022-10-04Only include transformers-compat for ghc < 8Andreas Källberg
Since that's the only place where it's needed and we don't have to fight with versions elsewhere
2022-10-04Restore build with ghc-7.10.3Andreas Källberg
2022-08-24workaround for the Nix madnessKrasimir Angelov
2021-07-07Replace tabs for whitespace in source codeJohn J. Camilleri
2021-07-06Add import from command line invocation to command historyJohn J. Camilleri
Closes #64
2020-09-18Fix bug where shell commands were ignored, introduced by #71John J. Camilleri
2020-09-09Import orphan instances of MonadFail for ghc<8Andreas Källberg
Also upgrade alex/happy so automatic install works
2019-09-20more dead codekrangelov
2019-09-20removed more dead codekrangelov
2015-10-28Fix bug in gf -server mode with /gfshell requests not updating the state of ↵hallgren
the shell The test for the quit command had the wrong polarity. The problem was reported by Fahime Ghasemi on gf-dev mailing list.
2015-08-18GF shell: restore the eh command to working order and document ithallgren
Also, when the command line parser fails, append the problematic command line to the error message "command not parsed".
2015-08-17GF shell: add the start options to GFEnv, turn "reload" into an ordinary commandhallgren
2015-08-13GF Shell: "ph | wf -file=foo.gfs" now works as advertisedhallgren
The print_history command was among the commands implemented in an ad-hoc way instead of being handled by the command line interpreter, which means it could not be used in a pipe, as in the example in the help info. The refactoring in the previous patch made this old bug easy to fix. Also fixed a bug in the "empty" command, introduced when moving the PGF from CommandEnv to GFEnv. TODO: fix the undocumented eh command. A comment in the help info for print_history, and some commented out old code, suggest that eh means "execute_history", but at present it does nothing...
2015-08-13GF Shell: refactoring for improved modularity and reusability:hallgren
+ Generalize the CommandInfo type by parameterizing it on the monad instead of just the environment. + Generalize the commands defined in GF.Command.{Commands,Commands2,CommonCommands,SourceCommands,HelpCommand} to work in any monad that supports the needed operations. + Liberate GF.Command.Interpreter from the IO monad. Also, move the current PGF from CommandEnv to GFEnv in GF.Interactive, making the command interpreter even more generic. + Use a state monad to maintain the state of the interpreter in GF.{Interactive,Interactive2}.
2015-08-12GF Shell: turn set_encoding into a common commandhallgren
Implemented in GF.Command.CommonCommands instead of GF.Interactive & GF.Interactive2.
2015-08-12GF shell: source commands (cc, sd, so, ss & dg) can now be used in pipeshallgren
These commands are now implemented as regular commands (i.e. using the CommandInfo data type) in the new module GF.Command.SourceCommands. The list of commands exported from GF.Command.Commmands now called pgfCommands instead of allCommands. The list allCommands of all commands is now assembled from sourceCommands, pgfCommands, commonCommands and helpCommand in GF.Interactive.
2015-08-12Move welcome message from GF.Interactive & GF.Interactive2 to ↵hallgren
GF.Command.Messages ...to avoid the duplication.
2015-08-11GF shell: make environment types abstract, comment out some dead codehallgren
2015-08-10Refactor GF shell modules to improve modularity and reusabilityhallgren
+ Move type CommandInfo from GF.Command.Commands to a new module GF.Commands.CommandInfo and make it independent of the PGF type. + Make the module GF.Command.Interpreter independent of the PGF type and eliminate the import of GF.Command.Commands. + Move the implementation of the "help" command to its own module GF.Command.Help
2015-02-27GF shell: fixed problems with previous change of the -retain flaghallgren
Because the prompt included the name of the abstract syntax, the loading of the PGF was forced even if -retain was used. Even worse, if an error occured while loading the PGF, it was repeated and caught every time the prompt was printed, creating an infite loop. The solution is to not print the name of the abstract syntax when the grammar is imported with -retain, which is the way things were before anyway.
2015-02-27GF shell: create a PGF also when the -retain flag is usedhallgren
The commands available in the shell after import -retain are now a superset of the commands available after import without -retain. The PGF is created lazily, so there should be no performance penalty if the PGF isn't needed. If there are errors, they won't be reported until a command that uses the PGF is entered.
2015-02-20added option -plus-as-bind which treats (+) as a bind when used with runtime ↵krasimir
variables
2015-02-20PGF Service: limit the number of parallel calls to the C run-time parse ↵hallgren
function to 4 by default The limit can be changed with the -j flag
2014-10-21ModuleName and Ident are now distinct typeshallgren
This makes the documentation clearer, and can potentially catch more programming mistakes.
2014-10-21Renaming SourceGrammar to Grammar and similarly for some related typeshallgren
Included renamings: SourceGrammar -> Grammar SourceModule -> Module SourceModInfo -> ModuleInfo emptySourceGrammar -> emptyGrammar Also introduces a type synonym (which might be good to turn into a newtype): type ModuleName = Ident The reason is to make types like the following more self documenting: type Module = (ModuleName,ModuleInfo) type QIdent = (ModuleName,Ident)
2014-10-20Remove some dead codehallgren
* The following modules are no longer used and have been removed completely: GF.Compile.Compute.ConcreteLazy GF.Compile.Compute.ConcreteStrict GF.Compile.Refresh * The STM monad has been commented out. It was only used in GF.Compile.SubExpOpt, where could be replaced with a plain State monad, since no error handling was needed. One of the functions was hardwired to the Err monad, but did in fact not use error handling, so it was turned into a pure function. * The function errVal has been renamed to fromErr (since it is analogous to fromMaybe). * Replaced 'fail' with 'raise' and 'return ()' with 'done' in a few places. * Some additional old code that was already commented out has been removed.
2014-10-16Some work on the haddock documentationhallgren
2014-10-16More haddock documentation improvementshallgren
2014-10-15Rename modules GFI, GFC & GFServer...hallgren
... to GF.Interactive, GF.Compiler & GF.Server, respectively.