| ... | ... |
@@ -24,6 +24,12 @@ contexts: |
| 24 | 24 |
- match: '\.(\S+)\sPOK' |
| 25 | 25 |
scope: constant.numeric |
| 26 | 26 |
pop: true |
| 27 |
+ - match: '\.(\S+)\sGET2' |
|
| 28 |
+ scope: constant.numeric |
|
| 29 |
+ pop: true |
|
| 30 |
+ - match: '\.(\S+)\sGET' |
|
| 31 |
+ scope: constant.numeric |
|
| 32 |
+ pop: true |
|
| 27 | 33 |
|
| 28 | 34 |
- match: '\.(\S+)\sDEI2' |
| 29 | 35 |
scope: entity.name.type.typedef |
| ... | ... |
@@ -37,6 +43,12 @@ contexts: |
| 37 | 43 |
- match: '\.(\S+)\sPEK' |
| 38 | 44 |
scope: entity.name.type.typedef |
| 39 | 45 |
pop: true |
| 46 |
+ - match: '\.(\S+)\sPUT2' |
|
| 47 |
+ scope: entity.name.type.typedef |
|
| 48 |
+ pop: true |
|
| 49 |
+ - match: '\.(\S+)\sPUT' |
|
| 50 |
+ scope: entity.name.type.typedef |
|
| 51 |
+ pop: true |
|
| 40 | 52 |
|
| 41 | 53 |
# label |
| 42 | 54 |
- match: '\@(\S+)\s?' |
| ... | ... |
@@ -12,7 +12,6 @@ |
| 12 | 12 |
Select paint color for 2-bit mode |
| 13 | 13 |
) |
| 14 | 14 |
|
| 15 |
- |
|
| 16 | 15 |
%RTN { JMP2r }
|
| 17 | 16 |
%STEP8 { #0033 SFT2 }
|
| 18 | 17 |
|
| ... | ... |
@@ -726,7 +725,7 @@ RTN |
| 726 | 725 |
[ 0038 4492 2810 0000 ] ( open ) |
| 727 | 726 |
[ 0000 0082 4438 0000 ] ( closed ) |
| 728 | 727 |
@tool_selector [ 80c0 e0f0 f8e0 1000 ] |
| 729 |
-@tool_hand [ 4040 4070 f8f8 f870 ] |
|
| 728 |
+@tool_hand [ 2020 20b8 7c7c 3838 ] |
|
| 730 | 729 |
@tool_eraser [ 2050 b87c 3e1c 0800 ] |
| 731 | 730 |
@moveup_icn [ 0010 387c fe10 1000 ] |
| 732 | 731 |
@movedown_icn [ 0010 1010 fe7c 3810 ] |
| ... | ... |
@@ -92,9 +92,6 @@ findmacro(char *name) |
| 92 | 92 |
for(i = 0; i < p.mlen; ++i) |
| 93 | 93 |
if(scmp(p.macros[i].name, name, 64)) |
| 94 | 94 |
return &p.macros[i]; |
| 95 |
- for(i = 0; i < p.mlen; ++i) |
|
| 96 |
- if(p.macros[i].name[0] == '%' && ssin(name, p.macros[i].name + 1) != -1) |
|
| 97 |
- return &p.macros[i]; |
|
| 98 | 95 |
return NULL; |
| 99 | 96 |
} |
| 100 | 97 |
|
| ... | ... |
@@ -131,25 +128,10 @@ findopcode(char *s) |
| 131 | 128 |
return 0; |
| 132 | 129 |
} |
| 133 | 130 |
|
| 134 |
-char *template(char *src, char *dst, char *w, Macro *m) |
|
| 135 |
-{
|
|
| 136 |
- char input[64]; |
|
| 137 |
- if(scin(src, '%') == -1) |
|
| 138 |
- return src; |
|
| 139 |
- scpy(w, input, ssin(w, m->name + 1) + 1); |
|
| 140 |
- scpy(src, dst, scin(src, '%') + 1); |
|
| 141 |
- scat(dst, input); |
|
| 142 |
- scat(dst, src + scin(src, '%') + 1); |
|
| 143 |
- return dst; |
|
| 144 |
-} |
|
| 145 |
- |
|
| 146 | 131 |
char * |
| 147 | 132 |
sublabel(char *src, char *scope, char *name) |
| 148 | 133 |
{
|
| 149 |
- scpy(scope, src, 64); |
|
| 150 |
- scpy("/", src + slen(src), 64);
|
|
| 151 |
- scpy(name, src + slen(src), 64); |
|
| 152 |
- return src; |
|
| 134 |
+ return scat(scat(scpy(scope, src, 64), "/"), name); |
|
| 153 | 135 |
} |
| 154 | 136 |
|
| 155 | 137 |
#pragma mark - Parser |
| ... | ... |
@@ -237,9 +219,8 @@ walktoken(char *w) |
| 237 | 219 |
} |
| 238 | 220 |
if((m = findmacro(w))) {
|
| 239 | 221 |
int i, res = 0; |
| 240 |
- char templated[64]; |
|
| 241 | 222 |
for(i = 0; i < m->len; ++i) |
| 242 |
- res += walktoken(template(m->items[i], templated, w, m)); |
|
| 223 |
+ res += walktoken(m->items[i]); |
|
| 243 | 224 |
return res; |
| 244 | 225 |
} |
| 245 | 226 |
return error("Unknown label in first pass", w);
|
| ... | ... |
@@ -286,20 +267,18 @@ parsetoken(char *w) |
| 286 | 267 |
else |
| 287 | 268 |
return 0; |
| 288 | 269 |
return 1; |
| 289 |
- } else if((m = findmacro(w))) {
|
|
| 290 |
- int i; |
|
| 291 |
- for(i = 0; i < m->len; ++i) {
|
|
| 292 |
- char templated[64]; |
|
| 293 |
- if(!parsetoken(template(m->items[i], templated, w, m))) |
|
| 294 |
- return 0; |
|
| 295 |
- } |
|
| 296 |
- return ++m->refs; |
|
| 297 | 270 |
} else if(sihx(w)) {
|
| 298 | 271 |
if(slen(w) == 2) |
| 299 | 272 |
pushbyte(shex(w), 0); |
| 300 | 273 |
else if(slen(w) == 4) |
| 301 | 274 |
pushshort(shex(w), 0); |
| 302 | 275 |
return 1; |
| 276 |
+ } else if((m = findmacro(w))) {
|
|
| 277 |
+ int i; |
|
| 278 |
+ for(i = 0; i < m->len; ++i) |
|
| 279 |
+ if(!parsetoken(m->items[i])) |
|
| 280 |
+ return 0; |
|
| 281 |
+ return ++m->refs; |
|
| 303 | 282 |
} |
| 304 | 283 |
return 0; |
| 305 | 284 |
} |
| ... | ... |
@@ -337,7 +316,7 @@ pass1(FILE *f) |
| 337 | 316 |
int |
| 338 | 317 |
pass2(FILE *f) |
| 339 | 318 |
{
|
| 340 |
- int ccmnt = 0, ctemplate = 0; |
|
| 319 |
+ int ccmnt = 0, cmacr = 0; |
|
| 341 | 320 |
char w[64], scope[64], subw[64]; |
| 342 | 321 |
printf("Pass 2\n");
|
| 343 | 322 |
while(fscanf(f, "%s", w) == 1) {
|
| ... | ... |
@@ -346,7 +325,7 @@ pass2(FILE *f) |
| 346 | 325 |
if(w[0] == '[') continue; |
| 347 | 326 |
if(w[0] == ']') continue; |
| 348 | 327 |
if(skipblock(w, &ccmnt, '(', ')')) continue;
|
| 349 |
- if(skipblock(w, &ctemplate, '{', '}')) continue;
|
|
| 328 |
+ if(skipblock(w, &cmacr, '{', '}')) continue;
|
|
| 350 | 329 |
if(w[0] == '|') {
|
| 351 | 330 |
if(p.length && shex(w + 1) < p.ptr) |
| 352 | 331 |
return error("Memory Overwrite", w);
|