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
9e5c5b07
Commit
9e5c5b07
authored
29 years ago
by
Will Partain
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1996-01-22 18:57:26 by partain]
Small fix to unlit error-handling (from dnt)
parent
e0befe92
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/utils/unlit/unlit.c
+11
-10
11 additions, 10 deletions
ghc/utils/unlit/unlit.c
with
11 additions
and
10 deletions
ghc/utils/unlit/unlit.c
+
11
−
10
View file @
9e5c5b07
...
...
@@ -43,14 +43,14 @@
#include
<stdio.h>
#include
<ctype.h>
#define NULLSTR ((char *)0)
#define DEFNCHAR '>'
#define MISSINGBLANK "unlit: Program line next to comment"
#define EMPTYSCRIPT "unlit: No definitions in file (perhaps you forgot the '>'s?)"
#define USAGE "usage: unlit [-q] [-n] [-c] file1 file2\n"
#define CANNOTOPEN "unlit: cannot open \"%s\"\n"
#define DISTINCTNAMES "unlit: input and output filenames must differ\n"
#define MISSINGCODE
"unlit: missing
%s
\n"
#define NULLSTR
((char *)0)
#define DEFNCHAR
'>'
#define MISSINGBLANK
"unlit: Program line next to comment"
#define EMPTYSCRIPT
"unlit: No definitions in file (perhaps you forgot the '>'s?)"
#define USAGE
"usage: unlit [-q] [-n] [-c] file1 file2\n"
#define CANNOTOPEN
"unlit: cannot open \"%s\"\n"
#define DISTINCTNAMES
"unlit: input and output filenames must differ\n"
#define MISSING
END
CODE "unlit: missing
\\end{code}
\n"
#define BEGINCODE "\\begin{code}"
#define LENBEGINCODE 12
...
...
@@ -58,6 +58,7 @@
#define LENENDCODE 10
#ifdef PSEUDOCODE
/* According to Will Partain, the inventor of pseudocode, this gone now. */
#define MISSINGENDPSEUDOCODE "unlit: missing \\end{pseudocode}\n"
#define BEGINPSEUDOCODE "\\begin{pseudocode}"
#define LENBEGINPSEUDOCODE 18
#define ENDPSEUDOCODE "\\end{pseudocode}"
...
...
@@ -228,7 +229,7 @@ FILE *ostream; {
char
lineb
[
1000
];
for
(;;)
{
if
(
fgets
(
lineb
,
sizeof
lineb
,
istream
)
==
NULL
)
{
fprintf
(
stderr
,
MISSING
CODE
,
ENDCODE
);
complain
(
file
,
linesread
,
MISSINGENDCODE
);
exit
(
1
);
}
linesread
++
;
...
...
@@ -245,7 +246,7 @@ FILE *ostream; {
char
lineb
[
1000
];
for
(;;)
{
if
(
fgets
(
lineb
,
sizeof
lineb
,
istream
)
==
NULL
)
{
fprintf
(
stderr
,
MISSING
CODE
,
ENDPSEUDOCODE
);
complain
(
file
,
linesread
,
MISSINGENDPSEUDOCODE
);
exit
(
1
);
}
linesread
++
;
...
...
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