* Create a MACRO template entry. */
| 597 | * Create a MACRO template entry. |
| 598 | */ |
| 599 | static Entry makeMacroEntry(const char *macro) |
| 600 | { |
| 601 | Entry entry; |
| 602 | entry.kind = ENTRY_MACRO; |
| 603 | entry.length = 0; |
| 604 | entry.macro = nullptr; |
| 605 | |
| 606 | // Check for built-in macros: |
| 607 | switch (macro[1]) |
| 608 | { |
| 609 | case 'B': |
| 610 | if (strcmp(macro, "$BREAK") == 0) |
| 611 | { |
| 612 | entry.kind = ENTRY_BREAK; |
| 613 | entry.optimize = true; |
| 614 | return entry; |
| 615 | } |
| 616 | break; |
| 617 | case 'b': |
| 618 | if (strcmp(macro, "$bytes") == 0) |
| 619 | { |
| 620 | entry.kind = ENTRY_INSTR_BYTES; |
| 621 | return entry; |
| 622 | } |
| 623 | else if (strcmp(macro, "$break") == 0) |
| 624 | { |
| 625 | entry.kind = ENTRY_BREAK; |
| 626 | return entry; |
| 627 | } |
| 628 | break; |
| 629 | case 'i': |
| 630 | if (strcmp(macro, "$instr") == 0) |
| 631 | { |
| 632 | entry.kind = ENTRY_INSTR; |
| 633 | return entry; |
| 634 | } |
| 635 | break; |
| 636 | case 't': |
| 637 | if (strcmp(macro, "$take") == 0) |
| 638 | { |
| 639 | entry.kind = ENTRY_TAKE; |
| 640 | return entry; |
| 641 | } |
| 642 | break; |
| 643 | default: |
| 644 | break; |
| 645 | } |
| 646 | |
| 647 | // User-define macro: |
| 648 | entry.macro = dupString(macro); |
| 649 | return entry; |
| 650 | } |
| 651 | |
| 652 | /* |
| 653 | * Create a LABEL template entry. |
no test coverage detected