Skip to main content

normalize_languages/
x86asm.rs

1//! x86 assembly support.
2
3use crate::{Language, LanguageSymbols};
4
5/// x86 Assembly language support.
6pub struct X86Asm;
7
8impl Language for X86Asm {
9    fn name(&self) -> &'static str {
10        "x86 Assembly"
11    }
12    fn extensions(&self) -> &'static [&'static str] {
13        &["asm", "s", "S"]
14    }
15    fn grammar_name(&self) -> &'static str {
16        "x86asm"
17    }
18
19    fn as_symbols(&self) -> Option<&dyn LanguageSymbols> {
20        Some(self)
21    }
22}
23
24impl LanguageSymbols for X86Asm {}
25
26#[cfg(test)]
27mod tests {
28    use super::*;
29    use crate::validate_unused_kinds_audit;
30
31    #[test]
32    fn unused_node_kinds_audit() {
33        #[rustfmt::skip]
34        let documented_unused: &[&str] = &[
35            "label_definition", "instruction", "identifier",
36            "memory_expression", "binary_expression",
37        ];
38        validate_unused_kinds_audit(&X86Asm, documented_unused)
39            .expect("x86 Assembly unused node kinds audit failed");
40    }
41}