Skip to content

Commit

Permalink
merging master
Browse files Browse the repository at this point in the history
  • Loading branch information
myegorov committed Oct 13, 2017
2 parents 3130bf7 + 30b7da1 commit 803582d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions mlton/front-end/ml.lex
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ real=(~?)(({decnum}{frac}?{exp})|({decnum}{frac}{exp}?));
(if allowLineComments ()
then ()
else error (source, yypos, lastPos (yypos, yytext),
"Line comments disallowed, compile with -default-ann 'allowLineConsts true'")
"Line comments disallowed, compile with -default-ann 'allowLineComments true'")
; startComment (source, yypos, fn () =>
YYBEGIN INITIAL)
; YYBEGIN LINE_COMMENT
Expand All @@ -488,7 +488,7 @@ real=(~?)(({decnum}{frac}?{exp})|({decnum}{frac}{exp}?));
(if allowLineComments ()
then ()
else error (source, yypos, lastPos (yypos, yytext),
"Line comments disallowed, compile with -default-ann 'allowLineConsts true'")
"Line comments disallowed, compile with -default-ann 'allowLineComments true'")
; startComment (source, yypos, fn () =>
YYBEGIN BLOCK_COMMENT)
; YYBEGIN LINE_COMMENT
Expand Down
40 changes: 20 additions & 20 deletions runtime/gc/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,21 @@ int processAtMLton (GC_state s, int start, int argc, char **argv,
arg = argv[i];
if (0 == strcmp (arg, "copy-generational-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton copy-generational-ratio missing argument.");
s->controls.ratios.copyGenerational = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.copyGenerational)
die ("@MLton copy-generational-ratio argument must be greater than 1.0.");
} else if (0 == strcmp (arg, "copy-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton copy-ratio missing argument.");
s->controls.ratios.copy = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.copy)
die ("@MLton copy-ratio argument must be greater than 1.0.");
} else if (0 == strcmp (arg, "fixed-heap")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton fixed-heap missing argument.");
s->controls.fixedHeap = align (stringToBytes (argv[i++]),
2 * s->sysvals.pageSize);
Expand All @@ -127,22 +127,22 @@ int processAtMLton (GC_state s, int start, int argc, char **argv,
}
} else if (0 == strcmp (arg, "grow-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton grow-ratio missing argument.");
s->controls.ratios.grow = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.grow)
die ("@MLton grow-ratio argument must be greater than 1.0.");
} else if (0 == strcmp (arg, "hash-cons")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton hash-cons missing argument.");
s->controls.ratios.hashCons = stringToFloat (argv[i++]);
unless (0.0 <= s->controls.ratios.hashCons
and s->controls.ratios.hashCons <= 1.0)
die ("@MLton hash-cons argument must be between 0.0 and 1.0.");
} else if (0 == strcmp (arg, "live-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton live-ratio missing argument.");
s->controls.ratios.live = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.live)
Expand All @@ -152,47 +152,47 @@ int processAtMLton (GC_state s, int start, int argc, char **argv,
die ("May not load world.");
i++;
s->amOriginal = FALSE;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton load-world missing argument.");
*worldFile = argv[i++];
} else if (0 == strcmp (arg, "mark-compact-generational-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton mark-compact-generational-ratio missing argument.");
s->controls.ratios.markCompactGenerational = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.markCompactGenerational)
die ("@MLton mark-compact-generational-ratio argument must be greater than 1.0.");
} else if (0 == strcmp (arg, "mark-compact-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton mark-compact-ratio missing argument.");
s->controls.ratios.markCompact = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.markCompact)
die ("@MLton mark-compact-ratio argument must be greater than 1.0.");
} else if (0 == strcmp (arg, "max-heap")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton max-heap missing argument.");
s->controls.maxHeap = align (stringToBytes (argv[i++]),
2 * s->sysvals.pageSize);
} else if (0 == strcmp (arg, "may-page-heap")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton may-page-heap missing argument.");
s->controls.mayPageHeap = stringToBool (argv[i++]);
} else if (0 == strcmp (arg, "no-load-world")) {
i++;
s->controls.mayLoadWorld = FALSE;
} else if (0 == strcmp (arg, "nursery-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton nursery-ratio missing argument.");
s->controls.ratios.nursery = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.nursery)
die ("@MLton nursery-ratio argument must be greater than 1.0.");
} else if (0 == strcmp (arg, "ram-slop")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton ram-slop missing argument.");
s->controls.ratios.ramSlop = stringToFloat (argv[i++]);
} else if (0 == strcmp (arg, "show-sources")) {
Expand All @@ -203,51 +203,51 @@ int processAtMLton (GC_state s, int start, int argc, char **argv,
s->controls.mayProcessAtMLton = FALSE;
} else if (0 == strcmp (arg, "stack-current-grow-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton stack-current-grow-ratio missing argument.");
s->controls.ratios.stackCurrentGrow = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.stackCurrentGrow)
die ("@MLton stack-current-grow-ratio argument must greater than 1.0.");
} else if (0 == strcmp (arg, "stack-current-max-reserved-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton stack-current-max-reserved-ratio missing argument.");
s->controls.ratios.stackCurrentMaxReserved = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.stackCurrentMaxReserved)
die ("@MLton stack-current-max-reserved-ratio argument must greater than 1.0.");
} else if (0 == strcmp (arg, "stack-current-permit-reserved-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton stack-current-permit-reserved-ratio missing argument.");
s->controls.ratios.stackCurrentPermitReserved = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.stackCurrentPermitReserved)
die ("@MLton stack-current-permit-reserved-ratio argument must greater than 1.0.");
} else if (0 == strcmp (arg, "stack-current-shrink-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton stack-current-shrink-ratio missing argument.");
s->controls.ratios.stackCurrentShrink = stringToFloat (argv[i++]);
unless (0.0 <= s->controls.ratios.stackCurrentShrink
and s->controls.ratios.stackCurrentShrink <= 1.0)
die ("@MLton stack-current-shrink-ratio argument must be between 0.0 and 1.0.");
} else if (0 == strcmp (arg, "stack-max-reserved-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton stack-max-reserved-ratio missing argument.");
s->controls.ratios.stackMaxReserved = stringToFloat (argv[i++]);
unless (1.0 < s->controls.ratios.stackMaxReserved)
die ("@MLton stack-max-reserved-ratio argument must greater than 1.0.");
} else if (0 == strcmp (arg, "stack-shrink-ratio")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton stack-shrink-ratio missing argument.");
s->controls.ratios.stackShrink = stringToFloat (argv[i++]);
unless (0.0 <= s->controls.ratios.stackShrink
and s->controls.ratios.stackShrink <= 1.0)
die ("@MLton stack-shrink-ratio argument must be between 0.0 and 1.0.");
} else if (0 == strcmp (arg, "use-mmap")) {
i++;
if (i == 0 || 0 == strcmp (argv[i], "--"))
if (i == argc || 0 == strcmp (argv[i], "--"))
die ("@MLton use-mmap missing argument.");
GC_setCygwinUseMmap (stringToBool (argv[i++]));
} else if (0 == strcmp (arg, "--")) {
Expand Down

0 comments on commit 803582d

Please sign in to comment.