mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 20:30:04 +02:00
update packages to latest version
This commit is contained in:
250
node_modules/parse5/dist/cjs/tokenizer/index.d.ts
generated
vendored
Normal file
250
node_modules/parse5/dist/cjs/tokenizer/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,250 @@
|
||||
import { Preprocessor } from './preprocessor.js';
|
||||
import { type CharacterToken, type DoctypeToken, type TagToken, type EOFToken, type CommentToken } from '../common/token.js';
|
||||
import { type ParserErrorHandler } from '../common/error-codes.js';
|
||||
declare const enum State {
|
||||
DATA = 0,
|
||||
RCDATA = 1,
|
||||
RAWTEXT = 2,
|
||||
SCRIPT_DATA = 3,
|
||||
PLAINTEXT = 4,
|
||||
TAG_OPEN = 5,
|
||||
END_TAG_OPEN = 6,
|
||||
TAG_NAME = 7,
|
||||
RCDATA_LESS_THAN_SIGN = 8,
|
||||
RCDATA_END_TAG_OPEN = 9,
|
||||
RCDATA_END_TAG_NAME = 10,
|
||||
RAWTEXT_LESS_THAN_SIGN = 11,
|
||||
RAWTEXT_END_TAG_OPEN = 12,
|
||||
RAWTEXT_END_TAG_NAME = 13,
|
||||
SCRIPT_DATA_LESS_THAN_SIGN = 14,
|
||||
SCRIPT_DATA_END_TAG_OPEN = 15,
|
||||
SCRIPT_DATA_END_TAG_NAME = 16,
|
||||
SCRIPT_DATA_ESCAPE_START = 17,
|
||||
SCRIPT_DATA_ESCAPE_START_DASH = 18,
|
||||
SCRIPT_DATA_ESCAPED = 19,
|
||||
SCRIPT_DATA_ESCAPED_DASH = 20,
|
||||
SCRIPT_DATA_ESCAPED_DASH_DASH = 21,
|
||||
SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22,
|
||||
SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23,
|
||||
SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24,
|
||||
SCRIPT_DATA_DOUBLE_ESCAPE_START = 25,
|
||||
SCRIPT_DATA_DOUBLE_ESCAPED = 26,
|
||||
SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27,
|
||||
SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28,
|
||||
SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29,
|
||||
SCRIPT_DATA_DOUBLE_ESCAPE_END = 30,
|
||||
BEFORE_ATTRIBUTE_NAME = 31,
|
||||
ATTRIBUTE_NAME = 32,
|
||||
AFTER_ATTRIBUTE_NAME = 33,
|
||||
BEFORE_ATTRIBUTE_VALUE = 34,
|
||||
ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35,
|
||||
ATTRIBUTE_VALUE_SINGLE_QUOTED = 36,
|
||||
ATTRIBUTE_VALUE_UNQUOTED = 37,
|
||||
AFTER_ATTRIBUTE_VALUE_QUOTED = 38,
|
||||
SELF_CLOSING_START_TAG = 39,
|
||||
BOGUS_COMMENT = 40,
|
||||
MARKUP_DECLARATION_OPEN = 41,
|
||||
COMMENT_START = 42,
|
||||
COMMENT_START_DASH = 43,
|
||||
COMMENT = 44,
|
||||
COMMENT_LESS_THAN_SIGN = 45,
|
||||
COMMENT_LESS_THAN_SIGN_BANG = 46,
|
||||
COMMENT_LESS_THAN_SIGN_BANG_DASH = 47,
|
||||
COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48,
|
||||
COMMENT_END_DASH = 49,
|
||||
COMMENT_END = 50,
|
||||
COMMENT_END_BANG = 51,
|
||||
DOCTYPE = 52,
|
||||
BEFORE_DOCTYPE_NAME = 53,
|
||||
DOCTYPE_NAME = 54,
|
||||
AFTER_DOCTYPE_NAME = 55,
|
||||
AFTER_DOCTYPE_PUBLIC_KEYWORD = 56,
|
||||
BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57,
|
||||
DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58,
|
||||
DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59,
|
||||
AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60,
|
||||
BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61,
|
||||
AFTER_DOCTYPE_SYSTEM_KEYWORD = 62,
|
||||
BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63,
|
||||
DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64,
|
||||
DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65,
|
||||
AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66,
|
||||
BOGUS_DOCTYPE = 67,
|
||||
CDATA_SECTION = 68,
|
||||
CDATA_SECTION_BRACKET = 69,
|
||||
CDATA_SECTION_END = 70,
|
||||
CHARACTER_REFERENCE = 71,
|
||||
NAMED_CHARACTER_REFERENCE = 72,
|
||||
AMBIGUOUS_AMPERSAND = 73,
|
||||
NUMERIC_CHARACTER_REFERENCE = 74,
|
||||
HEXADEMICAL_CHARACTER_REFERENCE_START = 75,
|
||||
DECIMAL_CHARACTER_REFERENCE_START = 76,
|
||||
HEXADEMICAL_CHARACTER_REFERENCE = 77,
|
||||
DECIMAL_CHARACTER_REFERENCE = 78,
|
||||
NUMERIC_CHARACTER_REFERENCE_END = 79
|
||||
}
|
||||
export declare const TokenizerMode: {
|
||||
readonly DATA: State.DATA;
|
||||
readonly RCDATA: State.RCDATA;
|
||||
readonly RAWTEXT: State.RAWTEXT;
|
||||
readonly SCRIPT_DATA: State.SCRIPT_DATA;
|
||||
readonly PLAINTEXT: State.PLAINTEXT;
|
||||
readonly CDATA_SECTION: State.CDATA_SECTION;
|
||||
};
|
||||
export interface TokenizerOptions {
|
||||
sourceCodeLocationInfo?: boolean;
|
||||
}
|
||||
export interface TokenHandler {
|
||||
onComment(token: CommentToken): void;
|
||||
onDoctype(token: DoctypeToken): void;
|
||||
onStartTag(token: TagToken): void;
|
||||
onEndTag(token: TagToken): void;
|
||||
onEof(token: EOFToken): void;
|
||||
onCharacter(token: CharacterToken): void;
|
||||
onNullCharacter(token: CharacterToken): void;
|
||||
onWhitespaceCharacter(token: CharacterToken): void;
|
||||
onParseError?: ParserErrorHandler | null;
|
||||
}
|
||||
export declare class Tokenizer {
|
||||
private options;
|
||||
private handler;
|
||||
preprocessor: Preprocessor;
|
||||
private paused;
|
||||
/** Ensures that the parsing loop isn't run multiple times at once. */
|
||||
private inLoop;
|
||||
/**
|
||||
* Indicates that the current adjusted node exists, is not an element in the HTML namespace,
|
||||
* and that it is not an integration point for either MathML or HTML.
|
||||
*
|
||||
* @see {@link https://html.spec.whatwg.org/multipage/parsing.html#tree-construction}
|
||||
*/
|
||||
inForeignNode: boolean;
|
||||
lastStartTagName: string;
|
||||
active: boolean;
|
||||
state: State;
|
||||
private returnState;
|
||||
private charRefCode;
|
||||
private consumedAfterSnapshot;
|
||||
private currentLocation;
|
||||
private currentCharacterToken;
|
||||
private currentToken;
|
||||
private currentAttr;
|
||||
constructor(options: TokenizerOptions, handler: TokenHandler);
|
||||
private _err;
|
||||
private getCurrentLocation;
|
||||
private _runParsingLoop;
|
||||
pause(): void;
|
||||
resume(writeCallback?: () => void): void;
|
||||
write(chunk: string, isLastChunk: boolean, writeCallback?: () => void): void;
|
||||
insertHtmlAtCurrentPos(chunk: string): void;
|
||||
private _ensureHibernation;
|
||||
private _consume;
|
||||
private _unconsume;
|
||||
private _reconsumeInState;
|
||||
private _advanceBy;
|
||||
private _consumeSequenceIfMatch;
|
||||
private _createStartTagToken;
|
||||
private _createEndTagToken;
|
||||
private _createCommentToken;
|
||||
private _createDoctypeToken;
|
||||
private _createCharacterToken;
|
||||
private _createAttr;
|
||||
private _leaveAttrName;
|
||||
private _leaveAttrValue;
|
||||
private prepareToken;
|
||||
private emitCurrentTagToken;
|
||||
private emitCurrentComment;
|
||||
private emitCurrentDoctype;
|
||||
private _emitCurrentCharacterToken;
|
||||
private _emitEOFToken;
|
||||
private _appendCharToCurrentCharacterToken;
|
||||
private _emitCodePoint;
|
||||
private _emitChars;
|
||||
private _matchNamedCharacterReference;
|
||||
private _isCharacterReferenceInAttribute;
|
||||
private _flushCodePointConsumedAsCharacterReference;
|
||||
private _callState;
|
||||
private _stateData;
|
||||
private _stateRcdata;
|
||||
private _stateRawtext;
|
||||
private _stateScriptData;
|
||||
private _statePlaintext;
|
||||
private _stateTagOpen;
|
||||
private _stateEndTagOpen;
|
||||
private _stateTagName;
|
||||
private _stateRcdataLessThanSign;
|
||||
private _stateRcdataEndTagOpen;
|
||||
private handleSpecialEndTag;
|
||||
private _stateRcdataEndTagName;
|
||||
private _stateRawtextLessThanSign;
|
||||
private _stateRawtextEndTagOpen;
|
||||
private _stateRawtextEndTagName;
|
||||
private _stateScriptDataLessThanSign;
|
||||
private _stateScriptDataEndTagOpen;
|
||||
private _stateScriptDataEndTagName;
|
||||
private _stateScriptDataEscapeStart;
|
||||
private _stateScriptDataEscapeStartDash;
|
||||
private _stateScriptDataEscaped;
|
||||
private _stateScriptDataEscapedDash;
|
||||
private _stateScriptDataEscapedDashDash;
|
||||
private _stateScriptDataEscapedLessThanSign;
|
||||
private _stateScriptDataEscapedEndTagOpen;
|
||||
private _stateScriptDataEscapedEndTagName;
|
||||
private _stateScriptDataDoubleEscapeStart;
|
||||
private _stateScriptDataDoubleEscaped;
|
||||
private _stateScriptDataDoubleEscapedDash;
|
||||
private _stateScriptDataDoubleEscapedDashDash;
|
||||
private _stateScriptDataDoubleEscapedLessThanSign;
|
||||
private _stateScriptDataDoubleEscapeEnd;
|
||||
private _stateBeforeAttributeName;
|
||||
private _stateAttributeName;
|
||||
private _stateAfterAttributeName;
|
||||
private _stateBeforeAttributeValue;
|
||||
private _stateAttributeValueDoubleQuoted;
|
||||
private _stateAttributeValueSingleQuoted;
|
||||
private _stateAttributeValueUnquoted;
|
||||
private _stateAfterAttributeValueQuoted;
|
||||
private _stateSelfClosingStartTag;
|
||||
private _stateBogusComment;
|
||||
private _stateMarkupDeclarationOpen;
|
||||
private _stateCommentStart;
|
||||
private _stateCommentStartDash;
|
||||
private _stateComment;
|
||||
private _stateCommentLessThanSign;
|
||||
private _stateCommentLessThanSignBang;
|
||||
private _stateCommentLessThanSignBangDash;
|
||||
private _stateCommentLessThanSignBangDashDash;
|
||||
private _stateCommentEndDash;
|
||||
private _stateCommentEnd;
|
||||
private _stateCommentEndBang;
|
||||
private _stateDoctype;
|
||||
private _stateBeforeDoctypeName;
|
||||
private _stateDoctypeName;
|
||||
private _stateAfterDoctypeName;
|
||||
private _stateAfterDoctypePublicKeyword;
|
||||
private _stateBeforeDoctypePublicIdentifier;
|
||||
private _stateDoctypePublicIdentifierDoubleQuoted;
|
||||
private _stateDoctypePublicIdentifierSingleQuoted;
|
||||
private _stateAfterDoctypePublicIdentifier;
|
||||
private _stateBetweenDoctypePublicAndSystemIdentifiers;
|
||||
private _stateAfterDoctypeSystemKeyword;
|
||||
private _stateBeforeDoctypeSystemIdentifier;
|
||||
private _stateDoctypeSystemIdentifierDoubleQuoted;
|
||||
private _stateDoctypeSystemIdentifierSingleQuoted;
|
||||
private _stateAfterDoctypeSystemIdentifier;
|
||||
private _stateBogusDoctype;
|
||||
private _stateCdataSection;
|
||||
private _stateCdataSectionBracket;
|
||||
private _stateCdataSectionEnd;
|
||||
private _stateCharacterReference;
|
||||
private _stateNamedCharacterReference;
|
||||
private _stateAmbiguousAmpersand;
|
||||
private _stateNumericCharacterReference;
|
||||
private _stateHexademicalCharacterReferenceStart;
|
||||
private _stateDecimalCharacterReferenceStart;
|
||||
private _stateHexademicalCharacterReference;
|
||||
private _stateDecimalCharacterReference;
|
||||
private _stateNumericCharacterReferenceEnd;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
2921
node_modules/parse5/dist/cjs/tokenizer/index.js
generated
vendored
Normal file
2921
node_modules/parse5/dist/cjs/tokenizer/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
37
node_modules/parse5/dist/cjs/tokenizer/preprocessor.d.ts
generated
vendored
Normal file
37
node_modules/parse5/dist/cjs/tokenizer/preprocessor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import { ERR, type ParserError, type ParserErrorHandler } from '../common/error-codes.js';
|
||||
export declare class Preprocessor {
|
||||
private handler;
|
||||
html: string;
|
||||
private pos;
|
||||
private lastGapPos;
|
||||
private gapStack;
|
||||
private skipNextNewLine;
|
||||
private lastChunkWritten;
|
||||
endOfChunkHit: boolean;
|
||||
bufferWaterline: number;
|
||||
private isEol;
|
||||
private lineStartPos;
|
||||
droppedBufferSize: number;
|
||||
line: number;
|
||||
constructor(handler: {
|
||||
onParseError?: ParserErrorHandler | null;
|
||||
});
|
||||
/** The column on the current line. If we just saw a gap (eg. a surrogate pair), return the index before. */
|
||||
get col(): number;
|
||||
get offset(): number;
|
||||
getError(code: ERR): ParserError;
|
||||
private lastErrOffset;
|
||||
private _err;
|
||||
private _addGap;
|
||||
private _processSurrogate;
|
||||
willDropParsedChunk(): boolean;
|
||||
dropParsedChunk(): void;
|
||||
write(chunk: string, isLastChunk: boolean): void;
|
||||
insertHtmlAtCurrentPos(chunk: string): void;
|
||||
startsWith(pattern: string, caseSensitive: boolean): boolean;
|
||||
peek(offset: number): number;
|
||||
advance(): number;
|
||||
private _checkForProblematicCharacters;
|
||||
retreat(count: number): void;
|
||||
}
|
||||
//# sourceMappingURL=preprocessor.d.ts.map
|
198
node_modules/parse5/dist/cjs/tokenizer/preprocessor.js
generated
vendored
Normal file
198
node_modules/parse5/dist/cjs/tokenizer/preprocessor.js
generated
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Preprocessor = void 0;
|
||||
const unicode_js_1 = require("../common/unicode.js");
|
||||
const error_codes_js_1 = require("../common/error-codes.js");
|
||||
//Const
|
||||
const DEFAULT_BUFFER_WATERLINE = 1 << 16;
|
||||
//Preprocessor
|
||||
//NOTE: HTML input preprocessing
|
||||
//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#preprocessing-the-input-stream)
|
||||
class Preprocessor {
|
||||
constructor(handler) {
|
||||
this.handler = handler;
|
||||
this.html = '';
|
||||
this.pos = -1;
|
||||
// NOTE: Initial `lastGapPos` is -2, to ensure `col` on initialisation is 0
|
||||
this.lastGapPos = -2;
|
||||
this.gapStack = [];
|
||||
this.skipNextNewLine = false;
|
||||
this.lastChunkWritten = false;
|
||||
this.endOfChunkHit = false;
|
||||
this.bufferWaterline = DEFAULT_BUFFER_WATERLINE;
|
||||
this.isEol = false;
|
||||
this.lineStartPos = 0;
|
||||
this.droppedBufferSize = 0;
|
||||
this.line = 1;
|
||||
//NOTE: avoid reporting errors twice on advance/retreat
|
||||
this.lastErrOffset = -1;
|
||||
}
|
||||
/** The column on the current line. If we just saw a gap (eg. a surrogate pair), return the index before. */
|
||||
get col() {
|
||||
return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos);
|
||||
}
|
||||
get offset() {
|
||||
return this.droppedBufferSize + this.pos;
|
||||
}
|
||||
getError(code) {
|
||||
const { line, col, offset } = this;
|
||||
return {
|
||||
code,
|
||||
startLine: line,
|
||||
endLine: line,
|
||||
startCol: col,
|
||||
endCol: col,
|
||||
startOffset: offset,
|
||||
endOffset: offset,
|
||||
};
|
||||
}
|
||||
_err(code) {
|
||||
if (this.handler.onParseError && this.lastErrOffset !== this.offset) {
|
||||
this.lastErrOffset = this.offset;
|
||||
this.handler.onParseError(this.getError(code));
|
||||
}
|
||||
}
|
||||
_addGap() {
|
||||
this.gapStack.push(this.lastGapPos);
|
||||
this.lastGapPos = this.pos;
|
||||
}
|
||||
_processSurrogate(cp) {
|
||||
//NOTE: try to peek a surrogate pair
|
||||
if (this.pos !== this.html.length - 1) {
|
||||
const nextCp = this.html.charCodeAt(this.pos + 1);
|
||||
if ((0, unicode_js_1.isSurrogatePair)(nextCp)) {
|
||||
//NOTE: we have a surrogate pair. Peek pair character and recalculate code point.
|
||||
this.pos++;
|
||||
//NOTE: add a gap that should be avoided during retreat
|
||||
this._addGap();
|
||||
return (0, unicode_js_1.getSurrogatePairCodePoint)(cp, nextCp);
|
||||
}
|
||||
}
|
||||
//NOTE: we are at the end of a chunk, therefore we can't infer the surrogate pair yet.
|
||||
else if (!this.lastChunkWritten) {
|
||||
this.endOfChunkHit = true;
|
||||
return unicode_js_1.CODE_POINTS.EOF;
|
||||
}
|
||||
//NOTE: isolated surrogate
|
||||
this._err(error_codes_js_1.ERR.surrogateInInputStream);
|
||||
return cp;
|
||||
}
|
||||
willDropParsedChunk() {
|
||||
return this.pos > this.bufferWaterline;
|
||||
}
|
||||
dropParsedChunk() {
|
||||
if (this.willDropParsedChunk()) {
|
||||
this.html = this.html.substring(this.pos);
|
||||
this.lineStartPos -= this.pos;
|
||||
this.droppedBufferSize += this.pos;
|
||||
this.pos = 0;
|
||||
this.lastGapPos = -2;
|
||||
this.gapStack.length = 0;
|
||||
}
|
||||
}
|
||||
write(chunk, isLastChunk) {
|
||||
if (this.html.length > 0) {
|
||||
this.html += chunk;
|
||||
}
|
||||
else {
|
||||
this.html = chunk;
|
||||
}
|
||||
this.endOfChunkHit = false;
|
||||
this.lastChunkWritten = isLastChunk;
|
||||
}
|
||||
insertHtmlAtCurrentPos(chunk) {
|
||||
this.html = this.html.substring(0, this.pos + 1) + chunk + this.html.substring(this.pos + 1);
|
||||
this.endOfChunkHit = false;
|
||||
}
|
||||
startsWith(pattern, caseSensitive) {
|
||||
// Check if our buffer has enough characters
|
||||
if (this.pos + pattern.length > this.html.length) {
|
||||
this.endOfChunkHit = !this.lastChunkWritten;
|
||||
return false;
|
||||
}
|
||||
if (caseSensitive) {
|
||||
return this.html.startsWith(pattern, this.pos);
|
||||
}
|
||||
for (let i = 0; i < pattern.length; i++) {
|
||||
const cp = this.html.charCodeAt(this.pos + i) | 0x20;
|
||||
if (cp !== pattern.charCodeAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
peek(offset) {
|
||||
const pos = this.pos + offset;
|
||||
if (pos >= this.html.length) {
|
||||
this.endOfChunkHit = !this.lastChunkWritten;
|
||||
return unicode_js_1.CODE_POINTS.EOF;
|
||||
}
|
||||
return this.html.charCodeAt(pos);
|
||||
}
|
||||
advance() {
|
||||
this.pos++;
|
||||
//NOTE: LF should be in the last column of the line
|
||||
if (this.isEol) {
|
||||
this.isEol = false;
|
||||
this.line++;
|
||||
this.lineStartPos = this.pos;
|
||||
}
|
||||
if (this.pos >= this.html.length) {
|
||||
this.endOfChunkHit = !this.lastChunkWritten;
|
||||
return unicode_js_1.CODE_POINTS.EOF;
|
||||
}
|
||||
let cp = this.html.charCodeAt(this.pos);
|
||||
//NOTE: all U+000D CARRIAGE RETURN (CR) characters must be converted to U+000A LINE FEED (LF) characters
|
||||
if (cp === unicode_js_1.CODE_POINTS.CARRIAGE_RETURN) {
|
||||
this.isEol = true;
|
||||
this.skipNextNewLine = true;
|
||||
return unicode_js_1.CODE_POINTS.LINE_FEED;
|
||||
}
|
||||
//NOTE: any U+000A LINE FEED (LF) characters that immediately follow a U+000D CARRIAGE RETURN (CR) character
|
||||
//must be ignored.
|
||||
if (cp === unicode_js_1.CODE_POINTS.LINE_FEED) {
|
||||
this.isEol = true;
|
||||
if (this.skipNextNewLine) {
|
||||
// `line` will be bumped again in the recursive call.
|
||||
this.line--;
|
||||
this.skipNextNewLine = false;
|
||||
this._addGap();
|
||||
return this.advance();
|
||||
}
|
||||
}
|
||||
this.skipNextNewLine = false;
|
||||
if ((0, unicode_js_1.isSurrogate)(cp)) {
|
||||
cp = this._processSurrogate(cp);
|
||||
}
|
||||
//OPTIMIZATION: first check if code point is in the common allowed
|
||||
//range (ASCII alphanumeric, whitespaces, big chunk of BMP)
|
||||
//before going into detailed performance cost validation.
|
||||
const isCommonValidRange = this.handler.onParseError === null ||
|
||||
(cp > 0x1f && cp < 0x7f) ||
|
||||
cp === unicode_js_1.CODE_POINTS.LINE_FEED ||
|
||||
cp === unicode_js_1.CODE_POINTS.CARRIAGE_RETURN ||
|
||||
(cp > 0x9f && cp < 64976);
|
||||
if (!isCommonValidRange) {
|
||||
this._checkForProblematicCharacters(cp);
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
_checkForProblematicCharacters(cp) {
|
||||
if ((0, unicode_js_1.isControlCodePoint)(cp)) {
|
||||
this._err(error_codes_js_1.ERR.controlCharacterInInputStream);
|
||||
}
|
||||
else if ((0, unicode_js_1.isUndefinedCodePoint)(cp)) {
|
||||
this._err(error_codes_js_1.ERR.noncharacterInInputStream);
|
||||
}
|
||||
}
|
||||
retreat(count) {
|
||||
this.pos -= count;
|
||||
while (this.pos < this.lastGapPos) {
|
||||
this.lastGapPos = this.gapStack.pop();
|
||||
this.pos--;
|
||||
}
|
||||
this.isEol = false;
|
||||
}
|
||||
}
|
||||
exports.Preprocessor = Preprocessor;
|
||||
//# sourceMappingURL=preprocessor.js.map
|
Reference in New Issue
Block a user