mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
Refactor Token& nextToken
This commit is contained in:
parent
2734a01c77
commit
90f475f75e
1 changed files with 5 additions and 4 deletions
|
|
@ -571,6 +571,11 @@ class MOZ_STACK_CLASS TokenStream
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Token& nextToken() const {
|
||||||
|
MOZ_ASSERT(hasLookahead());
|
||||||
|
return tokens[(cursor + 1) & ntokensMask];
|
||||||
|
}
|
||||||
|
|
||||||
// Advance to the next token. If the token stream encountered an error,
|
// Advance to the next token. If the token stream encountered an error,
|
||||||
// return false. Otherwise return true and store the token kind in |*ttp|.
|
// return false. Otherwise return true and store the token kind in |*ttp|.
|
||||||
MOZ_MUST_USE bool getToken(TokenKind* ttp, Modifier modifier = None) {
|
MOZ_MUST_USE bool getToken(TokenKind* ttp, Modifier modifier = None) {
|
||||||
|
|
@ -1017,10 +1022,6 @@ class MOZ_STACK_CLASS TokenStream
|
||||||
void updateLineInfoForEOL();
|
void updateLineInfoForEOL();
|
||||||
void updateFlagsForEOL();
|
void updateFlagsForEOL();
|
||||||
|
|
||||||
const Token& nextToken() const {
|
|
||||||
MOZ_ASSERT(hasLookahead());
|
|
||||||
return tokens[(cursor + 1) & ntokensMask];
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasLookahead() const { return lookahead > 0; }
|
bool hasLookahead() const { return lookahead > 0; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue