diff options
| author | 2026-10-14 09:39:22 +0000 | |
|---|---|---|
| committer | 2026-10-14 09:39:22 +0000 | |
| commit | 6bb3d79cbd853601623095b497a1807489c3ef6e (patch) | |
| tree | 188bc9ceb6d6db1670427f4355529eb8d46d1494 /tests/test.sh | |
| parent | todo: record the reverted unchecked trial and what it showed (diff) | |
add c-style typedef and a built-in string alias
typedef T name; binds name to the type record of T, at the top level or
in a function (scoped to its block). string is a built-in alias for char*.
A type name straight before , or ) in a parameter list is the parameter's
name, so fn f(string) still works. The language server shows typedef T
name; on hover and highlights typedef as a keyword.
Diffstat (limited to 'tests/test.sh')
| -rwxr-xr-x | tests/test.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/test.sh b/tests/test.sh index 46625a6..df6417f 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -106,6 +106,7 @@ run(){ # $1 = vm command, $2 = label chk "$($vm < tests/programs/meta.zc | tr '\n' '/')" "1024 19/unless ok/rrr/15 42/7/42/7/144/" "$l parse words, quote, eval, load, operator tables" chk "$($vm < tests/programs/misc.zc | tr '\n' '/')" "45/54321/ok/" "$l compile-time eval, patched mnemonics, unchecked" chk "$($vm < tests/programs/types.zc | tr '\n' '/')" "12 5 2 15 56 42 7 14 3/rect rect* list<int>* list<T>*.u(int) T(list<T>*) fn(word.d)/a:point@0 b:point@2 tag:int@4 /point 1 1/" "$l types, generics, reflection" + chk "$($vm < tests/programs/typedef.zc | tr '\n' '/')" "7 1 42 5 30/13 4 19 4/4 3 3 12/5 11/hihihihellook/8/" "$l typedef, global and local, in every place a type goes, and string" chk "$($vm < tests/programs/typeok.zc)" "14" "$l a program the typechecker accepts" chk "$($vm < tests/programs/typeoff.zc)" "6" "$l the typechecker is off by default" chk "$($vm < tests/programs/enhance.zc)" "100 0 343 3,2 5 -2 0" "$l virtual enhancements" |
