• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine 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


Commit MetaInfo

Revision12c7d76ebddb2f37529ea015d97bd070ac79ddf4 (tree)
Zeit2019-04-01 05:05:01
AutorKatsumi <kmorimatsu@sour...>
CommiterKatsumi

Log Message

OPTION NOLINENUM for Zoea ver 1.2

Ändern Zusammenfassung

Diff

--- a/mips/zoea/compiler.c
+++ b/mips/zoea/compiler.c
@@ -160,8 +160,10 @@ char* compile_line(void){
160160 printstr(resolve_label(g_line));
161161 return ERR_MULTIPLE_LABEL;
162162 }
163- check_obj_space(1);
164- g_object[g_objpos++]=0x34160000|g_line; //ori s6,zero,xxxx;
163+ if (!g_nolinenum) {
164+ check_obj_space(1);
165+ g_object[g_objpos++]=0x34160000|g_line; //ori s6,zero,xxxx;
166+ }
165167 }
166168 while(g_source[g_srcpos]!=0x0D && g_source[g_srcpos]!=0x0A){
167169 err=statement();
--- a/mips/zoea/compiler.h
+++ b/mips/zoea/compiler.h
@@ -213,6 +213,7 @@ extern int g_var_mem[ALLOC_BLOCK_NUM];
213213 extern unsigned short g_var_pointer[ALLOC_BLOCK_NUM];
214214 extern unsigned short g_var_size[ALLOC_BLOCK_NUM];
215215 extern char g_temp_area_used;
216+extern char g_nolinenum;
216217 extern int* g_heap_mem;
217218 extern int g_max_mem;
218219 extern char g_disable_break;
--- a/mips/zoea/debug.c
+++ b/mips/zoea/debug.c
@@ -228,13 +228,13 @@ static const char initext[]=
228228 "#PRINT\n";
229229
230230 static const char bastext[]=
231-"print getdir$()\n"
232-"end\n"
233-"\n"
234-"\n"
235-"\n"
231+"REM 1\n"
232+"REM 2\n"
233+"REM 3\n"
236234 "\n"
235+"CLS\n"
237236 "\n"
237+"LABEL TST:PRINT\n"
238238 "\n";
239239
240240 static const char class1text[]=
--- a/mips/zoea/file.c
+++ b/mips/zoea/file.c
@@ -122,7 +122,10 @@ int compile_and_link_file(char* buff,char* appname){
122122 printchar('\n');
123123 return -1;
124124 }
125-
125+
126+ // Option initialization(s)
127+ g_nolinenum=0;
128+
126129 // Compile the file
127130 err=compile_file();
128131 close_file();
--- a/mips/zoea/globalvars.c
+++ b/mips/zoea/globalvars.c
@@ -55,6 +55,9 @@ unsigned short g_var_size[ALLOC_BLOCK_NUM];
5555 // Flag to use temporary area when compiling
5656 char g_temp_area_used;
5757
58+// Flag to use option nolinenum
59+char g_nolinenum;
60+
5861 // Heap area
5962 int* g_heap_mem;
6063 int g_max_mem;
--- a/mips/zoea/statement.c
+++ b/mips/zoea/statement.c
@@ -1550,6 +1550,24 @@ char* setdir_statement(){
15501550 return 0;
15511551 }
15521552
1553+char* option_statement(){
1554+ while(1){
1555+ next_position();
1556+ if (nextCodeIs("NOLINENUM")) {
1557+ g_nolinenum=1;
1558+ } else {
1559+ return ERR_SYNTAX;
1560+ }
1561+ next_position();
1562+ if (g_source[g_srcpos]==',') {
1563+ g_srcpos++;
1564+ } else {
1565+ break;
1566+ }
1567+ }
1568+ return 0;
1569+}
1570+
15531571 #ifdef __DEBUG
15541572 char* debug_statement(){
15551573 call_lib_code(LIB_DEBUG);
@@ -1698,6 +1716,7 @@ static const void* statement_list[]={
16981716 "CALL ",call_statement,
16991717 "STATIC ",static_statement,
17001718 "SETDIR ",setdir_statement,
1719+ "OPTION ",option_statement,
17011720 // List of additional statements follows
17021721 ADDITIONAL_STATEMENTS
17031722 };
--- a/mips/zoea/varname.c
+++ b/mips/zoea/varname.c
@@ -91,6 +91,7 @@ static const int reserved_var_names[]={
9191 0x000b4321, /*NEXT*/
9292 0x000148f8, /*NEW*/
9393 0x00014a5d, /*NOT*/
94+ 0x38a658d7, /*OPTION*/
9495 0x000152c0, /*PCG*/
9596 0x000cacec, /*PEEK*/
9697 0x3b1c6aea, /*PEEK16*/