Compare commits
1 Commits
2bfc16c662
...
149d057403
Author | SHA1 | Date | |
---|---|---|---|
149d057403 |
@ -93,7 +93,6 @@ fn void compile(Arena* arena, Options options)
|
|||||||
.name = options.name,
|
.name = options.name,
|
||||||
.path = options.path,
|
.path = options.path,
|
||||||
.executable = options.executable,
|
.executable = options.executable,
|
||||||
.definitions = options.definitions,
|
|
||||||
.objects = options.objects,
|
.objects = options.objects,
|
||||||
.library_directories = options.library_directories,
|
.library_directories = options.library_directories,
|
||||||
.library_names = options.library_names,
|
.library_names = options.library_names,
|
||||||
@ -110,6 +109,24 @@ fn void compile(Arena* arena, Options options)
|
|||||||
.id = ValueId::infer_or_ignore,
|
.id = ValueId::infer_or_ignore,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
for (auto definition: options.definitions)
|
||||||
|
{
|
||||||
|
auto definition_global = new_global(&module);
|
||||||
|
auto definition_value = new_value(&module);
|
||||||
|
*definition_value = {
|
||||||
|
.string_literal = definition.value,
|
||||||
|
.id = ValueId::string_literal,
|
||||||
|
};
|
||||||
|
*definition_global = Global{
|
||||||
|
.variable = {
|
||||||
|
.initial_value = definition_value,
|
||||||
|
.type = get_slice_type(&module, uint8(&module)),
|
||||||
|
.scope = &module.scope,
|
||||||
|
.name = definition.name,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
parse(&module);
|
parse(&module);
|
||||||
emit(&module);
|
emit(&module);
|
||||||
}
|
}
|
||||||
|
@ -1336,7 +1336,6 @@ struct Module
|
|||||||
String path;
|
String path;
|
||||||
String executable;
|
String executable;
|
||||||
|
|
||||||
Slice<Definition> definitions;
|
|
||||||
Slice<String> objects;
|
Slice<String> objects;
|
||||||
Slice<String> library_directories;
|
Slice<String> library_directories;
|
||||||
Slice<String> library_names;
|
Slice<String> library_names;
|
||||||
|
@ -3167,24 +3167,6 @@ void parse(Module* module)
|
|||||||
{
|
{
|
||||||
auto scope = &module->scope;
|
auto scope = &module->scope;
|
||||||
|
|
||||||
for (auto definition: module->definitions)
|
|
||||||
{
|
|
||||||
auto definition_global = new_global(module);
|
|
||||||
auto definition_value = new_value(module);
|
|
||||||
*definition_value = {
|
|
||||||
.string_literal = definition.value,
|
|
||||||
.id = ValueId::string_literal,
|
|
||||||
};
|
|
||||||
*definition_global = Global{
|
|
||||||
.variable = {
|
|
||||||
.initial_value = definition_value,
|
|
||||||
.type = get_slice_type(module, uint8(module)),
|
|
||||||
.scope = scope,
|
|
||||||
.name = definition.name,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
skip_space(module);
|
skip_space(module);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user