mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
1326454 - Introduce TokenStream::warning that warns at the current offset.
This commit is contained in:
parent
c94ed16b4f
commit
cd2bccf4c0
2 changed files with 14 additions and 10 deletions
|
|
@ -777,7 +777,7 @@ TokenStream::reportErrorNoOffset(unsigned errorNumber, ...)
|
|||
}
|
||||
|
||||
bool
|
||||
TokenStream::reportWarning(unsigned errorNumber, ...)
|
||||
TokenStream::warning(unsigned errorNumber, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, errorNumber);
|
||||
|
|
@ -958,9 +958,10 @@ TokenStream::getDirective(bool isMultiline, bool shouldWarnDeprecated,
|
|||
int32_t c;
|
||||
|
||||
if (peekChars(directiveLength, peeked) && CharsMatch(peeked, directive)) {
|
||||
if (shouldWarnDeprecated &&
|
||||
!reportWarning(JSMSG_DEPRECATED_PRAGMA, errorMsgPragma))
|
||||
return false;
|
||||
if (shouldWarnDeprecated) {
|
||||
if (!warning(JSMSG_DEPRECATED_PRAGMA, errorMsgPragma))
|
||||
return false;
|
||||
}
|
||||
|
||||
skipChars(directiveLength);
|
||||
tokenbuf.clear();
|
||||
|
|
@ -1555,10 +1556,11 @@ TokenStream::getTokenInternal(TokenKind* ttp, Modifier modifier)
|
|||
// grammar. We might not always be so permissive, so we warn
|
||||
// about it.
|
||||
if (c >= '8') {
|
||||
if (!reportWarning(JSMSG_BAD_OCTAL, c == '8' ? "08" : "09")) {
|
||||
if (!warning(JSMSG_BAD_OCTAL, c == '8' ? "08" : "09"))
|
||||
goto error;
|
||||
}
|
||||
goto decimal; // use the decimal scanner for the rest of the number
|
||||
|
||||
// Use the decimal scanner for the rest of the number.
|
||||
goto decimal;
|
||||
}
|
||||
c = getCharIgnoreEOL();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue