diff options
| author | krasimir <krasimir@chalmers.se> | 2009-03-16 14:10:30 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-03-16 14:10:30 +0000 |
| commit | a391c69fd3937cab699dbf18ec042c7eca93ac9a (patch) | |
| tree | 4c1ff08c286ed6d5fdb7b875430adf816e21d6b9 /src/GF/Compile/CheckGrammar.hs | |
| parent | 5597cff5cb186616a0db14a2e579f7261f1a32a3 (diff) | |
use new parser which supports the syntax in GF.Grammar.Grammar directly
Diffstat (limited to 'src/GF/Compile/CheckGrammar.hs')
| -rw-r--r-- | src/GF/Compile/CheckGrammar.hs | 9 |
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 |
