feat: establish first-class lexical language parity #2
4 changed files with 11 additions and 3 deletions
feat(scan): recognize qualified Rust functions
commit
581dd88616
|
|
@ -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 |
|
||||
|
|
|
|||
|
|
@ -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" => (
|
||||
|
|
|
|||
8
tests/fixtures/languages/rust/basic.rs
vendored
8
tests/fixtures/languages/rust/basic.rs
vendored
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue