<commit_before>struct _word
{
	char*name;
	char checkCode;
	cell**addr;
	struct _word * next;
};
typedef struct _word word;

//
#define	CMDSTR_LEN	1024
char cmdstr[CMDSTR_LEN];
cell*tmpList[CMDSTR_LEN/4];
cell** tmpLp=tmpList;

word *immeDictHead=NULL, *codeDictHead=NULL, *colonDictHead=NULL;

char computeCheckCode(char*s)
{
	char code=0;
	while (*s)
		code^=*s++;
	return *(--s)+code;
}

word * creatWord(char*s, cell** addr)
{
	word *w=(word*)malloc(sizeof(word));
	w->checkCode=computeCheckCode(s);
	w->name=s;
	w->addr=addr;
	return w;
}

void immediate(char*s, cell** addr)
{
	word *w=creatWord(s,addr);
	w->next=immeDictHead;
	immeDictHead=w;
}

cell** code(char*s, cell** addr)
{
	word *w=creatWord(s,addr);
	w->next=codeDictHead;
	codeDictHead=w;
	return w->addr;
}

#define wordNeck_len	5
char*word_call_addr;
//char*wordNeck;
void colon(char*s, cell** addr)
{
	word *w=(word*)malloc(sizeof(word));
	w->checkCode=computeCheckCode(s);

	w->name=(char*)malloc(strlen(s)+1);
	strcpy(w->name,s);

	cell n=(cell)tmpLp-(cell)tmpList;
	w->addr=(cell**)malloc(wordNeck_len+n);

	//jmp to label call
	char*charP=(char*)w->addr; 
	*charP=0xE9;
	//compute jump adrress
	*(int*)(charP+1)=(int)word_call_addr - wordNeck_len - (int)(w->addr);

//	memcpy(w->addr, wordNeck, wordNeck_len);
	memcpy((charP+wordNeck_len), addr, n);

	
	w->next=colonDictHead;
	colonDictHead=w;
}

#define	IF_ELSE		*(++XP)=(cell)tmpLp++;

void _if()	{TMPLP_NEXT(zbranchh);	IF_ELSE;}
void _endif()	{*(cell*)*XP=tmpLp-(cell**)*XP;	XP--;}
void _else()
{
	TMPLP_NEXT(branchh);
	tmpLp++; _endif();
	tmpLp--; IF_ELSE;
}

void _switch()	{*(++RP)=0; TMPLP_NEXT(torr);}
void _case()	{(*RP)++;TMPLP_NEXT(casee);IF_ELSE;}
void _ends()
{
	*(tmpLp)=(cell*)droprr;
	for(;(*RP)>0;(*RP)--)
		_endif();
	RP--;tmpLp++;
}<commit_msg>修改switch<commit_after>struct _word
{
	char*name;
	char checkCode;
	cell**addr;
	struct _word * next;
};
typedef struct _word word;

//
#define	CMDSTR_LEN	1024
char cmdstr[CMDSTR_LEN];
cell*tmpList[CMDSTR_LEN/4];
cell** tmpLp=tmpList;

word *immeDictHead=NULL, *codeDictHead=NULL, *colonDictHead=NULL;

char computeCheckCode(char*s)
{
	char code=0;
	while (*s)
		code^=*s++;
	return *(--s)+code;
}

word * creatWord(char*s, cell** addr)
{
	word *w=(word*)malloc(sizeof(word));
	w->checkCode=computeCheckCode(s);
	w->name=s;
	w->addr=addr;
	return w;
}

void immediate(char*s, cell** addr)
{
	word *w=creatWord(s,addr);
	w->next=immeDictHead;
	immeDictHead=w;
}

cell** code(char*s, cell** addr)
{
	word *w=creatWord(s,addr);
	w->next=codeDictHead;
	codeDictHead=w;
	return w->addr;
}

#define wordNeck_len	5
char*word_call_addr;
//char*wordNeck;
void colon(char*s, cell** addr)
{
	word *w=(word*)malloc(sizeof(word));
	w->checkCode=computeCheckCode(s);

	w->name=(char*)malloc(strlen(s)+1);
	strcpy(w->name,s);

	cell n=(cell)tmpLp-(cell)tmpList;
	w->addr=(cell**)malloc(wordNeck_len+n);

	//jmp to label call
	char*charP=(char*)w->addr; 
	*charP=0xE9;
	//compute jump adrress
	*(int*)(charP+1)=(int)word_call_addr - wordNeck_len - (int)(w->addr);

//	memcpy(w->addr, wordNeck, wordNeck_len);
	memcpy((charP+wordNeck_len), addr, n);

	
	w->next=colonDictHead;
	colonDictHead=w;
}

#define	IF_ELSE		*(++XP)=(cell)tmpLp++;

void _if()	{TMPLP_NEXT(zbranchh);	IF_ELSE;}
void _endif()	{*(cell*)*XP=tmpLp-(cell**)*XP;	XP--;}
void _else()
{
	TMPLP_NEXT(branchh);
	tmpLp++; _endif();
	tmpLp--; IF_ELSE;
}

void _switch()	{*(++RP)=0;}
void _case()	{(*RP)++;TMPLP_NEXT(casee);IF_ELSE;}
void _ends()
{
	for(;(*RP)>0;(*RP)--)
		_endif();
	RP--;
}
void _while()	{}
{'fraction_non_alphanumeric': 0.21418479796552697, 'fraction_numerical': 0.00734670810963549, 'mean_word_length': 5.982248520710059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '427071', 'n_tokens_mistral': 1626, 'n_tokens_neox': 1588, 'n_words': 262}