From a391c69fd3937cab699dbf18ec042c7eca93ac9a Mon Sep 17 00:00:00 2001 From: krasimir Date: Mon, 16 Mar 2009 14:10:30 +0000 Subject: use new parser which supports the syntax in GF.Grammar.Grammar directly --- src/GF/Compile/CheckGrammar.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/GF/Compile/CheckGrammar.hs') 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 -- cgit v1.2.3