diff --git a/src/error.rs b/src/error.rs index 03513fe..337e228 100644 --- a/src/error.rs +++ b/src/error.rs @@ -30,32 +30,32 @@ pub enum Error { got: OwnedToken, }, /// Produced by - /// [Number](parser::instruction::encoding::number::Number)[::parse()](parser::parsable::Parsable::parse()) + /// [Number](parser::preamble::Number)[::parse()](parser::parsable::Parsable::parse()) /// when the parsed number contains digits too high for the specified radix UnexpectedDigits(String, u32), /// Produced by - /// [Opcode](parser::instruction::opcode::Opcode)[::parse()](parser::parsable::Parsable::parse()) + /// [Opcode](parser::preamble::Opcode)[::parse()](parser::parsable::Parsable::parse()) /// when the opcode passed lexing but did not match recognized opcodes. /// /// This should be interpreted as a failure in lexing. UnrecognizedOpcode(String), - /// Produced by [Register](parser::instruction::encoding::register::Register) + /// Produced by [Register](parser::preamble::Register) /// when attempting to convert from a [str] that isn't a register (pc, sp, sr, cg, or r{number}) NotARegister(String), - /// Produced by [Register](parser::instruction::encoding::register) + /// Produced by [Register](parser::preamble::Register) /// when attempting to convert from a [u16] that isn't in the range 0-15 RegisterTooHigh(u16), /// Produced by - /// [SecondaryOperand](parser::instruction::encoding::secondary_operand) + /// [SecondaryOperand](parser::preamble::SecondaryOperand) /// when the joke "secondary immediate" form is out of range 0..=1 FatSecondaryImmediate(isize), - /// Produced by [Number](parser::instruction::encoding::number) when the number is too + /// Produced by [Number](parser::preamble::Number) when the number is too /// wide to fit in 16 bits (outside the range `(-2^15) .. (2^16-1)` ) NumberTooWide(isize), - /// Produced by [JumpTarget](parser::instruction::encoding::jump_target) + /// Produced by [JumpTarget](parser::preamble::JumpTarget) /// when the jump offset is outside the range (-0x3ff..0x3fc) JumpedTooFar(isize), - /// Produced by [JumpTarget](parser::instruction::encoding::jump_target) + /// Produced by [JumpTarget](parser::preamble::JumpTarget) JumpedOdd(isize), EndOfFile, } diff --git a/src/parser/instruction.rs b/src/parser/instruction.rs index a19bcf1..999340c 100644 --- a/src/parser/instruction.rs +++ b/src/parser/instruction.rs @@ -14,7 +14,7 @@ use super::*; pub mod encoding; pub mod opcode; -/// Represents an entire MSP430 instruction +/// Contains the [Opcode] and [Encoding] information for a single msp430 instruction #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Instruction(Opcode, Encoding); diff --git a/src/parser/instruction/encoding/jump_target.rs b/src/parser/instruction/encoding/jump_target.rs index 7c6ef9c..669caf5 100644 --- a/src/parser/instruction/encoding/jump_target.rs +++ b/src/parser/instruction/encoding/jump_target.rs @@ -4,7 +4,7 @@ use super::*; /// Contains the [pc-relative offset](Number) or [label](Identifier) -/// for a [Jump](Encoding::Jump) [instruction] +/// for a [Jump](Encoding::Jump) [Instruction] // TODO: Allow identifiers in JumpTarget #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct JumpTarget(Number); diff --git a/src/parser/instruction/encoding/primary_operand.rs b/src/parser/instruction/encoding/primary_operand.rs index 28ada4a..8e72984 100644 --- a/src/parser/instruction/encoding/primary_operand.rs +++ b/src/parser/instruction/encoding/primary_operand.rs @@ -1,10 +1,10 @@ // © 2023 John Breaux //! A [PrimaryOperand] contains the first [Register], addressing mode, and Extension -//! Word for a [one-operand](Encoding::Single) or [two-operand](Encoding::Double) [instruction] +//! Word for a [one-operand](Encoding::Single) or [two-operand](Encoding::Double) [Instruction] use super::*; /// Contains the first [Register], addressing mode, and Extension Word for a -/// [one-operand](Encoding::Single) or [two-operand](Encoding::Double) [instruction] +/// [one-operand](Encoding::Single) or [two-operand](Encoding::Double) [Instruction] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum PrimaryOperand { Direct(Register), diff --git a/src/tokenizer/token.rs b/src/tokenizer/token.rs index 44ec23a..5df804e 100644 --- a/src/tokenizer/token.rs +++ b/src/tokenizer/token.rs @@ -1,6 +1,4 @@ // © 2023 John Breaux -//! Defines the [Token] -//! //! A [Token] is a [semantically tagged](Type) sequence of characters use crate::Error;