summaryrefslogtreecommitdiff
path: root/src/GF/Canon/LexGFC.hs
diff options
context:
space:
mode:
authoraarne <unknown>2004-09-23 14:41:42 +0000
committeraarne <unknown>2004-09-23 14:41:42 +0000
commit2c60a2d82a0d7b90924e7dbbcacf36afb8549d17 (patch)
tree0a04734e741c294cb9f58cfdcafa2ff2b55894dd /src/GF/Canon/LexGFC.hs
parentd5b4230d6dbee8c03eedf8d181dfa2badf1a954b (diff)
Ints n
Diffstat (limited to 'src/GF/Canon/LexGFC.hs')
-rw-r--r--src/GF/Canon/LexGFC.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/GF/Canon/LexGFC.hs b/src/GF/Canon/LexGFC.hs
index 6bcd1aa36..4c7b8810e 100644
--- a/src/GF/Canon/LexGFC.hs
+++ b/src/GF/Canon/LexGFC.hs
@@ -37,12 +37,12 @@ data Tok =
| TD String -- double precision float literals
| TC String -- character literals
- deriving (Eq,Show)
+ deriving (Eq,Show,Ord)
data Token =
PT Posn Tok
| Err Posn
- deriving Show
+ deriving (Eq,Show,Ord)
tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l
tokenPos (Err (Pn _ l _) :_) = "line " ++ show l
@@ -57,12 +57,13 @@ prToken t = case t of
PT _ (TV s) -> s
PT _ (TD s) -> s
PT _ (TC s) -> s
+ _ -> show t
eitherResIdent :: (String -> Tok) -> String -> Tok
eitherResIdent tv s = if isResWord s then (TS s) else (tv s) where
isResWord s = isInTree s $
- B "lin" (B "data" (B "abstract" (B "Type" (B "Str" N N) N) (B "concrete" (B "cat" N N) N)) (B "grammar" (B "fun" (B "flags" N N) N) (B "in" N N))) (B "pre" (B "open" (B "of" (B "lincat" N N) N) (B "param" (B "oper" N N) N)) (B "transfer" (B "table" (B "resource" N N) N) (B "variants" N N)))
+ B "lin" (B "concrete" (B "Type" (B "Str" (B "Ints" N N) N) (B "cat" (B "abstract" N N) N)) (B "fun" (B "flags" (B "data" N N) N) (B "in" (B "grammar" N N) N))) (B "pre" (B "open" (B "of" (B "lincat" N N) N) (B "param" (B "oper" N N) N)) (B "transfer" (B "table" (B "resource" N N) N) (B "variants" N N)))
data BTree = N | B String BTree BTree deriving (Show)
@@ -90,7 +91,7 @@ unescapeInitTail = unesc . tail where
-------------------------------------------------------------------
data Posn = Pn !Int !Int !Int
- deriving (Eq, Show)
+ deriving (Eq, Show,Ord)
alexStartPos :: Posn
alexStartPos = Pn 0 1 1