os

An operating system
git clone https://erai.gay/code/os/
Log | Files | Refs | README | LICENSE

commit a6732d93abe8cbe83a6c6d8470be88407a3b573f
parent 98b67b03e9f33583654a7a7d47615fca36567904
Author: erai <erai@omiltem.net>
Date:   Mon, 20 Jan 2025 23:09:23 +0000

remove TYPECALL

Diffstat:
Mcc1.om | 9+--------
Mcout.om | 2--
Mnode.om | 1-
Mparse2.om | 4----
4 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/cc1.om b/cc1.om @@ -262,7 +262,7 @@ func mark_expr_used(c: *compiler, d: *decl, n: *node) { return; } else if kind == N_REF || kind == N_DEREF || kind == N_BNOT || kind == N_POS || kind == N_NEG || kind == N_NOT - || kind == N_CAST || kind == N_DOT || kind == N_TYPECALL { + || kind == N_CAST || kind == N_DOT { mark_expr_used(c, d, n.a); return; } else if kind == N_SIZEOF || kind == N_STR || kind == N_NUM @@ -727,9 +727,6 @@ func typecheck_expr(c: *compiler, d: *decl, n: *node, rhs: int) { } n.t = n.a.t.val; - } else if (kind == N_TYPECALL) { - typecheck_expr(c, d, n.a, 0); - n.t = n.a.t; } else if (kind == N_DOT) { typecheck_expr(c, d, n.a, 0); @@ -1388,8 +1385,6 @@ func compile_expr(c: *compiler, d: *decl, n: *node, rhs: int) { } else { unify(c, n.a.t.arg, nil); } - } else if (kind == N_TYPECALL) { - compile_expr(c, d, n.a, 0); } else if (kind == N_DOT) { compile_expr(c, d, n.a, 0); @@ -1616,8 +1611,6 @@ func call_check(c: *compiler, n: *node): int { n = n.b; } result = 1; - } else if n.kind == N_TYPECALL { - result = call_check(c, n.a); } else if n.kind == N_BOR || n.kind == N_BAND { // Side effects okay in both positions result = call_check(c, n.a); diff --git a/cout.om b/cout.om @@ -340,8 +340,6 @@ func ctranslate_expr(c: *compiler, n: *node) { } } fputs(c.cout, ")"); - } else if n.kind == N_TYPECALL { - ctranslate_expr(c, n.a); } else if n.kind == N_DOT { fputs(c.cout, "("); ctranslate_expr(c, n.a); diff --git a/node.om b/node.om @@ -19,7 +19,6 @@ enum { N_STMTLIST, N_EXPRLIST, N_CALL, - N_TYPECALL, N_TYPELIST, N_DOT, N_ARGLIST, diff --git a/parse2.om b/parse2.om @@ -611,10 +611,6 @@ func reconstruct_post(c: *parser, pn: *peg_node): *node { n = reconstruct_type(c, pn.child); ret = mknode(c, N_CAST, ret, n); copypos(ret, pn); - } else if tag == P_type_expr { - n = reconstruct_typeargs(c, pn.child); - ret = mknode(c, N_TYPECALL, ret, n); - copypos(ret, pn); } else { die("invalid post_expr"); }