Skip to content

Commit

Permalink
fix#314-2 rename&change EXCLAMATION_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
okamura10 committed Feb 13, 2024
1 parent 64d3971 commit 90b4109
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/vm/dumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static BOOL dump_data_atom(LmnPortRef port, LmnAtomRef data, LmnLinkAttr attr) {
break;
case LMN_HL_ATTR: {
char buf[18];
port_put_raw_s(port, EXCLAMATION_NAME);
port_put_raw_s(port, "!");// port_put_raw_s(port, HYPERLINK_NAME);
if (lmn_env.show_hyperlink) {
// sprintf(buf, "H%lx",
sprintf(buf, "H%lu",
Expand Down
2 changes: 1 addition & 1 deletion src/vm/functor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct PredefinedFunctor predefined_functors[] = {
{LMN_FALSE_FUNCTOR, FALSE, FALSE_ATOM_NAME, 1},
/* hyperlinkは第二引数にHyperLink構造体へのポインタを埋め込むため二引数として登録する
*/
{LMN_EXCLAMATION_FUNCTOR, FALSE, EXCLAMATION_NAME, 2},
{LMN_EXCLAMATION_FUNCTOR, FALSE, HYPERLINK_NAME, 2},
#ifdef USE_FIRSTCLASS_RULE
{LMN_COLON_MINUS_FUNCTOR, FALSE, COLON_MINUS_ATOM_NAME, 3},
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/vm/functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ extern LmnFunctorTable *lmn_functor_table;
#define MEM_EQ_ATOM_NAME "mem_eq"
#define TRUE_ATOM_NAME "true"
#define FALSE_ATOM_NAME "false"
#define EXCLAMATION_NAME "!"
#define HYPERLINK_NAME "!jRmVnNw.8xo[muc#qX" //通常atom名として使用されないようなランダム文字列

#define LMN_IN_PROXY_FUNCTOR 0
#define LMN_OUT_PROXY_FUNCTOR 1
Expand Down
8 changes: 4 additions & 4 deletions src/vm/membrane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ void move_symbol_atom_to_atom_tail(LmnSymbolAtomRef a, LmnSymbolAtomRef a1,
a->set_next(a1);
}

void mem_push_symbol_atom(LmnMembraneRef mem, LmnSymbolAtomRef atom, bool no_check_hyperlink) {
void mem_push_symbol_atom(LmnMembraneRef mem, LmnSymbolAtomRef atom) {
AtomListEntry *as;
LmnFunctor f = atom->get_functor();

Expand Down Expand Up @@ -352,7 +352,7 @@ void mem_push_symbol_atom(LmnMembraneRef mem, LmnSymbolAtomRef atom, bool no_che

if (LMN_IS_PROXY_FUNCTOR(f)) {
LMN_PROXY_SET_MEM(atom, mem);
} else if (LMN_FUNC_IS_HL(f) && !no_check_hyperlink) {
} else if (LMN_FUNC_IS_HL(f)) {
LMN_HL_MEM(lmn_hyperlink_at_to_hl(atom)) = mem;
mem->symb_atom_inc();
} else if (f != LMN_UNIFY_FUNCTOR) {
Expand Down Expand Up @@ -4105,11 +4105,11 @@ void lmn_mem_delete_atom(LmnMembraneRef mem, LmnAtomRef atom,
lmn_free_atom(atom, attr);
}

void lmn_mem_push_atom(LmnMembraneRef mem, LmnAtomRef atom, LmnLinkAttr attr, bool no_check_hyperlink) {
void lmn_mem_push_atom(LmnMembraneRef mem, LmnAtomRef atom, LmnLinkAttr attr) {
if (LMN_ATTR_IS_DATA_WITHOUT_EX(attr)) {
mem->data_atom_inc();
} else { /* symbol atom */
mem_push_symbol_atom(mem, (LmnSymbolAtomRef)atom, no_check_hyperlink);
mem_push_symbol_atom(mem, (LmnSymbolAtomRef)atom);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/vm/membrane.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ LmnRuleSetRef lmn_mem_get_ruleset(LmnMembraneRef m, int i);

void lmn_mem_rulesets_destroy(const std::vector<LmnRuleSet *> &rulesets);
void lmn_mem_rulesets_destroy(Vector *rulesets);
void mem_push_symbol_atom(LmnMembraneRef mem, LmnSymbolAtomRef atom, bool no_check_hyperlink = false);
void mem_push_symbol_atom(LmnMembraneRef mem, LmnSymbolAtomRef atom);
void lmn_mem_add_ruleset_sort(std::vector<LmnRuleSet *> *rulesets, LmnRuleSetRef ruleset);


Expand Down Expand Up @@ -181,7 +181,7 @@ void mem_remove_symbol_atom_with_buddy_data(LmnMembraneRef mem,
LmnSymbolAtomRef atom);
void lmn_mem_remove_atom(LmnMembraneRef mem, LmnAtomRef atom, LmnLinkAttr attr);
void lmn_mem_delete_atom(LmnMembraneRef mem, LmnAtomRef atom, LmnLinkAttr attr);
void lmn_mem_push_atom(LmnMembraneRef mem, LmnAtomRef atom, LmnLinkAttr attr, bool no_check_hyperlink = false);
void lmn_mem_push_atom(LmnMembraneRef mem, LmnAtomRef atom, LmnLinkAttr attr);
void alter_functor(LmnMembraneRef mem, LmnSymbolAtomRef atom, LmnFunctor f);
void lmn_mem_add_ruleset(LmnMembraneRef mem, LmnRuleSetRef ruleset);
void newlink_symbol_and_something(LmnSymbolAtomRef atom0, int pos,
Expand Down
4 changes: 2 additions & 2 deletions src/vm/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ bool slim::vm::interpreter::exec_command(LmnReactCxt *rc, LmnRuleRef rule,
}
#endif
}
lmn_mem_push_atom((LmnMembraneRef)rc->wt(memi), (LmnAtomRef)ap, attr, true);
lmn_mem_push_atom((LmnMembraneRef)rc->wt(memi), (LmnAtomRef)ap, attr);
rc->reg(atomi) = {(LmnWord)ap, attr, TT_ATOM};
break;
}
Expand Down Expand Up @@ -2796,7 +2796,7 @@ bool slim::vm::interpreter::exec_command(LmnReactCxt *rc, LmnRuleRef rule,
}
case LMN_HL_ATTR: {
char buf[16];
port_put_raw_s(port, EXCLAMATION_NAME);
port_put_raw_s(port, HYPERLINK_NAME);
sprintf(buf, "%lx",
LMN_HL_ID(LMN_HL_ATOM_ROOT_HL(
(LmnSymbolAtomRef)rc->wt(srcvec->get(0)))));
Expand Down

0 comments on commit 90b4109

Please sign in to comment.