blob: d30facd24787470b0e18ef5ec54878f3ce60511d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
use crate::*;
use SemanticTokenVariant as SemVar;
pub fn generate_symbols_file(semantic_tokens: &[SemanticToken]) -> String {
let mut symbols = String::new();
for token in semantic_tokens {
if let SemVar::LabelDefinition(definition) = &token.variant {
let address = token.bytecode.location.address;
if address > 0xffff { break; }
let name = &definition.name;
let location = token.source.location();
symbols.push_str(&format!("{address:04x} {name} {location}\n"));
}
}
return symbols;
}
|