Skip to content

Commit

Permalink
Fix parsing macro with explicit visibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed Jan 4, 2024
1 parent e7eede3 commit 47a2150
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
37 changes: 20 additions & 17 deletions examples/utility.s
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,33 @@ add_word address, value {
lda address
adc #<value
sta address
.if value < 256
bcc :+
inc address + 1
:
.else
lda address + 1
adc #>value
sta address + 1
.end
.if value < 256 {
bcc :+
inc address + 1
:
}
.else {
lda address + 1
adc #>value
sta address + 1
}
}

subtract_word address, value {
sec
lda address
sbc #<value
sta address
.if value < 256
bcs :+
dec address + 1
:
.else
lda address + 1
sbc #>value
sta address + 1
.if value < 256 {
bcs :+
dec address + 1
:
}
.else {
lda address + 1
sbc #>value
sta address + 1
}
}

memcpy destination, source, length {
Expand Down
4 changes: 3 additions & 1 deletion src/Assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ void Assembler::parse_directive(const Token& directive) {
else if (name.get_type() != Token::NAME) {
throw ParseException(name, "name expected");
}
parse_name(*visibility, name);
else {
parse_name(*visibility, name);
}
}
else if (directive == token_macro) {
parse_macro(current_visibility);
Expand Down

0 comments on commit 47a2150

Please sign in to comment.