• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

BASIC compiler/interpreter for PIC32MX/MZ-80K


コミットメタ情報

リビジョン6fd552c51671d35f2ecc1f8969324ec7ed99e3f3 (tree)
日時2019-02-13 05:47:30
作者Katsumi <kmorimatsu@sour...>
コミッターKatsumi

ログメッセージ

Debug CMPTYPE_STATIC_METHOD

変更サマリ

差分

--- a/mips/megalopa/class.c
+++ b/mips/megalopa/class.c
@@ -790,6 +790,7 @@ char* static_method(char type){
790790 // Check class name
791791 i=check_var_name();
792792 if (i<65536) return ERR_SYNTAX;
793+ record[0]=i;
793794 // Check if the class exists
794795 cmpdata_reset();
795796 while(data=cmpdata_find(CMPDATA_CLASS)){
@@ -799,7 +800,6 @@ char* static_method(char type){
799800 break;
800801 }
801802 }
802- record[0]=i;
803803 // Check '::'
804804 if (g_source[g_srcpos]!=':') return ERR_SYNTAX;
805805 g_srcpos++;
@@ -844,7 +844,7 @@ char* static_method(char type){
844844 // label2:
845845 // Register CMPDATA if required.
846846 if (!data) {
847- cmpdata_insert(CMPDATA_UNSOLVED,CMPTYPE_STATIC_METHOD,(int*)record[0],3);
847+ cmpdata_insert(CMPDATA_UNSOLVED,CMPTYPE_STATIC_METHOD,(int*)&record[0],3);
848848 g_allow_shift_obj=0;
849849 }
850850 // Remove stack
--- a/mips/megalopa/debug.c
+++ b/mips/megalopa/debug.c
@@ -32,7 +32,8 @@ const unsigned char _debug_filename[] __attribute__((address(FILENAME_FLASH_ADDR
3232
3333 static const char initext[];
3434 static const char bastext[];
35-static const char classtext[];
35+static const char class1text[];
36+static const char class2text[];
3637
3738 static char* readtext;
3839 static int filepos;
@@ -130,10 +131,12 @@ FSFILE* FSfopen(const char * fileName, const char *mode){
130131 // INI file
131132 readtext=(char*)&initext[0];
132133 } else if (fileName[i+1]=='B' && fileName[i+2]=='A' && fileName[i+3]=='S') {
133- // BAS file
134+ // Select BAS file
134135 if (fileName[i-6]=='C' && fileName[i-5]=='L' && fileName[i-4]=='A' &&
135- fileName[i-3]=='S' && fileName[i-2]=='S' && fileName[i-1]=='1') {
136- readtext=(char*)&classtext[0];
136+ fileName[i-3]=='S' && fileName[i-2]=='S') {
137+ if (fileName[i-1]=='1') readtext=(char*)&class1text[0];
138+ else if (fileName[i-1]=='2') readtext=(char*)&class2text[0];
139+ else readtext=(char*)&bastext[0];
137140 } else {
138141 readtext=(char*)&bastext[0];
139142 }
@@ -228,36 +231,29 @@ static const char initext[]=
228231 static const char bastext[]=
229232 "USECLASS CLASS1\n"
230233 "CLS\n"
231-"dim o(95),v(95)\n"
232-"for i=1 to 85\n"
233-" o(i)=new(CLASS1)\n"
234-"next\n"
235-"for i=1 to 100\n"
236-" for j=1 to 85\n"
237-" v(j)=rnd()\n"
238-" o(j).T1=v(j)\n"
239-" next\n"
240-" for j=86 to 95\n"
241-" o(j)=new(CLASS1)\n"
242-" next\n"
243-" for j=86 to 95\n"
244-" DELETE o(j)\n"
245-" next\n"
246-" for j=1 to 85\n"
247-" if v(j)!=o(j).T1 then print \"ERR\":end\n"
248-" next\n"
249-"next\n"
250-"print \"OK\"\n"
251-"\n"
234+"a=new(CLASS1)"
235+"print a.T1()\n"
252236 "\n"
253237 "\n"
254238 "\n";
255239
240+static const char class1text[]=
241+"useclass CLASS2\n"
242+"field private T2\n"
243+"method INIT\n"
244+" T2=new(CLASS2)\n"
245+" return\n"
246+"METHOD T1\n"
247+" return T2.T1()\n"
248+"method T3\n"
249+" return 456\n"
250+"\n"
251+"\n";
256252
257-static const char classtext[]=
258-"FIELD T1,T2\n"
259-"METHOD T3\n"
260-" return 123\n"
253+static const char class2text[]=
254+"useclass CLASS1\n"
255+"method T1\n"
256+" return CLASS1::T3()\n"
261257 "\n"
262258 "\n"
263259 "\n"