-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shin-asm: fix parsing of instruction block and instruction args
- stop parsing instruction list when expr can no longer be parsed - allow labels only at the start of the instruction block
- Loading branch information
Showing
4 changed files
with
130 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
SOURCE_FILE | ||
WHITESPACE " " | ||
INSTRUCTIONS_BLOCK | ||
LABEL | ||
IDENT "choice_set_base" | ||
COLON ":" | ||
WHITESPACE " " | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "u16" | ||
ERROR | ||
COMMA "," | ||
NEWLINE "\n" | ||
WHITESPACE " " | ||
LABEL | ||
IDENT "choice_index" | ||
COLON ":" | ||
WHITESPACE " " | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "u16" | ||
ERROR | ||
COMMA "," | ||
NEWLINE "\n" | ||
WHITESPACE " " | ||
ERROR | ||
ERROR "#" | ||
ERROR | ||
L_BRACK "[" | ||
INSTRUCTIONS_BLOCK | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "cmd" | ||
INSTR_ARG_LIST | ||
PAREN_EXPR | ||
L_PAREN "(" | ||
NAME_REF_EXPR | ||
IDENT "dest" | ||
R_PAREN ")" | ||
ERROR | ||
R_BRACK "]" | ||
NEWLINE "\n" | ||
WHITESPACE " " | ||
LABEL | ||
IDENT "dest" | ||
COLON ":" | ||
WHITESPACE " " | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "MemoryAddress" | ||
ERROR | ||
COMMA "," | ||
NEWLINE "\n" | ||
WHITESPACE " " | ||
LABEL | ||
IDENT "choice_visibility_mask" | ||
COLON ":" | ||
WHITESPACE " " | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "NumberSpec" | ||
ERROR | ||
COMMA "," | ||
NEWLINE "\n" | ||
WHITESPACE " " | ||
LABEL | ||
IDENT "choice_title" | ||
COLON ":" | ||
WHITESPACE " " | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "U16String" | ||
ERROR | ||
COMMA "," | ||
NEWLINE "\n" | ||
WHITESPACE " " | ||
LABEL | ||
IDENT "variants" | ||
COLON ":" | ||
WHITESPACE " " | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "StringArray" | ||
ERROR | ||
COMMA "," | ||
error 28: expected a newline | ||
error 55: expected a newline | ||
error 65: expected an instruction or label | ||
error 66: expected an instruction or label | ||
error 76: expected a newline | ||
error 105: expected a newline | ||
error 149: expected a newline | ||
error 182: expected a newline | ||
error 213: expected a newline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,4 @@ | ||
LABEL_2: | ||
add $1, -1, 14 | ||
jt $v0, { | ||
0 => SNR_0, | ||
1 => SNR_1, | ||
} | ||
LABEL_3: | ||
SELECT 1, 2, $choice, 14, "NCSELECT", [ | ||
"To Be", | ||
"Not to Be", | ||
] | ||
BLOCK_1: | ||
hello | ||
BLOCK_2: | ||
world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
SOURCE_FILE | ||
INSTRUCTIONS_BLOCK | ||
LABEL | ||
IDENT "BLOCK_1" | ||
COLON ":" | ||
NEWLINE "\n" | ||
WHITESPACE " " | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "hello" | ||
NEWLINE "\n" | ||
INSTRUCTIONS_BLOCK | ||
LABEL | ||
IDENT "BLOCK_2" | ||
COLON ":" | ||
NEWLINE "\n" | ||
WHITESPACE " " | ||
INSTRUCTION | ||
INSTRUCTION_NAME | ||
IDENT "world" |