diff --git a/lib/core/src/StaticBuffer.ri b/lib/core/src/StaticBuffer.c.ri similarity index 100% rename from lib/core/src/StaticBuffer.ri rename to lib/core/src/StaticBuffer.c.ri diff --git a/lib/core/src/StringBuilder.ri b/lib/core/src/StringBuilder.c.ri similarity index 100% rename from lib/core/src/StringBuilder.ri rename to lib/core/src/StringBuilder.c.ri diff --git a/lib/core/src/StringFormatter.ri b/lib/core/src/StringFormatter.c.ri similarity index 100% rename from lib/core/src/StringFormatter.ri rename to lib/core/src/StringFormatter.c.ri diff --git a/lib/core/src/TokenIterator.ri b/lib/core/src/TokenIterator.c.ri similarity index 100% rename from lib/core/src/TokenIterator.ri rename to lib/core/src/TokenIterator.c.ri diff --git a/lib/core/src/Vector.ri b/lib/core/src/Vector.c.ri similarity index 100% rename from lib/core/src/Vector.ri rename to lib/core/src/Vector.c.ri diff --git a/lib/core/src/array.ri b/lib/core/src/array.c.ri similarity index 100% rename from lib/core/src/array.ri rename to lib/core/src/array.c.ri diff --git a/lib/core/src/backtrace.ri b/lib/core/src/backtrace.c.ri similarity index 100% rename from lib/core/src/backtrace.ri rename to lib/core/src/backtrace.c.ri diff --git a/lib/core/src/bool.ri b/lib/core/src/bool.c.ri similarity index 100% rename from lib/core/src/bool.ri rename to lib/core/src/bool.c.ri diff --git a/lib/core/src/console.ri b/lib/core/src/console.c.ri similarity index 100% rename from lib/core/src/console.ri rename to lib/core/src/console.c.ri diff --git a/lib/core/src/demangle.ri b/lib/core/src/demangle.c.ri similarity index 100% rename from lib/core/src/demangle.ri rename to lib/core/src/demangle.c.ri diff --git a/lib/core/src/entry_point.ri b/lib/core/src/entry_point.c.ri similarity index 100% rename from lib/core/src/entry_point.ri rename to lib/core/src/entry_point.c.ri diff --git a/lib/core/src/errors.ri b/lib/core/src/errors.c.ri similarity index 100% rename from lib/core/src/errors.ri rename to lib/core/src/errors.c.ri diff --git a/lib/core/src/float.ri b/lib/core/src/float.c.ri similarity index 100% rename from lib/core/src/float.ri rename to lib/core/src/float.c.ri diff --git a/lib/core/src/int.ri b/lib/core/src/int.c.ri similarity index 100% rename from lib/core/src/int.ri rename to lib/core/src/int.c.ri diff --git a/lib/core/src/lib.ri b/lib/core/src/lib.c.ri similarity index 100% rename from lib/core/src/lib.ri rename to lib/core/src/lib.c.ri diff --git a/lib/core/src/mem.ri b/lib/core/src/mem.c.ri similarity index 100% rename from lib/core/src/mem.ri rename to lib/core/src/mem.c.ri diff --git a/lib/core/src/process.ri b/lib/core/src/process.c.ri similarity index 100% rename from lib/core/src/process.ri rename to lib/core/src/process.c.ri diff --git a/lib/core/src/ptr.ri b/lib/core/src/ptr.c.ri similarity index 100% rename from lib/core/src/ptr.ri rename to lib/core/src/ptr.c.ri diff --git a/lib/core/src/rune.ri b/lib/core/src/rune.c.ri similarity index 100% rename from lib/core/src/rune.ri rename to lib/core/src/rune.c.ri diff --git a/lib/core/src/signals.ri b/lib/core/src/signals.c.ri similarity index 100% rename from lib/core/src/signals.ri rename to lib/core/src/signals.c.ri diff --git a/lib/core/src/string.ri b/lib/core/src/string.c.ri similarity index 100% rename from lib/core/src/string.ri rename to lib/core/src/string.c.ri diff --git a/lib/core/src/uint.ri b/lib/core/src/uint.c.ri similarity index 100% rename from lib/core/src/uint.ri rename to lib/core/src/uint.c.ri diff --git a/lib/core/src/wyhash.ri b/lib/core/src/wyhash.c.ri similarity index 100% rename from lib/core/src/wyhash.ri rename to lib/core/src/wyhash.c.ri diff --git a/lib/rivet/src/ast/Table.ri b/lib/rivet/src/ast/Table.ri index ec85fa948..0dbae70b0 100644 --- a/lib/rivet/src/ast/Table.ri +++ b/lib/rivet/src/ast/Table.ri @@ -387,9 +387,7 @@ public struct Table { mut new_inputs := @vec(string, inputs.len); for input in inputs { basename_input := Path.basename(input); - if basename_input == "project.ri" { - continue; // Skip `project.ri` file, loaded after - } else if basename_input.count(".") == 1 { + if basename_input.count(".") == 1 { new_inputs.push(input); continue; } @@ -402,32 +400,35 @@ public struct Table { } already_exts.push(ext); if ext.starts_with("d_") or ext.starts_with("notd_") { - should_compile = should_compile and if ext.starts_with("d_") { + should_compile = if ext.starts_with("d_") { ext[2..] in self.prefs.flags } else { ext[2..] !in self.prefs.flags }; } else if os := sys.OS.from_string(ext) { - should_compile = should_compile and self.prefs.target_os == os; + should_compile = self.prefs.target_os == os; } else if arch := sys.Arch.from_string(ext) { - should_compile = should_compile and self.prefs.target_arch == arch; + should_compile = self.prefs.target_arch == arch; } else if ext in ["x32", "x64"] { - should_compile = should_compile and if ext == "x32" { + should_compile = if ext == "x32" { !self.prefs.target_is_64bit } else { self.prefs.target_is_64bit }; } else if ext in ["little_endian", "big_endian"] { - should_compile = should_compile and if ext == "little_endian" { + should_compile = if ext == "little_endian" { self.prefs.target_is_little_endian } else { !self.prefs.target_is_little_endian }; } else if backend := prefs.Backend.from_string(ext) { - should_compile = should_compile and backend == self.prefs.target_backend; + should_compile = backend == self.prefs.target_backend; } else { utils.error("{}: unknown special extension `{}`", input, ext); } + if !should_compile { + break; + } } if should_compile { new_inputs.push(input); diff --git a/rivetc/src/__init__.py b/rivetc/src/__init__.py index b4c46eb3e..25d7deb4c 100644 --- a/rivetc/src/__init__.py +++ b/rivetc/src/__init__.py @@ -263,30 +263,30 @@ def filter_files(self, inputs): already_exts.append(ext) if ext.startswith("d_") or ext.startswith("notd_"): if ext.startswith("d_"): - should_compile = should_compile and ext[ - 2:] in self.prefs.flags + should_compile = ext[2:] in self.prefs.flags else: - should_compile = should_compile and ext[ - 5:] not in self.prefs.flags + should_compile = ext[5:] not in self.prefs.flags elif osf := prefs.OS.from_string(ext): - should_compile = should_compile and self.prefs.target_os == osf + should_compile = self.prefs.target_os == osf elif arch := prefs.Arch.from_string(ext): - should_compile = should_compile and self.prefs.target_arch == arch + should_compile = self.prefs.target_arch == arch elif ext in ("x32", "x64"): if ext == "x32": - should_compile = should_compile and self.prefs.target_bits == Bits.X32 + should_compile = self.prefs.target_bits == Bits.X32 else: - should_compile = should_compile and self.prefs.target_bits == Bits.X64 + should_compile = self.prefs.target_bits == Bits.X64 elif ext in ("little_endian", "big_endian"): if ext == "little_endian": - should_compile = should_compile and self.prefs.target_endian == Endian.Little + should_compile = self.prefs.target_endian == Endian.Little else: - should_compile = should_compile and self.prefs.target_endian == Endian.Big - elif b := Backend.from_string(ext): # backends - should_compile = should_compile and self.prefs.target_backend == b + should_compile = self.prefs.target_endian == Endian.Big + elif b := prefs.Backend.from_string(ext): # backends + should_compile = self.prefs.target_backend == b else: error(f"{input}: unknown special extension `{ext}`") break + if not should_compile: + break if should_compile: new_inputs.append(input) return new_inputs