summaryrefslogtreecommitdiff
path: root/src/GF/Compile/CheckGrammar.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Compile/CheckGrammar.hs')
-rw-r--r--src/GF/Compile/CheckGrammar.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs
index e128c3477..61c361199 100644
--- a/src/GF/Compile/CheckGrammar.hs
+++ b/src/GF/Compile/CheckGrammar.hs
@@ -30,12 +30,12 @@ import GF.Infra.Modules
import GF.Compile.TypeCheck
import GF.Compile.Refresh
+import GF.Grammar.Lexer
import GF.Grammar.Grammar
import GF.Grammar.PrGrammar
import GF.Grammar.Lookup
import GF.Grammar.Predef
import GF.Grammar.Macros
-import GF.Grammar.ReservedWords
import GF.Grammar.PatternMatch
import GF.Grammar.AppPredefined
import GF.Grammar.Lockfield (isLockLabel)
@@ -403,10 +403,9 @@ checkPrintname _ _ = return ()
-- | for grammars obtained otherwise than by parsing ---- update!!
checkReservedId :: Ident -> Check ()
-checkReservedId x = let c = prt x in
- if isResWord c
- then checkWarn ("Warning: reserved word used as identifier:" +++ c)
- else return ()
+checkReservedId x
+ | isReservedWord (ident2bs x) = checkWarn ("Warning: reserved word used as identifier:" +++ prt x)
+ | otherwise = return ()
-- to normalize records and record types
labelIndex :: Type -> Label -> Int