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
5fdc37e2
Commit
5fdc37e2
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-06-05 20:45:33 by sof]
Added SOURCE pragma handling; moved -- comment rule to have it kick-in on --<EOF>
parent
feab4212
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/parser/hslexer.flex
+26
-19
26 additions, 19 deletions
ghc/compiler/parser/hslexer.flex
with
26 additions
and
19 deletions
ghc/compiler/parser/hslexer.flex
+
26
−
19
View file @
5fdc37e2
...
...
@@ -7,7 +7,8 @@
* *
**********************************************************************/
#include "../../includes/config.h"
/* The includes/config.h one */
#include "config.h"
#include <stdio.h>
...
...
@@ -253,6 +254,23 @@ NL [\n\r]
%%
%{
/*
* Simple comments and whitespace. Normally, we would just ignore these, but
* in case we're processing a string escape, we need to note that we've seen
* a gap.
*
* Note that we cater for a comment line that *doesn't* end in a newline.
* This is incorrect, strictly speaking, but seems like the right thing
* to do. Reported by Rajiv Mirani. (WDP 95/08)
*
* Hackily moved up here so that --<<EOF>> will match -- SOF 5/97
*/
%}
<Code,GlaExt,StringEsc>"--"[^\n\r]*{NL}?{WS}* |
<Code,GlaExt,UserPragma,StringEsc>{WS}+ { noGap = FALSE; }
%{
/*
* Special GHC pragma rules. Do we need a start state for interface files,
...
...
@@ -308,15 +326,18 @@ NL [\n\r]
PUSH_STATE(Comment);
}
<Code,GlaExt>"{-#"{WS}*"OPTIONS" {
/* these are
by
the driver! */
/* these are
for
the driver! */
nested_comments =1;
PUSH_STATE(Comment);
}
<Code,GlaExt>"{-#"{WS}*"SOURCE" {
/* these are used by `make depend' (temp) */
<Code,GlaExt>"{-#"{WS}*"SOURCE"{WS}*"#"?"-}" {
/* these are used by `make depend' and the
compiler to indicate that a module should
be imported from source */
nested_comments =1;
PUSH_STATE(Comment
);
RETURN(SOURCE_UPRAGMA
);
}
<Code,GlaExt>"{-#"{WS}*[A-Z_]+ {
fprintf(stderr, "%s:%d: Warning: Unrecognised pragma '",
input_filename, hsplineno);
...
...
@@ -767,20 +788,6 @@ NL [\n\r]
POP_STATE;
}
%{
/*
* Simple comments and whitespace. Normally, we would just ignore these, but
* in case we're processing a string escape, we need to note that we've seen
* a gap.
*
* Note that we cater for a comment line that *doesn't* end in a newline.
* This is incorrect, strictly speaking, but seems like the right thing
* to do. Reported by Rajiv Mirani. (WDP 95/08)
*/
%}
<Code,GlaExt,StringEsc>"--".*{NL}?{WS}* |
<Code,GlaExt,UserPragma,StringEsc>{WS}+ { noGap = FALSE; }
%{
/*
...
...
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