diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-10 14:57:13 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-10 14:57:13 -0500 |
commit | e800a25fd2c4945b465b4cd90b4d212272d1641c (patch) | |
tree | a1bbba056171c9f3c74e02fac000f0992f84d27f /types.h | |
parent | 45b3f700400c6e62dfb67ac08c1264e24f59e118 (diff) |
added hash table test & fixed bugs there
Diffstat (limited to 'types.h')
-rw-r--r-- | types.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -466,6 +466,12 @@ typedef struct { U64 cap; } HashTable; +/* these are found in value hash tables */ +typedef struct { + Value val; + I64 num; +} ValNumPair; + typedef struct FnExpr { struct Declaration *params; /* declarations of the parameters to this function */ struct Declaration *ret_decls; /* array of decls, if this has named return values. otherwise, NULL */ @@ -475,7 +481,8 @@ typedef struct FnExpr { /* if name = NULL, this is an anonymous function, and id will be the ID of the fn. */ Identifier name; IdentID id; - HashTable *instances; /* for fns with co */ + HashTable *instances; /* for fns with constant parameters. the key is a tuple of the + constant parameters (note that this can be a 1-tuple) */ } c; } FnExpr; /* an expression such as fn(x: int) int { 2 * x } */ |