sbpf_assembler/
messages.rs

1/* A central place to store all the label messages to avoid duplication
2 * and make it easier to update or translate. We could move error messages here too
3 */
4
5pub const LABEL_REDEFINED: &str = "Label is redefined";
6
7// we can do a more fine-grained error message by pointing out the exact token that caused the error
8// with a special error pattern parser, but for now we just provide expected patterns
9pub const EXPECTS_LABEL_DIR_STR: &str = "expects <label>, <directive>, <string literal>";
10pub const EXPECTS_IDEN: &str = "expects <identifier>";
11pub const EXPECTS_IDEN_COM_IMM: &str = "expects <identifier>, <immediate value>";
12pub const EXPECTS_MORE_OPERAND: &str = "expects more operand";
13pub const EXPECTS_REG: &str = "expects <register>";
14pub const EXPECTS_REG_COM_IMM: &str = "expects <register>, <immediate value>";
15pub const EXPECTS_REG_COM_REG: &str = "expects <register>, <register>";
16pub const EXPECTS_REG_COM_IMM_OR_IDEN: &str = "expects <register>, <immediate value>/<identifier>";
17pub const EXPECTS_REG_COM_IMM_COM_IMM_OR_IDEN: &str =
18    "expects <register>, <immediate value>, <immediate value>/<identifier>";
19pub const EXPECTS_REG_COM_LB_REG_BIOP_IMM_RB: &str =
20    "expects <register>, [<register> <binary operator> <immediate value>]";
21pub const EXPECTS_LB_REG_BIOP_IMM_RB_COM_REG: &str =
22    "expects [<register> <binary operator> <immediate value>], <register>";
23pub const EXPECTS_LB_REG_BIOP_IMM_RB_COM_IMM: &str =
24    "expects [<register> <binary operator> <immediate value>], <immediate value>";