Skip to content

Commit

Permalink
modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhengli Wang committed Oct 1, 2023
1 parent cdb7c74 commit f7be914
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"files.associations": {
"instructionlist.h": "c",
"cstdio": "c",
"cwchar": "c"
"cwchar": "c",
"instructions.h": "c"
},
"C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools"
}
2 changes: 1 addition & 1 deletion src/modules/instructions/instructions.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "instructions.h"

InstructionType instructionChar(const char instruction)
inline InstructionType instructionChar(const char instruction)
{
switch(instruction)
{
Expand Down
5 changes: 5 additions & 0 deletions src/modules/translating/translating.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ char * action(InstructionType type, size_t repeatCount)
case OUTPUT:
snprintf(buffer, CODELINE_BUF_SIZE, "putchar(*ptr);");
break;
case INPUT:
snprintf(buffer, CODELINE_BUF_SIZE, "getchar(ptr);");
break;
case CONDITIONAL_START:
snprintf(buffer, CODELINE_BUF_SIZE, "while(*ptr){");
break;
case CONDITIONAL_END:
snprintf(buffer, CODELINE_BUF_SIZE, "}");
break;
default:
break;
}
return buffer;
}
1 change: 1 addition & 0 deletions tests/testInstructionList.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "../src/modules/instructionList/instructionList.h"
#include "../src/modules/instructions/instructions.h"
int main(void)
{
InstructionList * testInstructionList = newInstructionList();
Expand Down

0 comments on commit f7be914

Please sign in to comment.