shithub: mc

Download patch

ref: b8129e8dd68fa9f1257f4e368cb70a08fb5813b9
parent: 10fcb3eade99dfc59043d3488375e863edb068ee
parent: 1c1fd2f09c278e2f105abeadc5d5f0d2017c655a
author: Ori Bernstein <[email protected]>
date: Thu Jan 2 17:52:05 EST 2014

Merge branch 'master' of git+ssh://git.eigenstate.org/git/ori/mc

--- /dev/null
+++ b/libstd/hasprefix.myr
@@ -1,0 +1,12 @@
+use "cmp.use"
+pkg std =
+	const hasprefix	: (s : byte[:], pre : byte[:] -> bool)
+;;
+
+const hasprefix = {s, pre
+       match strncmp(s, pre, pre.len)
+       | `Equal:       -> true
+       | _:            -> false
+       ;;
+}
+
--- a/myrtypes/myrtypes.c
+++ b/myrtypes/myrtypes.c
@@ -199,6 +199,7 @@
         file = mkfile(argv[i]);
         file->file.exports = mkstab();
         file->file.globls = mkstab();
+        tyinit(file->file.globls);
         printf("%s:\n", argv[i]);
         if (fromuse) {
             f = fopen(argv[i], "r");
@@ -207,7 +208,6 @@
             loaduse(f, file->file.globls);
             dumpsyms(file->file.globls, 1);
         } else {
-            tyinit(file->file.globls);
             tokinit(argv[i]);
             yyparse();
             infer(file);