Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions rust/src/disassembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,10 @@ pub enum InstructionTextTokenKind {
ty: StringType,
},
CharacterConstant,
Keyword,
Keyword {
// Example usage can be found for `BNAnalysisWarningActionType`.
value: u64,
},
TypeName,
FieldName {
/// Offset to this field in the respective structure
Expand Down Expand Up @@ -619,7 +622,7 @@ impl InstructionTextTokenKind {
_ => Self::String { value: value.value },
},
BNInstructionTextTokenType::CharacterConstantToken => Self::CharacterConstant,
BNInstructionTextTokenType::KeywordToken => Self::Keyword,
BNInstructionTextTokenType::KeywordToken => Self::Keyword { value: value.value },
BNInstructionTextTokenType::TypeNameToken => Self::TypeName,
BNInstructionTextTokenType::FieldNameToken => Self::FieldName {
offset: value.value,
Expand Down Expand Up @@ -735,6 +738,7 @@ impl InstructionTextTokenKind {
InstructionTextTokenKind::HexDumpText { width, .. } => Some(*width),
InstructionTextTokenKind::String { value, .. } => Some(*value),
InstructionTextTokenKind::StringContent { ty, .. } => Some(*ty as u64),
InstructionTextTokenKind::Keyword { value, .. } => Some(*value),
InstructionTextTokenKind::FieldName { offset, .. } => Some(*offset),
InstructionTextTokenKind::StructOffset { offset, .. } => Some(*offset),
InstructionTextTokenKind::StructureHexDumpText { width, .. } => Some(*width),
Expand Down Expand Up @@ -843,7 +847,7 @@ impl From<InstructionTextTokenKind> for BNInstructionTextTokenType {
InstructionTextTokenKind::CharacterConstant => {
BNInstructionTextTokenType::CharacterConstantToken
}
InstructionTextTokenKind::Keyword => BNInstructionTextTokenType::KeywordToken,
InstructionTextTokenKind::Keyword { .. } => BNInstructionTextTokenType::KeywordToken,
InstructionTextTokenKind::TypeName => BNInstructionTextTokenType::TypeNameToken,
InstructionTextTokenKind::FieldName { .. } => {
BNInstructionTextTokenType::FieldNameToken
Expand Down
Loading