diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-10 11:05:32 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-10 11:05:32 -0500 |
commit | af92fa4add356ce0435aaa16d13e8f1accf3f475 (patch) | |
tree | 43043c54a411ec219bb8cc0af7bb5495d53d3669 | |
parent | e3ea08d51db496336ff99d9af2691363edcd8502 (diff) |
fixed str_copy
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | misc.c | 2 | ||||
-rw-r--r-- | parse.c | 1 | ||||
-rw-r--r-- | test.toc | 4 |
4 files changed, 5 insertions, 4 deletions
@@ -18,8 +18,6 @@ /* TODO: -check for problematic circular dependencies -test really long type names packages --- X ::= newtype(int); or something @@ -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; } @@ -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; @@ -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 |