Permalink
Browse files

Add -e command line flag, and bump version number.

  • Loading branch information...
1 parent 6b2b41f commit 28597aad6703f012f786a306244d3262bde6f443 @cpressey cpressey committed Feb 4, 2012
Showing with 15 additions and 2 deletions.
  1. +6 −0 README
  2. +9 −2 miniscm.c
View
6 README
@@ -9,13 +9,19 @@ to become the new maintainer of the language or implementation; rather,
it is simply to provide a modernized and generally backwards-compatible
source base for miniscm.
+The current version of this fork of Mini-Scheme is:
+
+ Version 0.85p1 (as yet unreleased)
+
Some improvements that have been made:
- modernized Makefile (defaults to 4.3 BSD, which works for Linux)
- removed compiler warnings (under 4.3 BSD)
- made compilable under AmigaOS 1.3 with DICE C
- added -q command line option to suppress all non-explicit output
(this includes the prompt; if you want output, use (display))
+- added -e command line option to cause all errors to be treated
+ as fatal errors (exit interpreter immediately with error code 1)
Some further improvements I might consider:
View
@@ -14,6 +14,7 @@
/*--
*
* This version has been modified by Chris Pressey.
+ * current version is 0.85p1 (as yet unreleased)
*
* This version has been modified by R.C. Secrist.
*
@@ -104,7 +105,7 @@
-#define banner "Hello, This is Mini-Scheme Interpreter Version 0.85k4-a.\n"
+#define banner "Hello, This is Mini-Scheme Interpreter Version 0.85p1.\n"
#include <stdio.h>
@@ -340,6 +341,7 @@ jmp_buf error_jmp;
#endif
char gc_verbose; /* if gc_verbose is not zero, print gc status */
int quiet = 0; /* if not zero, print banner, prompt, results */
+int all_errors_fatal = 0; /* if not zero, every error is a FatalError */
/* allocate new cell segment */
alloc_cellseg(n)
@@ -1795,6 +1797,9 @@ register short op;
}
tmpfp = outfp;
outfp = stderr;
+ if (all_errors_fatal) {
+ FatalError(strvalue(car(args)));
+ }
fprintf(outfp, "Error: ");
fprintf(outfp, "%s", strvalue(car(args)));
args = cdr(args);
@@ -2461,7 +2466,9 @@ main()
#ifdef CMDLINE
for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-q") == 0) {
+ if (strcmp(argv[i], "-e") == 0) {
+ all_errors_fatal = 1;
+ } else if (strcmp(argv[i], "-q") == 0) {
quiet = 1;
}
}

0 comments on commit 28597aa

Please sign in to comment.