summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-10 11:05:32 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-10 11:05:32 -0500
commitaf92fa4add356ce0435aaa16d13e8f1accf3f475 (patch)
tree43043c54a411ec219bb8cc0af7bb5495d53d3669
parente3ea08d51db496336ff99d9af2691363edcd8502 (diff)
fixed str_copy
-rw-r--r--main.c2
-rw-r--r--misc.c2
-rw-r--r--parse.c1
-rw-r--r--test.toc4
4 files changed, 5 insertions, 4 deletions
diff --git a/main.c b/main.c
index c329d27..0259f07 100644
--- a/main.c
+++ b/main.c
@@ -18,8 +18,6 @@
/*
TODO:
-check for problematic circular dependencies
-test really long type names
packages
---
X ::= newtype(int); or something
diff --git a/misc.c b/misc.c
index 313a2a6..b71b07c 100644
--- a/misc.c
+++ b/misc.c
@@ -44,7 +44,7 @@ size_t str_copy(char *dest, size_t destsz, const char *src) {
}
++src; ++dest;
}
- dest[destsz-1] = 0;
+ *dest = 0;
return destsz-1;
}
diff --git a/parse.c b/parse.c
index 3265f7d..2c6fcf7 100644
--- a/parse.c
+++ b/parse.c
@@ -282,7 +282,6 @@ static size_t type_to_str_(Type *t, char *buffer, size_t bufsize) {
/* return value should be freed by caller */
static char *type_to_str(Type *t) {
- /* TODO allow types >255 chars */
char *ret = err_malloc(256);
type_to_str_(t, ret, 256);
return ret;
diff --git a/test.toc b/test.toc
index 1139416..16a00d4 100644
--- a/test.toc
+++ b/test.toc
@@ -21,7 +21,11 @@ Bar ::= struct { f: &Foo; };
Foo ::= struct { b: Bar; };
+
+
main ::= fn() {
f::=fn(t::Type)Type {t};
x:f(int) = 5;
+
+ z : fn(int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int,int, int)=5;
}; \ No newline at end of file