shithub: mc

Download patch

ref: af3b677d34189d7d6b523e170d78596d956c9d53
parent: 883f80be8ee43308731a6827cf948f7929895ff8
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Mar 28 21:03:41 EDT 2015

Fix a few bugs/update some versions.

--- a/deps.myr
+++ b/deps.myr
@@ -215,9 +215,10 @@
 	| `std.None:	std.fatal(1, "library %s: could not read usefile\n", lib)
 	;;
 	match bio.getbe32(f)
-	| `std.None:	std.fatal(1, "library %s: corrutpt or invalid usefile\n", lib)
-	| `std.Some 0:	/* nothing: version matches. */
+	| `std.Some 1:	/* nothing: version matches. */
+	| `std.Some 0:	std.put(1, "library %s: warning: old usefile version\n", lib)
 	| `std.Some _:	std.fatal(1, "library %s: usefile version unknown\n", lib)
+	| `std.None:	std.fatal(1, "library %s: corrutpt or invalid usefile\n", lib)
 	;;
 	std.slfree(rdstr(f))
 	done = false
--- a/parse.myr
+++ b/parse.myr
@@ -329,17 +329,17 @@
 	c = peekc(p)
 	if c == '"'
 		n = 0
-		nextc(p)
+		getc(p)
 		start = p.rest
 		while p.rest.len > 0
 			c = peekc(p)
 			if c == '"'
-				nextc(p)
+				getc(p)
 				goto done
 			elif c == '\\'
-				c = nextc(p)
+				c = getc(p)
 			;;
-			nextc(p)
+			getc(p)
 			n += std.charlen(c)
 		;;
 		failparse(p, "input ended within quoted word\n")
@@ -349,7 +349,7 @@
 		while p.rest.len > 0
 			c = peekc(p)
 			if wordchar(c)
-				nextc(p)
+				getc(p)
 				n += std.charlen(c)
 			else
 				break
@@ -378,14 +378,14 @@
 	while r.len > 0
 		c = peekc(p)
 		match c
-		| ' ':	nextc(p)
-		| '\t':	nextc(p)
+		| ' ':	getc(p)
+		| '\t':	getc(p)
 		| '\n':
-			nextc(p)
+			getc(p)
 			p.line++
 		| '#':
 			while p.rest.len > 0 && peekc(p) != '\n'
-				nextc(p)
+				getc(p)
 			;;
 		| _:
 			break
@@ -412,7 +412,7 @@
 	-> std.decode(p.rest)
 }
 
-const nextc = {p
+const getc = {p
 	var c, s
 
 	(c, s) = std.striter(p.rest)