summaryrefslogtreecommitdiff
path: root/src/GF/Compile/ShellState.hs
diff options
context:
space:
mode:
authoraarne <unknown>2004-06-24 14:06:09 +0000
committeraarne <unknown>2004-06-24 14:06:09 +0000
commit3b39607bbac8e6ab99198ab608f14e1f84c2f60e (patch)
tree35b823c38ef0ed7439f1a057d939fbdfa96bc719 /src/GF/Compile/ShellState.hs
parentd3db78ad31fe8b27c7ebb4e05b92d4c3986cb119 (diff)
last-minute bug fixes
Diffstat (limited to 'src/GF/Compile/ShellState.hs')
-rw-r--r--src/GF/Compile/ShellState.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/GF/Compile/ShellState.hs b/src/GF/Compile/ShellState.hs
index a306902d9..18b237745 100644
--- a/src/GF/Compile/ShellState.hs
+++ b/src/GF/Compile/ShellState.hs
@@ -313,12 +313,16 @@ firstGrammarST = stateGrammarST . firstStateGrammar
firstAbstractST = abstractOf . firstGrammarST
firstConcreteST = concreteOf . firstGrammarST
-}
--- command-line option -language=foo overrides the actual grammar in state
+-- command-line option -lang=foo overrides the actual grammar in state
grammarOfOptState :: Options -> ShellState -> StateGrammar
grammarOfOptState opts st =
maybe (firstStateGrammar st) (stateGrammarOfLang st . language) $
getOptVal opts useLanguage
+languageOfOptState :: Options -> ShellState -> Maybe Language
+languageOfOptState opts st =
+ maybe (concrete st) (return . language) $ getOptVal opts useLanguage
+
-- command-line option -cat=foo overrides the possible start cat of a grammar
firstCatOpts :: Options -> StateGrammar -> CFCat
firstCatOpts opts sgr =