Fixed byte size contributed to the output section, or None for alignment tokens.
(&self)
| 78 | file: String, |
| 79 | line: u32, |
| 80 | }, |
| 81 | } |
| 82 | |
| 83 | impl AsmToken { |
| 84 | /// Fixed byte size contributed to the output section, or None for alignment tokens. |
| 85 | pub fn fixed_size(&self) -> Option<usize> { |
| 86 | match self { |
| 87 | Self::Real(_) | Self::Branch { .. } | Self::Jal { .. } => Some(4), |
| 88 | Self::Call { .. } | Self::Tail { .. } | Self::La { .. } => Some(8), |
| 89 | Self::DataU8(_) => Some(1), |
| 90 | Self::DataU16(_) => Some(2), |
| 91 | Self::DataU32(_) => Some(4), |
| 92 | Self::DataU64(_) => Some(8), |
| 93 | Self::DataAsciz(s) => Some(s.len() + 1), |
| 94 | Self::Space(n) => Some(*n as usize), |
| 95 | Self::Align(_) | Self::Balign(_) => None, |
| 96 | Self::Section(_) |