Mercurial > pub > dyncall > dyncall
comparison test/common/mk-cases.lua @ 514:01f928eb9584
- more test code generator code sharing
author | Tassilo Philipp |
---|---|
date | Sun, 10 Apr 2022 16:18:28 +0200 |
parents | 4d0541bf9b38 |
children | 99819b874bac |
comparison
equal
deleted
inserted
replaced
513:95f6f43178ed | 514:01f928eb9584 |
---|---|
1 function trim(s) | |
2 return s:gsub("^%s+",""):gsub("%s+$","") | |
3 end | |
4 | |
1 function mkfuntab(n, prefix, t, array_name, with_cast) | 5 function mkfuntab(n, prefix, t, array_name, with_cast) |
2 local s = { t.." "..array_name.."[] = {\n"} | 6 local s = { t.." "..array_name.."[] = {\n"} |
3 local cast = '' | 7 local cast = '' |
4 if with_cast == true then | 8 if with_cast == true then |
5 cast = '('..t..')' | 9 cast = '('..t..')' |