mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 17:17:31 +09:00
1326454 - Add assertions to TokenStream::skipChars{,IgnoreEOL} verifying EOF isn't yet hit and that newlines aren't skipped, if appropriate.
This commit is contained in:
parent
a91f1769b7
commit
6828c2c09b
1 changed files with 8 additions and 3 deletions
|
|
@ -997,13 +997,18 @@ class MOZ_STACK_CLASS TokenStream
|
||||||
}
|
}
|
||||||
|
|
||||||
void skipChars(uint8_t n) {
|
void skipChars(uint8_t n) {
|
||||||
while (n-- > 0)
|
while (n-- > 0) {
|
||||||
getChar();
|
MOZ_ASSERT(userbuf.hasRawChars());
|
||||||
|
mozilla::DebugOnly<int32_t> c = getCharIgnoreEOL();
|
||||||
|
MOZ_ASSERT(c != '\n');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void skipCharsIgnoreEOL(uint8_t n) {
|
void skipCharsIgnoreEOL(uint8_t n) {
|
||||||
while (n-- > 0)
|
while (n-- > 0) {
|
||||||
|
MOZ_ASSERT(userbuf.hasRawChars());
|
||||||
getCharIgnoreEOL();
|
getCharIgnoreEOL();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateLineInfoForEOL();
|
void updateLineInfoForEOL();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue