Improve command classification #4

Merged
Lephenixnoir merged 1 commits from Dr-Carlos/fxos:classification into master 2022-04-15 22:57:40 +02:00
1 changed files with 8 additions and 7 deletions

View File

@ -5,20 +5,21 @@
// ms
//---
static FxOS::Symbol parse_ms(Session &, Parser &parser)
static FxOS::Symbol parse_ms(Session &session, Parser &parser)
{
Token t = parser.expect({T::NUM, T::SYSCALL});
FxOS::Symbol s;
if(t.type == T::SYSCALL)
if(parser.lookahead().type == T::SYSCALL) {
s.type = FxOS::Symbol::Syscall;
else
s.value = parser.expect(T::SYSCALL).value.NUM;
} else {
s.type = FxOS::Symbol::Address;
s.value = parser.expr(session.current_space);
}
s.value = t.value.NUM;
s.name = parser.symbol();
parser.end();
return s;
}