feat: establish first-class lexical language parity #2

Merged
trevon merged 14 commits from feat/language-parity-foundation into bench/yams-architecture-reproducibility 2026-08-30 22:09:40 +00:00
4 changed files with 11 additions and 3 deletions
Showing only changes of commit 581dd88616 - Show all commits

feat(scan): recognize qualified Rust functions

trvon 2026-08-30 15:16:51 -06:00
Signed by: trevon
GPG key ID: 38686EA797D7A8A7

View file

@ -14,7 +14,7 @@ contracts and fixtures reach the same standard.
| Language | Useful current coverage | Important gaps | Tier |
| --- | --- | --- | --- |
| Dart | Classes, mixins, enums, extensions, many methods, imports, `extends`, and ordinary calls | `with`/`implements`, export/part, named constructors, accessors/operators, and multiline declarations | first-class target |
| Rust | Structs, enums, traits, ordinary/async functions, simple `use`, calls, and raw-string masking | impl/module ownership, const/unsafe/extern functions, macros, turbofish calls, and braced/glob imports | first-class target |
| Rust | Structs, enums, traits, ordinary/async/const/unsafe/extern functions, simple `use`, calls, and raw-string masking | impl/module ownership, unions/type aliases, macros, turbofish calls, and braced/glob imports | first-class target |
| C | Files, basic includes, structs, and narrow function forms through the shared C/C++ profile | distinct C identity, enums/typedefs/function pointers, multiline declarations, macros, and declaration masking | first-class target |
| C++ | Basic classes/structs, narrow function forms, calls, and local include resolution | templates, constructors/destructors/operators, multiple inheritance, namespaces, overloads, lambdas, qualifiers, and multiline declarations | first-class target |
| JavaScript | Named functions, simple classes/extends, ES imports, and call-shaped expressions | methods, arrows/function expressions, CommonJS, dynamic imports, re-exports, decorators, and template literals | first-class target |

View file

@ -585,7 +585,7 @@ impl Patterns {
),
"rust" => (
r"^\s*(?:pub(?:\([^)]*\))?\s+)?(?:struct|enum|trait)\s+(?P<name>[A-Za-z_]\w*)",
r"^\s*(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+(?P<name>[A-Za-z_]\w*)\s*(?:<[^>]*>)?\s*\(",
r#"^\s*(?:pub(?:\([^)]*\))?\s+)?(?:(?:const|async|unsafe)\s+)*(?:extern(?:\s+"[^"]+")?\s+)?fn\s+(?P<name>[A-Za-z_]\w*)\s*(?:<[^>]*>)?\s*\("#,
r"^\s*use\s+(?P<name>[A-Za-z_][\w:]*)",
),
"javascript" | "typescript" => (

View file

@ -7,3 +7,11 @@ pub fn start() {
}
fn helper() {}
pub const fn constant() -> usize {
1
}
pub unsafe fn unsafe_op() {}
pub extern "C" fn ffi_entry() {}

View file

@ -28,7 +28,7 @@ fn first_class_language_fixtures_have_stable_baseline_evidence() {
directory: "rust",
language: "rust",
classes: &["Worker"],
functions: &["helper", "start"],
functions: &["constant", "ffi_entry", "helper", "start", "unsafe_op"],
imports: 1,
inherits: 0,
calls: 1,