diff options
author | Ian Lynagh <igloo@earth.li> | 2012-07-15 00:10:27 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-07-15 00:36:53 +0100 |
commit | 509d2ad24e377b8f9d3487ab7a3b2c3d1d936eaa (patch) | |
tree | d4f450196a096549acbc2ee7a744da9f3f977f74 /compiler/basicTypes | |
parent | 2f01debc33a3ba60feaf2f9add0778bbd2ab81c2 (diff) | |
download | haskell-509d2ad24e377b8f9d3487ab7a3b2c3d1d936eaa.tar.gz |
Add a separate FastZString type
FastStrings are now always UTF8-encoded.
There's no StringTable for FastZString, but I don't think one is needed.
We only ever make a FastZString by running zEncodeFS on a FastString,
and the FastStrings are shared via the FastString StringTable, so we get
the same FastZString from the IORef.
Diffstat (limited to 'compiler/basicTypes')
-rw-r--r-- | compiler/basicTypes/Module.lhs | 4 | ||||
-rw-r--r-- | compiler/basicTypes/Name.lhs | 2 | ||||
-rw-r--r-- | compiler/basicTypes/OccName.lhs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler/basicTypes/Module.lhs b/compiler/basicTypes/Module.lhs index b5fe77d4db..35d4a89a23 100644 --- a/compiler/basicTypes/Module.lhs +++ b/compiler/basicTypes/Module.lhs @@ -191,7 +191,7 @@ pprModuleName :: ModuleName -> SDoc pprModuleName (ModuleName nm) = getPprStyle $ \ sty -> if codeStyle sty - then ftext (zEncodeFS nm) + then ztext (zEncodeFS nm) else ftext nm moduleNameFS :: ModuleName -> FastString @@ -271,7 +271,7 @@ pprPackagePrefix p mod = getPprStyle doc | codeStyle sty = if p == mainPackageId then empty -- never qualify the main package in code - else ftext (zEncodeFS (packageIdFS p)) <> char '_' + else ztext (zEncodeFS (packageIdFS p)) <> char '_' | qualModule sty mod = ftext (packageIdFS (modulePackageId mod)) <> char ':' -- the PrintUnqualified tells us which modules have to -- be qualified with package names diff --git a/compiler/basicTypes/Name.lhs b/compiler/basicTypes/Name.lhs index 3fefd7b59b..3d89f59f04 100644 --- a/compiler/basicTypes/Name.lhs +++ b/compiler/basicTypes/Name.lhs @@ -514,7 +514,7 @@ ppr_occ_name occ = ftext (occNameFS occ) -- In code style, we Z-encode the strings. The results of Z-encoding each FastString are -- cached behind the scenes in the FastString implementation. ppr_z_occ_name :: OccName -> SDoc -ppr_z_occ_name occ = ftext (zEncodeFS (occNameFS occ)) +ppr_z_occ_name occ = ztext (zEncodeFS (occNameFS occ)) -- Prints (if mod information is available) "Defined at <loc>" or -- "Defined in <mod>" information for a Name. diff --git a/compiler/basicTypes/OccName.lhs b/compiler/basicTypes/OccName.lhs index 553797f263..a162040d13 100644 --- a/compiler/basicTypes/OccName.lhs +++ b/compiler/basicTypes/OccName.lhs @@ -265,7 +265,7 @@ pprOccName :: OccName -> SDoc pprOccName (OccName sp occ) = getPprStyle $ \ sty -> if codeStyle sty - then ftext (zEncodeFS occ) + then ztext (zEncodeFS occ) else pp_occ <> pp_debug sty where pp_debug sty | debugStyle sty = braces (pprNameSpaceBrief sp) |