summaryrefslogtreecommitdiff
path: root/src/compiler
AgeCommit message (Collapse)Author
2013-09-20Comment out identifier refreshing code only used by the removed refresh passhallgren
2013-09-19Introduce type RawIdent; only 9 imports of Data.ByteString.Char8 remainhallgren
The fact that identifiers are represented as ByteStrings is now an internal implentation detail in module GF.Infra.Ident. Conversion between ByteString and identifiers is only needed in the lexer and the Binary instances.
2013-09-19Make Ident abstract; imports of Data.ByteString.Char8 down from 29 to 16 moduleshallgren
Most of the explicit uses of ByteStrings were eliminated by using identS, identS = identC . BS.pack which was found in GF.Grammar.CF and moved to GF.Infra.Ident. The function prefixIdent :: String -> Ident -> Ident allowed one additional import of ByteString to be eliminated. The functions isArgIdent :: Ident -> Bool getArgIndex :: Ident -> Maybe Int were needed to eliminate explicit pattern matching on Ident from two modules.
2013-09-10Some code verbosity reductionhallgren
2013-09-10Workaround for a problem with lock fieldshallgren
This problem showed up after delaing eta expansion until just before partial evaluation
2013-05-30new-comp: delay eta expansion until just before partial evaluationhallgren
This seems to work for the most part, but a problem showed up in WordsCat.gf in the phrasebook.
2013-09-09Nonlinear patterns in concrete syntax are now detected and reported as errorshallgren
Before, they were silently converted to linear patterns. Nonlinear patterns in MorphoCat.gf, ParadigmsGre.gf and ParadigmsFin.gf have been make linear by renaming pattern variables.
2013-09-09partial evaluator: prettier complaint about nonlinears patternshallgren
2013-09-09partial evaluator: complain about nonlinear patternshallgren
2013-09-09Fix an old name shadowing bug in concrete syntax by removing the refresh passhallgren
The refresh pass does not correctly keep track of the scope of local variables and can convert things like \x->(\x->x) x into \x1->(\x2->x2) x2. Fortunately, it appears that the refresh pass is not needed anymore, so it has been removed.
2013-09-05Fix an old bug that prevented pattern matching agains values containg tableshallgren
The function GF.Grammar.PatternMatch.isInConstantForm returned False for all tables, causing matchPattern to fail, claiming that "variables occur in" the term if it contains tables. This problem is several years old, confirmed present in GF 3.2.10 (Oct 2010).
2013-09-03fix in the GF compiler and runtime which let us to define pre construct ↵kr.angelov
detecting whether this is the last token.
2013-08-23nonExist now does the expected thingkr.angelov
2013-08-20gf -server: fix for directory URLs without a trailing slashhallgren
When a browser requests a URL that refers to a directory, web server usually redirect the browser to the same URL with a trailing '/' added, if one was not already present. This is to prevent relative links in the returned document from being interpreted relative to the parent directory instead of the current document. This type of redirection was missing in gf -server.
2013-08-07Better error messages for attempts to redefine predefined constantshallgren
Instead of just "syntax error", you now get e.g. PType is a predefined constant, it can not be redefined This is a simple change in the parser.
2013-07-29Cloud & PGF service: use Content-Type application/json for JSON outputhallgren
This is in accordance with RFC 4627. http://tools.ietf.org/html/rfc4627 Use application/javascript for JSONP output.
2013-07-25Allow cross origin requests to GF cloud & PGF serviceshallgren
By adding a header Access-Control-Allow-Origin: * to the HTTP responses, web browsers are informed that it is OK to call the services from web pages hosted on other sites. This is apparently supported in most modern browsers, so it should no longer be necessary to resort to JSONP. See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
2013-07-24hs datatype generation for empty abstract types addedaarne
2013-06-15Improvements In Sindhi RGvirk.shafqat
2013-06-13Fix UTF-8 decoding problem in gf -serverhallgren
The package network-2.4.1.1 thoughlessly introduced a backward incompatible change to the function Network.URI.unEscapeString, see https://github.com/haskell/network/commit/f2168b1f8978b4ad9c504e545755f0795ac869ce This also affects the function Network.Shed.Httpd.queryToArguments, which is used in GFServer.hs. To remain compatible with older and newer versions of the network package, we need to stay clear of queryToArguments and unEscapeString. A replacement function has been added to server/URLEncoding.hs.
2013-06-10Update the usage text for the --output-format optionhallgren
It needs to be updated manually when the list of available output format changes.
2013-06-02GF.Text.Transliterations: avoid error prone function Data.Map.fromAscListhallgren
2013-05-31Prasad's sanskrit transliteration ; MiniresourceSan now compiles but is ↵aarne
mostly incorrect due to missing paradigms
2013-04-22a bit more informative error message in GrammarToPGFkr.angelov
2013-04-19the option -old for the vp command is now redundantkr.angelov
2013-04-19remove the dead code left behind by Peter Ljunglöf in VisualizeTreekr.angelov
2013-04-19fix the command options for the vd command in the shellkr.angelov
2013-04-10gf -s/-q now silences "no linearization of" warningshallgren
2013-04-08PGF.hs: export function missingLinshallgren
Also in Commands.hs: be explicit about things imported from the PGF library that are not in the public API. Also a couple of haddock documentation fixes.
2013-04-05Compiler.hs: ghc 7.6.2 compatibilityhallgren
2013-04-03Prevent Unicode characters in warning messages from stopping grammar compilationhallgren
When compiling a grammar containing characters that are not supported in the current locale, warning messages could cause GF fail with hPutChar: invalid argument (Invalid or incomplete multibyte or wide character) With this quick fix, warning messages that can not be displayed are silently truncated instead, and compilation continues.
2013-03-29option pt -funs to show all fun's in a treeaarne
2013-03-16Fix a problem with pattern macros in pre { } expressionshallgren
The old partial evaluator has special rules to convert pattern macros in pre { } expressions. These rules were missing in the new partial evaluator.
2013-03-13pt -nub to remove duplicate trees from a list returned e.g. by a parseraarne
2013-03-12partial evaluator: push predefined functions inside variantshallgren
This should prevent errors like Internal error in Compute.ConcreteNew: Applying Predef.drop: Expected a value of type String, got VFV [VString "gewandt",VString "gewendet"]
2013-03-12command pt -subtrees that analyses a tree into the set of subtrees. Using pt ↵aarne
-subtrees <bigtree> | l -treebank for debugging the lin of a big tree
2013-03-11Additional changes for GHC 7.4 & 7.6 compatibilityhallgren
2013-03-09ghc-7.6: allow directory-1.2Sergei Trofimovich
Get rid of old-time depend (and ClockTime in favour of UTCTime). time-compat helps to retain backward compatibility with directory-1.1 and lower.
2013-02-28Fix a bug that could cause "Prelude.head: empty list"hallgren
In Data.Operations, the function topoTest2 assumed too much about the form of the input, compared to the older function topoTest.
2013-02-28pattern match length estimation code simplicationhallgren
2013-02-27Faster regular expression pattern matching in the grammar compiler.hallgren
The sequence operator (x+y) was implemented by splitting the string to be matched at all positions and trying to match the parts against the two subpatterns. To reduce the number of splits, we now estimate the minimum and maximum length of the string that the subpatterns could match. For common cases, where one of the subpatterns is a string of known length, like in (x+"y") or (x + ("a"|"o"|"u"|"e")+"y"), only one split will be tried.
2013-02-27GF grammar pretty printer improvementshallgren
Allow line breaks in more places to make large terms more readable.
2013-02-12now the beam size for the statistical parser can be configured by using the ↵kr.angelov
flag beam_size in the top-level concrete module
2013-02-03pg -lexc now writes a list of multichar symbols and a title ("Root") for the ↵aarne
lexicon, as required by Xerox lexc
2013-01-29Better error message for unsupported token gluinghallgren
Instead of "Internal error in ...", you now get a proper error message with a source location and a function name.
2013-01-29Fix a bug with record extensionhallgren
Add a conversion rule for ({ l1 = e } ** x).l2 in PMCFG generation. (A rule for the symmetric case (x ** { l1 = e }).l2 was added some time ago.)
2013-01-28Quick fix to render some parser error messages from UTF-8-encoded source ↵hallgren
files correctly. The parser works on raw byte sequences read from source files. If parsing succeeds the raw byte sequences are converted to proper Unicode characters in a later phase. But the parser calls the function buildAnyTree, which can fail and generate error messages containing source code fragments, which might then containing raw byte sequences. To render these error messages correctly, they need to be converted in accordance with the coding flag in the source file. This is now done for UTF-8-encoded source files, but should ideally also be done for other character encodings. (Latin-1-encoded files never suffered from this problem, since raw bytes are proper Unicode characters in this case.)
2013-01-28Better error message for Predef.errorhallgren
+ Instead of "Internal error in ...", you now get a proper error message with a source location and a function name. + Also added some missing error value propagation in the partial evaluator. + Also some other minor cleanup and error handling fixes.
2013-01-28improved error message for overloading in case the given signature looks the ↵aarne
same as one of the expected ones: it shows full records rather than just lock fields.
2013-01-13gf -server: fix bug in bug fix for current directoryhallgren