move expression to func

This commit is contained in:
tocariimaa 2025-01-19 19:32:01 -03:00
parent c1d54991c0
commit ea75f19804

View file

@ -121,6 +121,14 @@ peek(LexState *ls)
return *ls->fwd;
}
/* Moves the forward pointer and the column count by one */
static void
next(LexState *ls)
{
++ls->fwd;
++ls->cur_loc.column;
}
static void
backup(LexState *ls, int n)
{
@ -460,8 +468,7 @@ lex_scan(LexState *ls)
case '!':
if (peek(ls) == '=') {
token.id = T_NOTEQUAL;
++ls->fwd;
++ls->cur_loc.column;
next(ls);
} else {
token.id = T_EXCLAMATION;
}
@ -485,8 +492,7 @@ lex_scan(LexState *ls)
case '=':
if (peek(ls) == '=') {
token.id = T_LOGICEQUAL;
++ls->fwd;
++ls->cur_loc.column;
next(ls);
} else {
token.id = T_EQUAL;
}