BASIC compiler/interpreter for PIC32MX/MZ-80K (suspended)
| Revision | 141 (tree) |
|---|---|
| Time | 2016-07-24 16:40:51 |
| Author | kmorimatsu |
1) Return code won't be required at the end of file. 2) Avoid double numbering in empty lines.
| @@ -54,8 +54,8 @@ | ||
| 54 | 54 | if (g_fbuff[i]==0x0a || g_fbuff[i]==0x0d) in_string=0; |
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | - // Null charcter at the end | |
| 58 | - g_source[size]=0x00; | |
| 57 | + // Return code at the end | |
| 58 | + g_source[size]=0x0d; | |
| 59 | 59 | // Compile last few lines. |
| 60 | 60 | while(g_srcpos<size-1){ |
| 61 | 61 | err=compile_line(); |
| @@ -105,6 +105,7 @@ | ||
| 105 | 105 | if (b1<0x20) { |
| 106 | 106 | // The end of line. |
| 107 | 107 | // Don't add $s6-setting command. |
| 108 | + if (g_source[g_srcpos]==0x0D && g_source[g_srcpos+1]==0x0A) g_srcpos++; | |
| 108 | 109 | g_srcpos++; |
| 109 | 110 | return 0; |
| 110 | 111 | } else if ('0'<=b1 && b1<='9') { |
| @@ -80,8 +80,8 @@ | ||
| 80 | 80 | // Maintain at least 256 characters in cache. |
| 81 | 81 | if (256<=g_srcpos) read_file(256); |
| 82 | 82 | } |
| 83 | - // Null charcter at the end | |
| 84 | - g_source[g_size]=0x00; | |
| 83 | + // Return code at the end | |
| 84 | + g_source[g_size]=0x0d; | |
| 85 | 85 | // Compile last few lines. |
| 86 | 86 | while(g_srcpos<g_size-1){ |
| 87 | 87 | err=compile_line(); |
| @@ -138,9 +138,10 @@ | ||
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | static const char bastext[]= |
| 141 | -"CLS\n" | |
| 142 | -"for i=1 to 9:print rnd(),:next\n" | |
| 143 | -"\n"; | |
| 141 | +"CLS\r\n" | |
| 142 | +"\r\n" | |
| 143 | +"DATA 100"; | |
| 144 | +//"\r\n"; | |
| 144 | 145 | |
| 145 | 146 | /* |
| 146 | 147 | Test function for constructing assemblies from C codes. |