From 3b39607bbac8e6ab99198ab608f14e1f84c2f60e Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 24 Jun 2004 14:06:09 +0000 Subject: last-minute bug fixes --- src/GF/Compile/ShellState.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/GF/Compile/ShellState.hs') 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 = -- cgit v1.2.3