summaryrefslogtreecommitdiff
path: root/src/GF/Canon/LexGFC.hs
diff options
context:
space:
mode:
authorbringert <unknown>2004-12-06 16:02:08 +0000
committerbringert <unknown>2004-12-06 16:02:08 +0000
commit798cb370029712dc96e9ca5d1fbacc698c6d3649 (patch)
tree4db09c94a9c6046439d0e1c6ce4971add0b86013 /src/GF/Canon/LexGFC.hs
parentb63729307209c8f1c942cb70af12f89a46372993 (diff)
Use HashTable to share strings in tokens when parsing GFC files.
Diffstat (limited to 'src/GF/Canon/LexGFC.hs')
-rw-r--r--src/GF/Canon/LexGFC.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/GF/Canon/LexGFC.hs b/src/GF/Canon/LexGFC.hs
index d27e31657..56376894b 100644
--- a/src/GF/Canon/LexGFC.hs
+++ b/src/GF/Canon/LexGFC.hs
@@ -1,7 +1,7 @@
{-# OPTIONS -fglasgow-exts -cpp #-}
{-# LINE 3 "LexGFC.x" #-}
module LexGFC where
-
+import SharedString
import ErrM
#if __GLASGOW_HASKELL__ >= 503
@@ -35,10 +35,10 @@ alex_accept = listArray (0::Int,14) [[],[],[(AlexAccSkip)],[(AlexAcc (alex_actio
tok f p s = f p s
data Tok =
- TS String -- reserved words
- | TL String -- string literals
+ TS !String -- reserved words
+ | TL !String -- string literals
| TI String -- integer literals
- | TV String -- identifiers
+ | TV !String -- identifiers -- H
| TD String -- double precision float literals
| TC String -- character literals
@@ -130,9 +130,9 @@ alexGetChar (p, _, (c:s)) =
alexInputPrevChar :: AlexInput -> Char
alexInputPrevChar (p, c, s) = c
-alex_action_1 = tok (\p s -> PT p (TS s))
-alex_action_2 = tok (\p s -> PT p (eitherResIdent TV s))
-alex_action_3 = tok (\p s -> PT p (TL $ unescapeInitTail s))
+alex_action_1 = tok (\p s -> PT p (TS (shareString s)))
+alex_action_2 = tok (\p s -> PT p (eitherResIdent (TV . shareString) s))
+alex_action_3 = tok (\p s -> PT p (TL $ shareString $ unescapeInitTail s))
alex_action_4 = tok (\p s -> PT p (TI s))
{-# LINE 1 "GenericTemplate.hs" #-}
{-# LINE 1 "<built-in>" #-}