projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9643b98
)
[project @ 1999-01-15 14:06:50 by simonm]
author
simonm
<unknown>
Fri, 15 Jan 1999 14:06:50 +0000
(14:06 +0000)
committer
simonm
<unknown>
Fri, 15 Jan 1999 14:06:50 +0000
(14:06 +0000)
wibble
ghc/compiler/basicTypes/OccName.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/basicTypes/OccName.lhs
b/ghc/compiler/basicTypes/OccName.lhs
index
bc08698
..
ede2a97
100644
(file)
--- a/
ghc/compiler/basicTypes/OccName.lhs
+++ b/
ghc/compiler/basicTypes/OccName.lhs
@@
-39,10
+39,12
@@
module OccName (
#include "HsVersions.h"
#if __HASKELL1__ > 4
#include "HsVersions.h"
#if __HASKELL1__ > 4
-import Char ( isAlpha, isUpper, isLower, isAlphaNum{-sigh-}, ord )
+#define ISALPHANUM isAlphaNum
#else
#else
-import Char ( isAlpha, isUpper, isLower, isAlphanum, ord )
+#define ISALPHANUM isAlphanum
#endif
#endif
+
+import Char ( isAlpha, isUpper, isLower, ISALPHANUM, ord )
import Util ( thenCmp )
import FiniteMap ( FiniteMap, emptyFM, lookupFM, addToFM, elemFM )
import Outputable
import Util ( thenCmp )
import FiniteMap ( FiniteMap, emptyFM, lookupFM, addToFM, elemFM )
import Outputable
@@
-553,7
+555,7
@@
We provide two interfaces for efficiency.
\begin{code}
identToC :: String -> FAST_STRING
identToC str
\begin{code}
identToC :: String -> FAST_STRING
identToC str
- | all isAlphanum str && not std = _PK_ str
+ | all ISALPHANUM str && not std = _PK_ str
| std = _PK_ ("Zs" ++ encode str)
| otherwise = _PK_ (encode str)
where
| std = _PK_ ("Zs" ++ encode str)
| otherwise = _PK_ (encode str)
where
@@
-561,7
+563,7
@@
identToC str
identFsToC :: FAST_STRING -> FAST_STRING
identFsToC fast_str
identFsToC :: FAST_STRING -> FAST_STRING
identFsToC fast_str
- | all isAlphanum str && not std = fast_str
+ | all ISALPHANUM str && not std = fast_str
| std = _PK_ ("Zs" ++ encode str)
| otherwise = _PK_ (encode str)
where
| std = _PK_ ("Zs" ++ encode str)
| otherwise = _PK_ (encode str)
where
@@
-577,7
+579,7
@@
encode [] = []
encode (c:cs) = encode_ch c ++ encode cs
encode_ch :: Char -> String
encode (c:cs) = encode_ch c ++ encode cs
encode_ch :: Char -> String
-encode_ch c | isAlphanum c = [c]
+encode_ch c | ISALPHANUM c = [c]
-- Common case first
encode_ch 'Z' = "ZZ"
encode_ch '&' = "Za"
-- Common case first
encode_ch 'Z' = "ZZ"
encode_ch '&' = "Za"