Tiny changes.
This commit is contained in:
parent
06fafb825a
commit
0df1252053
@ -13,9 +13,9 @@ use crate::error_codes::{FIELD_MULTIPLE_INIT, FIELD_UNINIT};
|
|||||||
use crate::ir::ir_class::{IrClass, IrField};
|
use crate::ir::ir_class::{IrClass, IrField};
|
||||||
use crate::ir::ir_function::IrFunction;
|
use crate::ir::ir_function::IrFunction;
|
||||||
use crate::source_range::SourceRange;
|
use crate::source_range::SourceRange;
|
||||||
|
use crate::symbol::Symbol;
|
||||||
use crate::symbol::class_symbol::ClassSymbol;
|
use crate::symbol::class_symbol::ClassSymbol;
|
||||||
use crate::symbol::constructor_symbol::ConstructorSymbol;
|
use crate::symbol::constructor_symbol::ConstructorSymbol;
|
||||||
use crate::symbol::Symbol;
|
|
||||||
use crate::symbol_table::SymbolTable;
|
use crate::symbol_table::SymbolTable;
|
||||||
use crate::type_info::TypeInfo;
|
use crate::type_info::TypeInfo;
|
||||||
use crate::types_table::TypesTable;
|
use crate::types_table::TypesTable;
|
||||||
@ -147,7 +147,7 @@ impl Class {
|
|||||||
all_symbols
|
all_symbols
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_names(&self, symbol_table: &mut SymbolTable) -> Vec<Diagnostic> {
|
pub fn check_names(&self, symbol_table: &SymbolTable) -> Vec<Diagnostic> {
|
||||||
let mut diagnostics: Vec<Diagnostic> = Vec::new();
|
let mut diagnostics: Vec<Diagnostic> = Vec::new();
|
||||||
|
|
||||||
for generic_parameter in &self.generic_parameters {
|
for generic_parameter in &self.generic_parameters {
|
||||||
|
|||||||
@ -57,7 +57,7 @@ impl CompilationUnit {
|
|||||||
symbol_table.pop_scope();
|
symbol_table.pop_scope();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn gather_symbols(&self) -> Vec<Symbol> {
|
pub fn gather_unordered_symbols(&self) -> Vec<Symbol> {
|
||||||
let fqn_context = FqnContext::new();
|
let fqn_context = FqnContext::new();
|
||||||
[
|
[
|
||||||
self.classes
|
self.classes
|
||||||
|
|||||||
@ -40,10 +40,10 @@ pub fn compile_compilation_units(inputs: &HashMap<Filename, &str>) -> Result<(),
|
|||||||
compilation_unit.init_scopes(&mut symbol_table);
|
compilation_unit.init_scopes(&mut symbol_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
// gather symbols
|
// gather unordered symbols
|
||||||
let all_symbols = compilation_units
|
let all_symbols = compilation_units
|
||||||
.values()
|
.values()
|
||||||
.flat_map(|compilation_unit| compilation_unit.gather_symbols())
|
.flat_map(|compilation_unit| compilation_unit.gather_unordered_symbols())
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
try_insert_symbols_into(all_symbols, &mut symbol_table)?;
|
try_insert_symbols_into(all_symbols, &mut symbol_table)?;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user