Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Warn when using native as code | 1b14ec57777560df0982a08f3a2bc8eb27a1df75 | lep | 2020-08-03 09:32:38 |
Use the strhash hashfunc for our hashtables. | d6f0de51cb54921b529799b9939cfe2dcdf7b4d0 | lep | 2020-07-29 11:13:13 |
Document installation methods | 814075ef77bc8981684971bfc2a5c626f2e34035 | lep | 2020-07-18 08:11:43 |
Improved Readme | c8d57e3c1953d5e67ca12f75f5685f7786eacaf2 | lep | 2020-07-18 07:43:09 |
Added some tests for the new StringHash check. | 1f613e7c5b078cc3ce3a04a957291ca070856528 | lep | 2020-07-18 07:17:26 |
Added check for bad StringHash usage | 3abbed6aa1cd87e202a0b038e8af2246e9ceadeb | lep | 2020-07-17 22:13:39 |
Fix release target | 6eca932b6210f1ac93b3bc030c15797d88d529b6 | lep | 2019-10-17 12:58:24 |
Better error message for `type` as a name | 665dc1efab9a5a8706bb0fcb95a13eabe3358436 | lep | 2019-10-17 12:53:35 |
Added reserved keyword 'alias' | 7589b241e1179f85bf19b82696d97d8365034376 | lep | 2019-05-31 21:57:10 |
More newline stuff | 3e57cdb92c766375430c701034db56e81dcc27e2 | lep | 2019-05-18 09:44:12 |
Report natives after function defintions | eb58451c6e2df142a51e85e68ee11efa45c3215c | lep | 2019-04-01 12:49:24 |
Specify minimum bison version in readme | 44b75417a7d01e2639a4b4acda031e95eca8ffb2 | lep | 2019-02-18 23:41:48 |
Support Apple by defining _aligned_malloc | 596488eafa1e09c1120d2488c78959a8c63c5a5d | Jesse Rogers | 2019-01-03 17:08:49 |
Improved the amalgation build | 4be0d720517e70920c7b716f95babc63df1f4ffa | lep | 2018-12-31 14:50:05 |
Added missing new tests | c5c6dab555bec81e6a7b419ea88d195836b3762f | lep | 2018-12-30 18:40:02 |
A bit better error message for wrong typed array index | ca37eb28822952a4ab3e58488b710317691d16a9 | lep | 2018-12-23 12:01:18 |
Also add git version to release build | 2762d5e5f011aff820bbbbe87ae96f84f006c150 | lep | 2018-12-22 23:54:23 |
Pass cflags to release build | 06b251bf0d4871df3e984aeac3e81e1bd03a5912 | lep | 2018-12-22 22:59:02 |
For release build make amalgation | 700190b5d66996bdec2a7916faed1f85e799e308 | lep | 2018-12-22 20:22:06 |
Power of 2 hashing | 065325daf390f5217310cbd5f19989a774af56c0 | lep | 2018-12-22 19:45:21 |
File | Lines added | Lines deleted |
---|---|---|
funcdecl.c | 2 | 0 |
funcdecl.h | 4 | 1 |
grammar.y | 6 | 0 |
tests/should-fail/native-as-code.j | 5 | 0 |
File funcdecl.c changed (mode: 100644) (index e2d0c0f..88a7c9f) | |||
... | ... | struct funcdecl *newfuncdecl() | |
8 | 8 | fd->name = NULL; | fd->name = NULL; |
9 | 9 | fd->p = NULL; | fd->p = NULL; |
10 | 10 | fd->ret = NULL; | fd->ret = NULL; |
11 | fd->isnative = false; | ||
12 | fd->isconst = false; | ||
11 | 13 | return fd; | return fd; |
12 | 14 | } | } |
File funcdecl.h changed (mode: 100644) (index 99ca506..f409be6) | |||
1 | 1 | #ifndef FUNCDECL_H | #ifndef FUNCDECL_H |
2 | 2 | #define FUNCDECL_H | #define FUNCDECL_H |
3 | 3 | ||
4 | #include <stdbool.h> | ||
5 | |||
4 | 6 | #include "typeandname.h" | #include "typeandname.h" |
5 | 7 | #include "paramlist.h" | #include "paramlist.h" |
6 | 8 | ||
7 | 9 | struct funcdecl { | struct funcdecl { |
8 | 10 | char *name; | char *name; |
9 | int isconst; | ||
11 | bool isconst; | ||
12 | bool isnative; | ||
10 | 13 | struct paramlist *p; | struct paramlist *p; |
11 | 14 | const struct typenode *ret; | const struct typenode *ret; |
12 | 15 | }; | }; |
File grammar.y changed (mode: 100644) (index ad48c44..d468d76) | |||
... | ... | expr: intexpr { $$.ty = gInteger; } | |
186 | 186 | snprintf(ebuf, 1024, "Function %s must not take any arguments when used as code", $2.str); | snprintf(ebuf, 1024, "Function %s must not take any arguments when used as code", $2.str); |
187 | 187 | yyerrorex(semanticerror, ebuf); | yyerrorex(semanticerror, ebuf); |
188 | 188 | } | } |
189 | if( fd->isnative ) { | ||
190 | char ebuf[1024]; | ||
191 | snprintf(ebuf, 1024, "Cannot use native '%s' as code", $2.str); | ||
192 | yyerrorline(runtimeerror, islinebreak ? lineno - 1 : lineno, ebuf); | ||
193 | } | ||
189 | 194 | if( fd->ret == gBoolean) { | if( fd->ret == gBoolean) { |
190 | 195 | $$.ty = gCodeReturnsBoolean; | $$.ty = gCodeReturnsBoolean; |
191 | 196 | } else { | } else { |
... | ... | nativefuncdecl: NATIVE rid TAKES optparam_list RETURNS opttype | |
345 | 350 | $$.fd->p = $4.pl; | $$.fd->p = $4.pl; |
346 | 351 | $$.fd->ret = $6.ty; | $$.fd->ret = $6.ty; |
347 | 352 | $$.fd->isconst = isconstant; | $$.fd->isconst = isconstant; |
353 | $$.fd->isnative = true; | ||
348 | 354 | ||
349 | 355 | put(&functions, $$.fd->name, $$.fd); | put(&functions, $$.fd->name, $$.fd); |
350 | 356 |
File tests/should-fail/native-as-code.j added (mode: 100644) (index 0000000..81974dd) | |||
1 | native TriggerSyncStart takes nothing returns nothing | ||
2 | |||
3 | function foo takes nothing returns nothing | ||
4 | local code bla = function TriggerSyncStart | ||
5 | endfunction |