Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
ffb05ba3
Commit
ffb05ba3
authored
26 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-01-15 14:06:50 by simonm]
wibble
parent
9643b98f
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/basicTypes/OccName.lhs
+7
-5
7 additions, 5 deletions
ghc/compiler/basicTypes/OccName.lhs
with
7 additions
and
5 deletions
ghc/compiler/basicTypes/OccName.lhs
+
7
−
5
View file @
ffb05ba3
...
...
@@ -39,10 +39,12 @@ module OccName (
#include "HsVersions.h"
#if __HASKELL1__ > 4
import Char ( isAlpha, isUpper, isLower, isAlphaNum{-sigh-}, ord )
#define ISALPHANUM isAlphaNum
#else
import Char ( isAlpha, isUpper, isLower,
isAlphanum
, ord )
#define ISALPHANUM
isAlphanum
#endif
import Char ( isAlpha, isUpper, isLower, ISALPHANUM, ord )
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
| all
isAlphanum
str && not std = _PK_ str
| all
ISALPHANUM
str && not std = _PK_ str
| std = _PK_ ("Zs" ++ encode str)
| otherwise = _PK_ (encode str)
where
...
...
@@ -561,7 +563,7 @@ identToC 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
...
...
@@ -577,7 +579,7 @@ encode [] = []
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"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment