From 39a31d07d5c70f490c04da0969716b4bd12bb6ae Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 1 Sep 2006 15:11:22 +0000 Subject: the Error type; better lexer error reporting --- doc/gf-history.html | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/gf-history.html b/doc/gf-history.html index f9eded9cb..aedb2a8aa 100644 --- a/doc/gf-history.html +++ b/doc/gf-history.html @@ -14,7 +14,46 @@ Changes in functionality since May 17, 2005, release of GF Version 2.2

-22/6 (AR) Release of GF version 2.6. +1/9 (AR) New way for managing errors in grammar compilation: +

+  Predef.Error : Type ;
+  Predef.error : Str -> Predef.Error ;
+
+Denotationally, Error is the empty type and thus a +subtype of any other types: it can be used anywhere. But the +error function is not canonical. Hence the compilation +is interrupted when (error s) is translated to GFC, and +the message s is emitted. An example use is given in +english/ParadigmsEng.gf: +
+  regDuplV : Str -> V ;
+  regDuplV fit = 
+    case last fit of {
+      ("a" | "e" | "i" | "o" | "u" | "y") => 
+        Predef.error (["final duplication makes no sense for"] ++ fit) ;
+      t =>
+       let fitt = fit + t in
+       mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing")
+      } ;
+
+This function thus cannot be applied to a stem ending with a vowel, +which is exactly what we want. In future, it may be good to add similar +checks to all morphological paradigms in the resource. + + +

+ +16/8 (AR) New generation algorithm: slower but works with less +memory. Default of gt; use gt -mem for the old +algorithm. The new option gt -all lazily generates all +trees until interrupted. It cannot be piped to other GF commands, +hence use gt -all -lin to print out linearized strings +rather than trees. + +


+ + +22/6 (AR) Release of GF version 2.6.

-- cgit v1.2.3