-
Notifications
You must be signed in to change notification settings - Fork 15
Support explicit imports #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
assembler/assembler.c
Outdated
| /* TODO: Throw error if using explicit import */ | ||
| if (scas_runtime.options.explicit_import) { | ||
| bool imported=false; | ||
| list_t *imports=state->object->imports; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces around = operator
assembler/directives.c
Outdated
| result = evaluate_expression(expression, state->equates, &error, &symbol); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trim this whitespace
|
Code looks good to me. |
dcd1063 to
28a1b4d
Compare
| 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++) { |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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]); |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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
No description provided.