<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gf-core.git/src/compiler/GF/Command/Interpreter.hs, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://git.adelon.net/gf-core.git/atom?h=master</id>
<link rel='self' href='https://git.adelon.net/gf-core.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/'/>
<updated>2020-09-12T09:04:32+00:00</updated>
<entry>
<title>Fix incorrect type and update dependencies</title>
<updated>2020-09-12T09:04:32+00:00</updated>
<author>
<name>Andreas Källberg</name>
<email>anka.213@gmail.com</email>
</author>
<published>2020-09-11T08:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=2fd1040724908943ef420480dd193e39bfc55f33'/>
<id>urn:sha1:2fd1040724908943ef420480dd193e39bfc55f33</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Import orphan instances of MonadFail for ghc&lt;8</title>
<updated>2020-09-09T09:05:41+00:00</updated>
<author>
<name>Andreas Källberg</name>
<email>anka.213@gmail.com</email>
</author>
<published>2020-09-09T09:05:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=9d8cd55cd5e492ed8996fe86cc1145989f1bf51b'/>
<id>urn:sha1:9d8cd55cd5e492ed8996fe86cc1145989f1bf51b</id>
<content type='text'>
Also upgrade alex/happy so automatic install works
</content>
</entry>
<entry>
<title>GF shell: fix a parsing problem with the cc command</title>
<updated>2016-04-07T13:40:05+00:00</updated>
<author>
<name>hallgren</name>
<email>hallgren@chalmers.se</email>
</author>
<published>2016-04-07T13:40:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=ab3cc776566847998fdca67714d40693f3f7b26c'/>
<id>urn:sha1:ab3cc776566847998fdca67714d40693f3f7b26c</id>
<content type='text'>
This patch fixes a problem introduced last year when the GF shell was
refactored to allow more commands to be treated uniformly and be part
of pipes. The cc command was one of those commands, but unfortunately this
introduced a parsing problem, e.g.

	&gt; cc "last"
	constant not found: last

	&gt; cc "last"++"year"
	command not parsed: cc "last"++"year"

This happened because the generic command line parser in
GF.Command.{Abstract,Parse} assumes that all commands have an argument of
type PGF.Expr. Commands that expect other types of arguments have to
use PGF.showExpr combined with other conversion to the argument type they
expect. The cc command excpets a GF.Grammar.Term, and unfortunately not 
all terms survice the roundtrip through PGF.Expr, in part because of
an additional hack to allow strings to be roundtripped through PGF.Expr
without adding superfluous double quotes.

To solve the problem, this patch

 + makes room for arguments of type Term in the Argument type in
   GF.Command.Abstract.
   
 + makes a special case for the cc command in GF.Command.Parse, by
   calling the partial parser 'runPartial pTerm' recently added in
   GF.Grammar.Lexer and GF.Grammar.Parser. Care was taken so that
   that "|" and ";" can be used both inside terms and as separators between
   commands in the shell, e.g. things like the following now work:

       &gt; cc ("a"|"b") | ps -lexcode
       variants { "a" ; "b" }

 + introduces a type CommandArgument that replaces [Expr] as the
   type of values passed between commands in pipes. It has room for
   values of type [Expr], [String] and Term, thus eliminating the need
   to roundtrip through the Expr type all the time.
   The hack to avoid adding superfluous quotes when strings are
   roundtripped through Expr has been left in place for now,
   but can probably be removed.
   
