Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
cc3e39d1
Commit
cc3e39d1
authored
Apr 20, 2001
by
sewardj
Browse files
[project @ 2001-04-20 10:42:46 by sewardj]
merge rev 1.4.2.1
parent
e7523c0c
Changes
1
Show whitespace changes
Inline
Side-by-side
ghc/compiler/main/GetImports.hs
View file @
cc3e39d1
-----------------------------------------------------------------------------
-- $Id: GetImports.hs,v 1.
4
200
0/11
/20 1
5:54:27
sewardj Exp $
-- $Id: GetImports.hs,v 1.
5
200
1/04
/20 1
0:42:46
sewardj Exp $
--
-- GHC Driver program
--
...
...
@@ -34,6 +34,11 @@ getImports s
=
f
((
mkMN
m
)
:
si
)
ni
me
ws
f
si
ni
me
(
"tropmi"
:
"#-{"
:
"ECRUOS"
:
"}-#"
:
m
:
ws
)
=
f
((
mkMN
m
)
:
si
)
ni
me
ws
-- skip other contents of pragma comments
f
si
ni
me
(
"#-{"
:
ws
)
=
f
si
ni
me
(
drop
1
(
dropWhile
(
/=
"}-#"
)
ws
))
f
si
ni
me
(
"tropmi"
:
"deifilauq"
:
m
:
ws
)
=
f
si
((
mkMN
m
)
:
ni
)
me
ws
f
si
ni
me
(
"tropmi"
:
m
:
ws
)
...
...
@@ -53,15 +58,13 @@ clean s
where
-- running through text we want to keep
keep
acc
[]
=
cons
acc
[]
keep
acc
(
c
:
cs
)
|
isSpace
c
=
cons
acc
(
keep
""
cs
)
keep
acc
(
c
:
cs
)
|
isSpace
c
=
cons
acc
(
keep
""
cs
)
keep
acc
(
'"'
:
cs
)
=
cons
acc
(
dquote
cs
)
-- "
-- try to eliminate single quotes when they're part of
-- an identifier...
-- don't be fooled by single quotes which are part of an identifier
keep
acc
(
c
:
'
\'
'
:
cs
)
|
isAlphaNum
c
||
c
==
'_'
=
keep
acc
(
c
:
cs
)
|
isAlphaNum
c
||
c
==
'_'
=
keep
(
'
\'
'
:
c
:
acc
)
(
c
:
cs
)
keep
acc
(
'
\'
'
:
cs
)
=
cons
acc
(
squote
cs
)
keep
acc
(
'-'
:
'-'
:
cs
)
=
cons
acc
(
linecomment
cs
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment