少々削ったソースを貼っておきます
文字列だけモジュール変数をネストしないなら上手くいくような気もします
////////////////////////////////////////////////////////////
// prm_label モジュール
////////////////////////////////////////////////////////////
#module mod_prm_label mem_prm_lab_kind, mem_prm_lab_id, mem_prm_label, mem_prm_label_length
str_result=""
// #module src_one_insn の委譲。メモリ消費多そうなので別にした
#modinit
// 引数labelのID(種類)(int)
// undef -1 void 0 mark 1 call 2 call_ret 3 jump 4 jump_zero 5 jump_not_zero 6 return 7
mem_prm_lab_kind = -1
// prmラベルのID(配列っぽくラベルを管理していて、そこのID)
mem_prm_lab_id = -1
// 普通のラベル形式の引数(setする時、文字数多く確保)(str)
sdim mem_prm_label , 2
mem_prm_label=""
// 普通のラベル形式の引数の長さ。
// 検索時長さを比較してから文字列を比較することで速度アップ
mem_prm_label_length = 0
return
#modfunc set_mem_prm_lab_kind_mod int __p
mem_prm_lab_kind = __p
return
#modcfunc get_mem_prm_lab_kind_name_mod
if mem_prm_lab_kind == -1 : return "undef"
if mem_prm_lab_kind == 0 : return "void"
if mem_prm_lab_kind == 1 : return "mark"
if mem_prm_lab_kind == 2 : return "call"
if mem_prm_lab_kind == 3 : return "call_ret"
if mem_prm_lab_kind == 4 : return "jump"
if mem_prm_lab_kind == 5 : return "jump_zero"
if mem_prm_lab_kind == 6 : return "jump_not_zero"
if mem_prm_lab_kind == 7 : return "return"
return "other"
#modcfunc get_mem_prm_lab_kind_mod
return mem_prm_lab_kind
#modcfunc get_mem_prm_lab_kind_obj
return mem_prm_lab_kind
#modfunc set_mem_prm_lab_id_mod int __p
mem_prm_lab_id = __p
return
#modcfunc get_mem_prm_lab_id_mod
return mem_prm_lab_id
#modfunc set_mem_prm_lab_mod str __p
mem_prm_label = __p
logmes ""+mem_prm_label
str_result=mem_prm_label
mem_prm_label_length = 3
logmes ""+mem_prm_label_length
return
#modfunc set_mem_lab_to_var_mod
str_result=mem_prm_label
return
#modfunc get_mem_prm_lab_mod
return mem_prm_label
#modcfunc get_mem_prm_lab_length_mod
return mem_prm_label_length
#modfunc dump_prm_lab
// logmes "kind : " + mem_prm_lab_kind+ " : " + get_mem_prm_lab_kind_name_mod(thismod)
// logmes "id : " + mem_prm_lab_id
// logmes "val : " + mem_prm_label
// logmes "length : " + mem_prm_lab_length
return
#global
メイン
////////////////////////////////////////////////////////////
// prm_label モジュール
////////////////////////////////////////////////////////////
#include "FILE_mod_prm_label.hsp"
////////////////////////////////////////////////////////////
// src_one_commandモジュール
////////////////////////////////////////////////////////////
#module src_one_command command_insn_no, command_label_no, command_kind, command_insn, command_p_label, command_p_label_kind, command_label, command_label_kind
#deffunc set_max_command int _p
max_command = _p
return
#defcfunc get_max_command
return max_command
#modcfunc get_command_insn_no
return command_insn_no
#modinit int p_no
// そのコマンドのナンバー
command_insn_no = p_no
// ラベルのナンバー
command_label_no = p_no + 1
// そのコマンドの種類 -1:未定義 1:insn 2:insn & p_label
command_insn_kind = -1
// そのpのラベルの種類 -1:未定義 0:labelのobjあるけどlabel定義してない
// 1;labelあり 2:gosub labelとgosub ret labelあり
// 3:labelとgosub label と gosub ret label あり
command_p_label_kind = -1
// そのラベルの種類 -1:未定義 0:labelのobjあるけどlabel定義してない
// 1;labelあり 2:gosub labelとgosub ret labelあり
// 3:labelとgosub label と gosub ret label あり
command_label_kind = -1
// insnモジュールのオブジェクトを入れる。入ってない時は-1
command_insn = -1
// insnのp_labelモジュールのオブジェクトを入れる。入ってない時は-1
command_p_label = -1
// labelモジュールのオブジェクトを入れる。入ってない時は-1
command_label = -1
//if p_no <= max_command{
//make_tmp_one_command( thismod )
//}
return
////////////////////////////////////////////////////////////
// mod_prm_labelの委譲
////////////////////////////////////////////////////////////
#modfunc new_prm_label
newmod command_p_label , mod_prm_label
command_p_label_kind = 2
return
#modfunc set_mem_prm_lab_kind int _p
set_mem_prm_lab_kind_mod command_p_label , _p
return
#modcfunc get_mem_prm_lab_kind_name
return get_mem_prm_lab_kind_name_mod(command_p_label)
#modcfunc get_mem_prm_lab_kind
return get_mem_prm_lab_kind_mod(command_p_label)
#modfunc set_mem_prm_lab_id int _p
set_mem_prm_lab_id_mod command_p_label, _p
return
#modcfunc get_mem_prm_lab_id
return get_mem_prm_lab_id_mod(command_p_label)
#modfunc set_mem_prm_lab str _p
set_mem_prm_lab_mod command_p_label, _p
return
#modfunc get_mem_prm_lab
return get_mem_prm_lab_mod(comand_p_label)
#modcfunc get_mem_prm_lab_length
return get_mem_prm_lab_length_mod(comand_p_label)
#modfunc set_mem_lab_to_var
set_mem_lab_to_var_mod comand_p_label
return
#modfunc dump_p_label
logmes "id : " + command_insn_no
dump_prm_lab comand_p_label
; logmes "kind : " + get_mem_prm_lab_kind(thismod); + " : " + get_mem_prm_lab_kind_name_mod(thismod)
; logmes "val : " + get_mem_prm_lab(thismod)
; logmes "length : " + get_mem_prm_lab_length(thismod)
return
#global
////////////////////////////////////////////////////////////
// debug p label
////////////////////////////////////////////////////////////
#if 1
newmod prg_code_undef_prm , src_one_command , 0
new_prm_label prg_code_undef_prm
set_mem_prm_lab_kind prg_code_undef_prm,0
set_mem_prm_lab prg_code_undef_prm,"abc"
//こんなかんじのgetterが動作しない
//logmes "lab : " + get_mem_prm_lab(prg_code_undef_prm)
dump_p_label prg_code_undef_prm
#endif