summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-02-05 19:49:35 +0000
committerOmar Rizwan <omar@omar.website>2023-02-05 19:49:35 +0000
commit6e0dcf02a5b29870f56d0abcdda3cdcf12e4fdfa (patch)
tree8530279a57cdc284ce80864becc7e00e0d73631c /lib
parentc-statements: WIP checkpoint on statement removal (diff)
downloadfolk-6e0dcf02a5b29870f56d0abcdda3cdcf12e4fdfa.tar.gz
folk-6e0dcf02a5b29870f56d0abcdda3cdcf12e4fdfa.zip
c-statements: Use semi-opaque stmt & match handles, not bare indices
I want the extra bit of type safety to help me debug with-all. Also fixes up cffi/tcl array support a bit
Diffstat (limited to 'lib')
-rw-r--r--lib/c.tcl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/c.tcl b/lib/c.tcl
index 039e6d25..9e155502 100644
--- a/lib/c.tcl
+++ b/lib/c.tcl
@@ -241,15 +241,16 @@ namespace eval c {
}]
variable argtypes
- set argscripts [list] ;# TODO: return a dictionary
+ set argscripts [list {$argtype $argname;}]
foreach {fieldtype fieldname} $fields {
lappend argscripts [csubst {
Tcl_Obj* obj_$fieldname;
Tcl_DictObjGet(interp, \$obj, Tcl_ObjPrintf("%s", "$fieldname"), &obj_$fieldname);
}]
- lappend argscripts [arg $fieldtype \$argname.$fieldname obj_$fieldname]
+ lappend argscripts [arg $fieldtype \${argname}_$fieldname obj_$fieldname]
+ lappend argscripts [subst {\$argname.$fieldname = \${argname}_$fieldname;}]
}
- argtype $type [list expr [list [join $argscripts "\n"]]]
+ argtype $type [join $argscripts "\n"]
variable rtypes
rtype $type {