Skip to content

Commit

Permalink
rename APPENDDEF -> APPEND_RUNTIME_DIC
Browse files Browse the repository at this point in the history
temporary dic name = _RUNTIME_DIC_
  • Loading branch information
ponapalt committed Oct 8, 2021
1 parent dd3f85b commit f15334f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions parser0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ int CParser0::DynamicLoadDictionary(const yaya::string_t& dicfilename, int chars


/* -----------------------------------------------------------------------
* 関数名 : CParser0::DynamicAppendDefines
* 機能概要: APPENDDEFの実装本体
* 関数名 : CParser0::DynamicAppendRuntimeDictionary
* 機能概要: APPEND_RUNTIME_DICの実装本体
*
* 返値  : 0=正常 1=文法エラー
* -----------------------------------------------------------------------
*/
int CParser0::DynamicAppendDefines(const yaya::string_t& codes)
int CParser0::DynamicAppendRuntimeDictionary(const yaya::string_t& codes)
{
vm.func_parse_new();

Expand All @@ -210,17 +210,17 @@ int CParser0::DynamicAppendDefines(const yaya::string_t& codes)
// {、}、;で分割
SeparateFactor(factors, yaya::string_t(codes));
// 分割された文字列を解析して関数を作成し、内部のステートメントを蓄積していく
if(DefineFunctions(factors, L"_DIC_RUNTIME_DEF_", 0, depth, targetfunction)) {
if(DefineFunctions(factors, L"_RUNTIME_DIC_", 0, depth, targetfunction)) {
isnoterror = 0;
}
if( depth != 0 ) {
vm.logger().Error(E_E, 94, L"_DIC_RUNTIME_DEF_", -1);
vm.logger().Error(E_E, 94, L"APPEND_RUNTIME_DIC", -1);
isnoterror = 0;
}
}

if(isnoterror) {
isnoterror &= !ParseAfterLoad(L"_DIC_RUNTIME_DEF_");
isnoterror &= !ParseAfterLoad(L"_RUNTIME_DIC_");
}

if(isnoterror) { //success
Expand Down
2 changes: 1 addition & 1 deletion parser0.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CParser0
char ParseEmbedString(yaya::string_t& str, CStatement &st, const yaya::string_t &dicfilename, int linecount);

int DynamicLoadDictionary(const yaya::string_t& dicfilename, int charset);
int DynamicAppendDefines(const yaya::string_t& codes);
int DynamicAppendRuntimeDictionary(const yaya::string_t& codes);
int DynamicUnloadDictionary(const yaya::string_t& dicfilename);
int DynamicUndefFunc(const yaya::string_t& funcname);

Expand Down
20 changes: 10 additions & 10 deletions sysfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static const wchar_t sysfunc[SYSFUNC_NUM][32] = {
L"SETTAMAHWND",
L"ISGLOBALDEFINE",
L"SETGLOBALDEFINE",
L"APPENDDEF",
L"APPEND_RUNTIME_DIC",
};

//このグローバル変数はマルチインスタンスでも共通
Expand Down Expand Up @@ -729,7 +729,7 @@ CValue CSystemFunction::Execute(int index, const CValue &arg, const std::vector<
case 148:
return SETGLOBALDEFINE(arg, d, l);
case 149:
return APPENDDEF(arg, d, l);
return APPEND_RUNTIME_DIC(arg, d, l);
default:
vm.logger().Error(E_E, 49, d, l);
return CValue(F_TAG_NOP, 0/*dmy*/);
Expand Down Expand Up @@ -3326,27 +3326,27 @@ CValue CSystemFunction::ISGLOBALDEFINE(const CValue &arg, yaya::string_t &d, int
}

/* -----------------------------------------------------------------------
* 関数名 : CSystemFunction::APPENDDEF
* 引数  : _argv[0] = define(s)
* 関数名 : CSystemFunction::APPEND_RUNTIME_DIC
* 引数  : _argv[0] = temporary dictionary text
* -----------------------------------------------------------------------
*/
CValue CSystemFunction::APPENDDEF(const CValue &arg, yaya::string_t &d, int &l)
CValue CSystemFunction::APPEND_RUNTIME_DIC(const CValue &arg, yaya::string_t &d, int &l)
{
if(!arg.array_size()) {
vm.logger().Error(E_W, 8, L"APPENDDEF", d, l);
vm.logger().Error(E_W, 8, L"APPEND_RUNTIME_DIC", d, l);
SetError(8);
return CValue(-1);
}

if(!arg.array()[0].IsString()) {
vm.logger().Error(E_W, 9, L"APPENDDEF", d, l);
vm.logger().Error(E_W, 9, L"APPEND_RUNTIME_DIC", d, l);
SetError(9);
return CValue(-1);
}

yaya::string_t def = arg.array()[0].s_value;

int err = vm.parser0().DynamicAppendDefines(def);
int err = vm.parser0().DynamicAppendRuntimeDictionary(def);

return CValue(err ? -1 : 0);
}
Expand Down Expand Up @@ -3379,15 +3379,15 @@ CValue CSystemFunction::SETGLOBALDEFINE(const CValue &arg, yaya::string_t &d, in
while (itg != gdefines.end()) {
if( itg->before == defname ) {
itg->after=defbody;
itg->dicfilename=L"_DIC_RUNTIME_DEF_";
itg->dicfilename=L"_RUNTIME_DIC_";
return CValue(1);
}
else {
++itg;
}
}

gdefines.push_back(CDefine(defname, defbody, L"_DIC_RUNTIME_DEF_"));
gdefines.push_back(CDefine(defname, defbody, L"_RUNTIME_DIC_"));
return CValue(0);
}

Expand Down
2 changes: 1 addition & 1 deletion sysfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class CSystemFunction
CValue DICUNLOAD(const CValue &arg, yaya::string_t &d, int &l);

CValue UNDEFFUNC(const CValue &arg, yaya::string_t &, int &);
CValue APPENDDEF(const CValue& arg, yaya::string_t& d, int& l);
CValue APPEND_RUNTIME_DIC(const CValue& arg, yaya::string_t& d, int& l);
CValue UNDEFGLOBALDEFINE(const CValue &arg, yaya::string_t &, int &);

CValue ISGLOBALDEFINE(const CValue& arg, yaya::string_t& d, int& l);
Expand Down

0 comments on commit f15334f

Please sign in to comment.