</content>
</entry>
<entry>
<title>Comment out some dead code found with -fwarn-unused-binds</title>
<updated>2015-08-28T13:59:43+00:00</updated>
<author>
<name>hallgren</name>
<email>hallgren@chalmers.se</email>
</author>
<published>2015-08-28T13:59:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=5bfaf10de597af504e6d2784309e533b09a6451c'/>
<id>urn:sha1:5bfaf10de597af504e6d2784309e533b09a6451c</id>
<content type='text'>
Also fixed some warnings and tightened some imports
</content>
</entry>
<entry>
<title>GF shell: restore the eh command to working order and document it</title>
<updated>2015-08-18T13:13:31+00:00</updated>
<author>
<name>hallgren</name>
<email>hallgren@chalmers.se</email>
</author>
<published>2015-08-18T13:13:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=41075fb50a846ef0ae9851b99a3468bc0e405988'/>
<id>urn:sha1:41075fb50a846ef0ae9851b99a3468bc0e405988</id>
<content type='text'>
Also, when the command line parser fails, append the problematic command line
to the error message "command not parsed".
</content>
</entry>
<entry>
<title>GF Shell: refactoring for improved modularity and reusability:</title>
<updated>2015-08-13T10:49:50+00:00</updated>
<author>
<name>hallgren</name>
<email>hallgren@chalmers.se</email>
</author>
<published>2015-08-13T10:49:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=87e64a804cbe5848d20f0555dedae42e1516cbbc'/>
<id>urn:sha1:87e64a804cbe5848d20f0555dedae42e1516cbbc</id>
<content type='text'>
+ 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}.
</content>
</entry>
<entry>
<title>Refactor GF shell modules to improve modularity and reusability</title>
<updated>2015-08-10T13:01:02+00:00</updated>
<author>
<name>hallgren</name>
<email>hallgren@chalmers.se</email>
</author>
<published>2015-08-10T13:01:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=d38efbaa6a2c94218bb65925bd9ad6c028dfbfd6'/>
<id>urn:sha1:d38efbaa6a2c94218bb65925bd9ad6c028dfbfd6</id>
<content type='text'>
+ 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

</content>
</entry>
<entry>
<title>Convert from Text.PrettyPrint to GF.Text.Pretty</title>
<updated>2014-07-28T11:58:00+00:00</updated>
<author>
<name>hallgren</name>
<email>hallgren@chalmers.se</email>
</author>
<published>2014-07-28T11:58:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=7a91afc02a0a245bf9fea248e61421a75c22137d'/>
<id>urn:sha1:7a91afc02a0a245bf9fea248e61421a75c22137d</id>
<content type='text'>
All compiler modules now use GF.Text.Pretty instead of Text.PrettyPrint
</content>
</entry>
<entry>
<title>PGF library: expose only PGF and PGF.Internal instead of all modules</title>
<updated>2014-06-12T14:43:18+00:00</updated>
<author>
<name>hallgren</name>
<email>hallgren@chalmers.se</email>
</author>
<published>2014-06-12T14:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=d6252d1c16d59ad26db0d08a531cddf39864d9db'/>
<id>urn:sha1:d6252d1c16d59ad26db0d08a531cddf39864d9db</id>
<content type='text'>
PGF exports the public, stable API.
PGF.Internal exports additional things needed in the GF compiler &amp; shell,
including the nonstardard version of Data.Binary.
</content>
</entry>
<entry>
<title>Eliminate mutual dependencies between the GF compiler and the PGF library</title>
<updated>2013-11-05T13:11:10+00:00</updated>
<author>
<name>hallgren</name>
<email>hallgren@chalmers.se</email>
</author>
<published>2013-11-05T13:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.adelon.net/gf-core.git/commit/?id=3814841d7d3b77b3f033cb98c1c0a04ac39435d7'/>
<id>urn:sha1:3814841d7d3b77b3f033cb98c1c0a04ac39435d7</id>
<content type='text'>
+ References to modules under src/compiler have been eliminated from the PGF
  library (under src/runtime/haskell). Only two functions had to be moved (from
  GF.Data.Utilities to PGF.Utilities) to make this possible, other apparent
  dependencies turned out to be vacuous.

+ In gf.cabal, the GF executable no longer directly depends on the PGF library
  source directory, but only on the exposed library modules. This means that
  there is less duplication in gf.cabal and that the 30 modules in the
  PGF library will no longer be compiled twice while building GF.

  To make this possible, additional PGF library modules have been exposed, even
  though they should probably be considered for internal use only. They could
  be collected in a PGF.Internal module, or marked as "unstable", to make
  this explicit.

+ Also, by using the -fwarn-unused-imports flag, ~220 redundant imports were
  found and removed, reducing the total number of imports by ~15%.

</content>
</entry>
</feed>
