Implemented drop directive and fibonacci program
This commit is contained in:
parent
bb662f6079
commit
1140b5b140
2 changed files with 26 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ static inline bool isKW(Lz_SB *sb) {
|
|||
|| SBeq(sb, "st8")
|
||||
|| SBeq(sb, "dup")
|
||||
|| SBeq(sb, "swap")
|
||||
|| SBeq(sb, "drop")
|
||||
|| SBeq(sb, "while")
|
||||
|| SBeq(sb, "do")
|
||||
|| SBeq(sb, "if")
|
||||
|
|
@ -261,6 +262,10 @@ codegen:
|
|||
printf(" pushstack 119\n");
|
||||
break;
|
||||
}
|
||||
if (SBeq(&tokenAccumulator, "drop")) {
|
||||
printf(" popstack 118\n");
|
||||
break;
|
||||
}
|
||||
if (SBeq(&tokenAccumulator, "while")) {
|
||||
lz_da_append(labelStack, counter);
|
||||
commentStack(&labelStack);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue