mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-17 23:22:51 -06:00
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.
This commit is contained in:
@@ -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_"
|
||||
|
||||
Reference in New Issue
Block a user