summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authorbringert <unknown>2005-01-28 15:57:59 +0000
committerbringert <unknown>2005-01-28 15:57:59 +0000
commit8947c49066ec8920618e122811c4b766408a9ddd (patch)
tree57517ebcf271b49dc789de2f05f846e2304c2a0e /src/GF
parent37db5016a8b3f80e4d3b27378bbf6cfcd5a281e2 (diff)
Make first letter in GSL category names upper case.
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Speech/PrGSL.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/GF/Speech/PrGSL.hs b/src/GF/Speech/PrGSL.hs
index 1d505bea1..2ad379b4c 100644
--- a/src/GF/Speech/PrGSL.hs
+++ b/src/GF/Speech/PrGSL.hs
@@ -28,6 +28,8 @@ import GrammarTypes
import PrintParser
import Option
+import Data.Char (toUpper)
+
gslPrinter :: Ident -- ^ Grammar name
-> Options -> CFGrammar -> String
gslPrinter name opts cfg = prGSL srg ""
@@ -49,7 +51,12 @@ prGSL (SRG{grammarName=name,startCat=start,origStartCat=origStart,rules=rs})
where rhs' = rmPunct rhs
prSymbol (Cat c) = prCat c
prSymbol (Tok t) = wrap "\"" (prtS t) "\""
- prCat c = showString c
+ -- GSL requires an upper case letter in category names
+ prCat c = showString (firstToUpper c)
+
+firstToUpper :: String -> String
+firstToUpper [] = []
+firstToUpper (x:xs) = toUpper x : xs
rmPunct :: [Symbol String Token] -> [Symbol String Token]
rmPunct [] = []