• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BASIC compiler/interpreter for PIC32MX/MZ-80K (suspended)


Commit MetaInfo

Revision152 (tree)
Time2016-08-24 04:04:02
Authorkmorimatsu

Log Message

Execute next_position() macro in nextCodeIs() function.

Change Summary

Incremental Difference

--- mips/branches/zoea/compiler.c (revision 151)
+++ mips/branches/zoea/compiler.c (revision 152)
@@ -78,6 +78,7 @@
7878
7979 int nextCodeIs(char* str){
8080 int len;
81+ next_position();
8182 for(len=0;str[len];len++);
8283 if (!strncmp(g_source+g_srcpos,str,len)) {
8384 if ('A'<=str[len-1] && str[len-1]<='Z') {
--- mips/branches/zoea/debug.c (revision 151)
+++ mips/branches/zoea/debug.c (revision 152)
@@ -139,6 +139,9 @@
139139
140140 static const char bastext[]=
141141 "CLS\n"
142+"WHILE 1\n"
143+" IF J THEN BREAK ELSE J=1\n"
144+" WEND\n"
142145 "\n";
143146
144147 /*
--- mips/branches/zoea/statement.c (revision 151)
+++ mips/branches/zoea/statement.c (revision 152)
@@ -499,7 +499,6 @@
499499 // Check "THEN"
500500 if (!nextCodeIs("THEN")) return ERR_SYNTAX;
501501 // Check if statement follows after THEN statement
502- next_position();
503502 if (nextCodeIs("REM")) {
504503 // If REM statement follows, skip comment words.
505504 rem_statement();
@@ -518,7 +517,6 @@
518517 g_object[g_objpos++]=0x30008000; // nop (see linker)
519518 g_object[g_objpos++]=0x30000000; // nop (see linker)
520519 // Check if statement follows after THEN statement
521- next_position();
522520 if (nextCodeIs("REM")) {
523521 // If REM statement follows, skip comment words.
524522 rem_statement();
@@ -533,7 +531,6 @@
533531 g_object[g_objpos++]=0x30008000; // nop (see linker)
534532 g_object[g_objpos++]=0x30008000; // nop (see linker)
535533 // Check if statement follows after THEN statement
536- next_position();
537534 if (nextCodeIs("REM")) {
538535 // If REM statement follows, skip comment words.
539536 rem_statement();
@@ -730,7 +727,6 @@
730727 err=let_statement();
731728 if (err) return err;
732729 // Check if "TO" exists
733- next_position();
734730 if (!nextCodeIs("TO ")) return ERR_SYNTAX;
735731 err=get_value();
736732 if (err) return err;
@@ -743,7 +739,6 @@
743739 g_object[g_objpos++]=0x0820FFF4; // addiu sp,sp,-12 (see linker)
744740 g_object[g_objpos++]=0xAFA2000C; // sw v0,12(sp)
745741 // Check if "STEP" exists
746- next_position();
747742 g_valueisconst=1;
748743 if (nextCodeIs("STEP ")) {
749744 // "STEP" exists. Get value
@@ -799,7 +794,6 @@
799794 g_object[g_objpos++]=0x0822FFFC;// addiu sp,sp,-4 (see linker)
800795 // label1:
801796 g_object[g_objpos++]=0xAFBF0004;// sw ra,4(sp)
802- next_position();
803797 if (nextCodeIs("WHILE ")) {
804798 // DO WHILE
805799 err=get_floatOrValue();
@@ -827,7 +821,6 @@
827821
828822 char* loop_statement(){
829823 char* err;
830- next_position();
831824 if (nextCodeIs("WHILE ")) {
832825 // LOOP WHILE
833826 err=get_floatOrValue();
@@ -1258,7 +1251,6 @@
12581251 char* statement(void){
12591252 char* err;
12601253 int prevpos;
1261- next_position();
12621254 // Clear flag for temp area usage.
12631255 g_temp_area_used=0;
12641256 // Initialize stack handler used for value