Instead of showing the name of a function in the abstract syntax, linearize it
and show the result. For functions with argument, e.g. That : Kind -> Item,
the function is applied to the right number of placeholder arguments: 'That ?'.
If the linearization fails, the name of the function is shown anyway.
The grammar extension is now done with a regular HTML form, so you can use the
TAB key to move between the fields and press ENTER to submit the extension when
you are done.
TODO: more immediate error feedback
The Haskell Platform page for Mac states that Xcode 3.2 or later is ok, but
there seems to be a problem with Xcode 3.2.2.
Also added some other small clarifications.
The current intput is now represented as an array of words instead of as a
string.
(This is the kind of change is scary to do in a dynamically type language
like JavaScript. In a statically typed language like Haskell you can do it
with confidence, since you know the compiler can help you catch all mistakes...)
If you leave the minibar and later return, the previous input will be
restored. One input string per grammar is rememebered, so you can also switch
back and forth between grammars without losing the input.
This is implemented using localStorage, i.e. the data is stored locally on
the user's device.
Instead of trying to reconstruct the abstract tree from the bracketed string,
use the node numbers (the field called "fid") to identify which node in the
abstact syntax tree a word in the bracketed string corresponds to.
Abstract syntax trees are represented as strings in the web API. To make them
easier to manipulate in JavaScript, the new function converts them to JSON.
To support structural editing, the nodes are numbered in the same way as in
the bracketed string created when linearizing an abstract syntax tree.
Example: "Pred (That Fish) Fresh" is converted to
{fun:"Pred",fid:3,
children:[{fun:"That",fid:1,
children:[{fun:"Fish",fid:0}]},
{fun:"Fresh",fid:2}]}
Removing "ghc-options: -O2" from gf.cabal has the following advantages:
+ Compiling GF is faster (time drops from 182s to 142s on my laptop)
+ Compiling the RGL is faster (time drops from 159s to 155s on my laptop)
+ Without the hardwired optimization level, the 'cabal configure' options
--enable-optimization=<n> and --disable-optimization work as expected
(so if you still want -O2, use --enable-optimization=2)
+ GF can be compiled with ghc-7.2.2 and ghc-7.4.1 (-O2 triggers a bug in
these versions of ghc, it seems. Another workaround, discovered by
Sergei Trofimovich, is to use -O0 in Data.Binary.)
An apparent bug in ghc-7.2.2 causes the type Value to be exported from PGF.Data.
Workaround: restrict the imports from PGF.Data in GF.Command.Abstract and
GF.Compile.GeneratePMCFG to avoid the clash with locally defined type Value.
(ghc-7.0.4 and ghc-7.4.1 appear to be free from this bug.)
Fixes the following error:
src/runtime/haskell/PGF/Expr.hs:111:14:
Ambiguous occurrence `foldl'
It could refer to either `List.foldl',
imported from `Data.List' at src/runtime/haskell/PGF/Expr.hs:27:1-24
(and originally defined in `GHC.List')
or `Map.foldl',
imported from `Data.Map' at src/runtime/haskell/PGF/Expr.hs:28:1-40
You can also add grammars from several directories on the same server of course.
The included minibar configuration file adds the user's own grammars from the
grammar editor.
+ Function div_id was defined in both editor.js and support.js. Solution:
moved the more general version from editor.js to support.js.
+ Function div_class was defined in both editor.js and support.js. Solution:
resolv incompatibility with an argument type test and put the generalized
function in support.js.
Also brought index.txt and index.html back in sync. (It looks like someone
updated index.html instead of updating index.txt and regenerating index.html.)
Check that the reconstructed abstract syntax tree is type correct before
enabling word-for-word replacement. Show an error message if word replacement
nevertheless fails.
To enable customized error handling, the methods in the pgf_online objects and
the AJAX server call functions in support.js accept an error callback function
as an extra argument, in addition to the callback (continuation) for normal
results.