summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/Lockfield.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-09-19 20:48:10 +0000
committerhallgren <hallgren@chalmers.se>2013-09-19 20:48:10 +0000
commit021b5f06d3900fe2b10d5d3ccf6ac286a779ef16 (patch)
treecff0a0ca9c945dcef34f58a6e09fc5042c7abd65 /src/compiler/GF/Grammar/Lockfield.hs
parent3d5b9bd1fd46a51651cbfbd45f03e5b878aebbac (diff)
Introduce type RawIdent; only 9 imports of Data.ByteString.Char8 remain
The fact that identifiers are represented as ByteStrings is now an internal implentation detail in module GF.Infra.Ident. Conversion between ByteString and identifiers is only needed in the lexer and the Binary instances.
Diffstat (limited to 'src/compiler/GF/Grammar/Lockfield.hs')
-rw-r--r--src/compiler/GF/Grammar/Lockfield.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/compiler/GF/Grammar/Lockfield.hs b/src/compiler/GF/Grammar/Lockfield.hs
index 8b0798527..5c2f5d0f0 100644
--- a/src/compiler/GF/Grammar/Lockfield.hs
+++ b/src/compiler/GF/Grammar/Lockfield.hs
@@ -16,8 +16,6 @@
module GF.Grammar.Lockfield (lockRecType, unlockRecord, lockLabel, isLockLabel) where
-import qualified Data.ByteString.Char8 as BS
-
import GF.Infra.Ident
import GF.Grammar.Grammar
import GF.Grammar.Macros
@@ -41,12 +39,12 @@ unlockRecord c ft = do
_ -> return $ mkAbs xs (ExtR t lock)
lockLabel :: Ident -> Label
-lockLabel c = LIdent $! BS.append lockPrefix (ident2bs c)
+lockLabel c = LIdent $! prefixRawIdent lockPrefix (ident2raw c)
isLockLabel :: Label -> Bool
isLockLabel l = case l of
- LIdent c -> BS.isPrefixOf lockPrefix c
+ LIdent c -> isPrefixOf lockPrefix c
_ -> False
-lockPrefix = BS.pack "lock_"
+lockPrefix = rawIdentS "lock_"