harden compiler parsing, recovery, and deep-expression handling
This commit is contained in:
@@ -152,13 +152,12 @@ load_package :: proc(state: ^State, path: string, import_span: source.Span, is_r
|
||||
}
|
||||
|
||||
for file_info in files {
|
||||
bytes, read_ok := os.read_entire_file(file_info.fullpath)
|
||||
bytes, read_ok := os.read_entire_file(file_info.fullpath, state.sources.allocator)
|
||||
if !read_ok {
|
||||
state.root_failed = true
|
||||
continue
|
||||
}
|
||||
source_id := source.add_source(state.sources, file_info.fullpath, string(bytes))
|
||||
delete(bytes)
|
||||
source_id := source.add_source_owned(state.sources, file_info.fullpath, bytes)
|
||||
file_id := len(state.module.files)
|
||||
append(&state.module.files, ast.File{source=source_id, pkg=pkg_id})
|
||||
stream := lexer.lex(&state.sources.items[source_id], state.diagnostics, state.symbols, state.token_allocator)
|
||||
|
||||
Reference in New Issue
Block a user