move expression to func
This commit is contained in:
parent
c1d54991c0
commit
ea75f19804
1 changed files with 10 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue