summaryrefslogtreecommitdiff
path: root/usr.bin/oasm
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/oasm')
-rw-r--r--usr.bin/oasm/emit.c2
-rw-r--r--usr.bin/oasm/include/oasm/lex.h2
-rw-r--r--usr.bin/oasm/parse.c7
3 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/oasm/emit.c b/usr.bin/oasm/emit.c
index 139cf47..6b17eab 100644
--- a/usr.bin/oasm/emit.c
+++ b/usr.bin/oasm/emit.c
@@ -471,7 +471,7 @@ emit_process(struct oasm_state *oasm, struct emit_state *emit)
curtok = emit_encode_hlt(emit, curtok);
break;
default:
- if (lex_is_mro(curtok->type)) {
+ if (tok_is_mro(curtok->type)) {
curtok = emit_encode_mro(emit, curtok);
break;
}
diff --git a/usr.bin/oasm/include/oasm/lex.h b/usr.bin/oasm/include/oasm/lex.h
index 375771e..873f6b9 100644
--- a/usr.bin/oasm/include/oasm/lex.h
+++ b/usr.bin/oasm/include/oasm/lex.h
@@ -167,7 +167,7 @@ tok_is_xreg(tt_t tok)
* instruction. Returns true on match.
*/
__always_inline static inline bool
-lex_is_mro(tt_t tok)
+tok_is_mro(tt_t tok)
{
switch (tok) {
case TT_MROB:
diff --git a/usr.bin/oasm/parse.c b/usr.bin/oasm/parse.c
index ba97306..c81b498 100644
--- a/usr.bin/oasm/parse.c
+++ b/usr.bin/oasm/parse.c
@@ -127,13 +127,12 @@ parse_reg(struct oasm_state *state, struct oasm_token *tok)
state->last = tok->type;
break;
default:
- if (lex_is_mro(state->last)) {
- state->last = tok->type;
+ if (tok_is_mro(state->last)) {
break;
}
p = tokstr[state->last];
- oasm_err("bad instruction '%s' for regop\n", p);
+ oasm_err("bad token '%s' for regop\n", p);
return -1;
}
@@ -205,7 +204,7 @@ parse_tok(struct oasm_state *state, struct oasm_token *tok)
emit_osmx64(&emit_state, tok);
break;
default:
- if (lex_is_mro(tok->type)) {
+ if (tok_is_mro(tok->type)) {
state->last = tok->type;
emit_osmx64(&emit_state, tok);
return 0;