tokensave 6.1.2

Code intelligence tool that builds a semantic knowledge graph from Rust, Go, Java, Scala, TypeScript, Python, C, C++, Kotlin, C#, Swift, and many more codebases
/// Metal Shading Language extractor.
///
/// Metal is a strict superset of C++14, so the C++ grammar covers its syntax
/// correctly. This extractor delegates to [`CppExtractor`] and adds the `.metal`
/// extension mapping.
use crate::extraction::CppExtractor;
use crate::types::ExtractionResult;

pub struct MetalExtractor;

impl crate::extraction::LanguageExtractor for MetalExtractor {
    fn extensions(&self) -> &[&str] {
        &["metal"]
    }

    fn language_name(&self) -> &'static str {
        "Metal"
    }

    fn extract(&self, file_path: &str, source: &str) -> ExtractionResult {
        CppExtractor::extract_source(file_path, source)
    }
}