diff options
| author | aarne <unknown> | 2003-11-17 15:17:53 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2003-11-17 15:17:53 +0000 |
| commit | 70c9f7b365b07044c07837a04223a11dfa3b7140 (patch) | |
| tree | b39c484dd86d6226f716f241da0b4a85a630a6a0 /src/GF/UseGrammar | |
| parent | 9d55f72d7a97658faa6ebc890535fa0c6e665a05 (diff) | |
Lexer by need.
Diffstat (limited to 'src/GF/UseGrammar')
| -rw-r--r-- | src/GF/UseGrammar/Custom.hs | 1 | ||||
| -rw-r--r-- | src/GF/UseGrammar/Parsing.hs | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/GF/UseGrammar/Custom.hs b/src/GF/UseGrammar/Custom.hs index 4d5eb8122..10446413a 100644 --- a/src/GF/UseGrammar/Custom.hs +++ b/src/GF/UseGrammar/Custom.hs @@ -148,6 +148,7 @@ customGrammarPrinter = ,(strCI "lbnf", prLBNF . stateCF) ,(strCI "morpho", prMorpho . stateMorpho) ,(strCI "opts", prOpts . stateOptions) + ,(strCI "words", unwords . stateGrammarWords) {- ---- (strCI "gf", prt . st2grammar . stateGrammarST) -- DEFAULT ,(strCI "canon", showCanon "Lang" . stateGrammarST) diff --git a/src/GF/UseGrammar/Parsing.hs b/src/GF/UseGrammar/Parsing.hs index ab379cec3..b5b587c91 100644 --- a/src/GF/UseGrammar/Parsing.hs +++ b/src/GF/UseGrammar/Parsing.hs @@ -92,10 +92,10 @@ tokens2trms opts sg cn parser as = do verb = oElem beVerbose opts forgive = oElem forgiveParse opts - unknown ts = case filter noMatch ts of + unknown ts = case filter noMatch [t | t@(TS _) <- ts] of [] -> "where all words are known" us -> "with the unknown tokens" +++ show us --- needs to be fixed for literals - terminals = map TS $ cfTokens $ stateCF sg + terminals = map TS $ stateGrammarWords sg noMatch t = all (not . compatTok t) terminals |
