Skip to content

Commit

Permalink
Fix .default for constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed Jul 6, 2024
1 parent c47278c commit fc119b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ void Assembler::parse(Symbol file_name) {
Target::clear_current_target();
}

void Assembler::parse_assignment(Visibility visibility, const Token& name) {
void Assembler::parse_assignment(Visibility visibility, const Token& name, bool default_only) {
auto value = ExpressionParser(tokenizer).parse();
object_file->add_constant(std::make_unique<ObjectFile::Constant>(object_file.get(), name, visibility, false, value));
object_file->add_constant(std::make_unique<ObjectFile::Constant>(object_file.get(), name, visibility, default_only, value));
}

void Assembler::parse_cpu() {
Expand Down Expand Up @@ -483,7 +483,7 @@ void Assembler::set_target(const Target* new_target) {
void Assembler::parse_name(Visibility visibility, const Token& name, bool default_only) {
auto token = tokenizer.next();
if (token == Token::equals) {
parse_assignment(visibility, name);
parse_assignment(visibility, name, default_only);
return;
}
else if (token == Token::paren_open) {
Expand Down
2 changes: 1 addition & 1 deletion src/Assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Assembler {
};

void parse(Symbol file_name);
void parse_assignment(Visibility visibility, const Token& name);
void parse_assignment(Visibility visibility, const Token& name, bool default_only = false);
void parse_cpu();
void parse_default();
void parse_default_string_encoding();
Expand Down

0 comments on commit fc119b0

Please sign in to comment.