mirror of
https://github.com/bearlanguageorg/bear.git
synced 2026-08-26 16:07:01 +00:00
Production pass: floats, GC, type checking, and tooling
Adds floats, bitwise ops, UTF-8 strings with methods, try/catch, closures, generics validation, a compile-time type checker, a mark-and-sweep GC, source-level debug info, constant folding, and the repl/fmt/package-manager commands. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
+5
-1
@@ -15,6 +15,7 @@ pub fn link(paths []string, out string) ! {
|
||||
mut strings := []string{}
|
||||
mut symbols := map[string]int{}
|
||||
mut relocs := []obj.Reloc{}
|
||||
mut lines := []obj.LineInfo{}
|
||||
for p in paths {
|
||||
o := obj.read(p)!
|
||||
base := code.len
|
||||
@@ -28,6 +29,9 @@ pub fn link(paths []string, out string) ! {
|
||||
for r in o.relocs {
|
||||
relocs << obj.Reloc{ offset: r.offset + u32(base), name: r.name, kind: r.kind }
|
||||
}
|
||||
for l in o.lines {
|
||||
lines << obj.LineInfo{ off: l.off + u32(base), line: l.line }
|
||||
}
|
||||
}
|
||||
// resolve relocations
|
||||
for r in relocs {
|
||||
@@ -47,7 +51,7 @@ pub fn link(paths []string, out string) ! {
|
||||
for name, entry in symbols {
|
||||
fns << obj.BinFn{ name: name, entry: entry }
|
||||
}
|
||||
obj.write_bin(out, obj.Bin{ fns: fns, strings: strings, code: code })!
|
||||
obj.write_bin(out, obj.Bin{ fns: fns, strings: strings, code: code, lines: lines })!
|
||||
}
|
||||
|
||||
fn intern_str(mut table []string, s string) int {
|
||||
|
||||
Reference in New Issue
Block a user