Skip to content

Conversation

@pixelherodev
Copy link
Contributor

No description provided.

/* TODO: Throw error if using explicit import */
if (scas_runtime.options.explicit_import) {
bool imported=false;
list_t *imports=state->object->imports;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces around = operator

result = evaluate_expression(expression, state->equates, &error, &symbol);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trim this whitespace

@ddevault
Copy link
Member

Code looks good to me.

for (int i = 0; i<state.object->unresolved->length; i++) {
unresolved_symbol_t *sym = (unresolved_symbol_t*)state.object->unresolved->items[i];
bool imported = false;
for (int j = 0; j<state.object->imports->length; j++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

< operator needs spaces around it, too. Also >, <=, >=, and !=, and all arithmetic operators.

scas_log(L_INFO, "Returning to file '%s'", (char *)stack_peek(state.file_name_stack));
} else {
for (int i = 0; i<state.object->unresolved->length; i++) {
unresolved_symbol_t *sym = (unresolved_symbol_t*)state.object->unresolved->items[i];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid lines >80 columns. Split it into two lines and indent the second line.

scas_runtime.options.explicit_import = 1;
}
for (int i = 0; i < argc; ++i) {
scas_log(L_INFO, "Importing '%s'",argv[i]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too high of a log level for this message.

case ERROR_DUPLICATE_SYMBOL:
return "Duplicate symbol '%s'";
case ERROR_EXPLICIT_IMPORT:
return "Symbol '%s' not imported";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just reuse ERROR_UNKNOWN_SYMBOL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants