Add nulls, and more newdecl and type system features.

New null_t type has a constant "null", which can be assigned to objects.
Methodmaps can now be "nullable", accepting null_t types.
The delete keyword now zaps non-const lvalue inputs.
Fixed some newdecl arguments not accepting references.
Allow functag matching to coerce arguments and return values.
Allow functags to accept new-style types as a return value.
This commit is contained in:
David Anderson
2014-07-05 13:20:06 -07:00
parent 96bbd4d7e0
commit 9ff38bcf80
7 changed files with 161 additions and 34 deletions
+5
View File
@@ -411,6 +411,8 @@ enum {
tMETHODMAP,
tNATIVE,
tNEW,
tNULL,
tNULLABLE,
tOBJECT,
tOPERATOR,
tPUBLIC,
@@ -675,6 +677,7 @@ SC_FUNC cell array_totalsize(symbol *sym);
SC_FUNC int matchtag_string(int ident, int tag);
SC_FUNC int checktag_string(value *sym1, value *sym2);
SC_FUNC int checktags_string(int tags[], int numtags, value *sym1);
SC_FUNC int lvalexpr(svalue *sval);
/* function prototypes in SC4.C */
SC_FUNC void writeleader(symbol *root);
@@ -699,6 +702,7 @@ SC_FUNC void copyarray(symbol *sym,cell size);
SC_FUNC void fillarray(symbol *sym,cell size,cell value);
SC_FUNC void ldconst(cell val,regid reg);
SC_FUNC void moveto1(void);
SC_FUNC void move_alt(void);
SC_FUNC void pushreg(regid reg);
SC_FUNC void pushval(cell val);
SC_FUNC void popreg(regid reg);
@@ -923,6 +927,7 @@ SC_VDECL int pc_tag_string; /* global String tag */
SC_VDECL int pc_tag_void; /* global void tag */
SC_VDECL int pc_tag_object; /* root object tag */
SC_VDECL int pc_tag_bool; /* global bool tag */
SC_VDECL int pc_tag_null_t; /* the null type */
SC_VDECL int pc_anytag; /* global any tag */
SC_VDECL int glbstringread; /* last global string read */
SC_VDECL int sc_require_newdecls; /* only newdecls are allowed */