Class: Tokenizer

Hierarchy

  • Tokenizer

Constructors

constructor

+ new Tokenizer(input: string, file: string): Tokenizer

Defined in parser/tokenizer.ts:29

Parameters:

Name Type Default
input string -
file string “”

Returns: Tokenizer

Properties

N

N: number

Defined in parser/tokenizer.ts:28


Private file

file: string

Defined in parser/tokenizer.ts:33


Private input

input: string

Defined in parser/tokenizer.ts:32


p

p: number = 0

Defined in parser/tokenizer.ts:27


Private rawBeginAt

rawBeginAt: number = -1

Defined in parser/tokenizer.ts:29

Methods

advance

advance(i: number): void

Defined in parser/tokenizer.ts:230

Parameters:

Name Type Default
i number 1

Returns: void


end

end(): boolean

Defined in parser/tokenizer.ts:234

Returns: boolean


match

match(word: string): boolean

Defined in parser/tokenizer.ts:325

Parameters:

Name Type
word string

Returns: boolean


mkError

mkError(msg: string, begin: number): TokenizationError

Defined in parser/tokenizer.ts:178

Parameters:

Name Type
msg string
begin number

Returns: TokenizationError


peek

peek(n: number): string

Defined in parser/tokenizer.ts:343

Parameters:

Name Type Default
n number 0

Returns: string


peekType

peekType(n: number): number

Defined in parser/tokenizer.ts:339

Parameters:

Name Type Default
n number 0

Returns: number


readEndrawOrRawContent

readEndrawOrRawContent(options: NormalizedFullOptions): HTMLToken | TagToken

Defined in parser/tokenizer.ts:151

Parameters:

Name Type
options NormalizedFullOptions

Returns: HTMLToken | TagToken


readExpression

readExpression(): IterableIterator‹Token

Defined in parser/tokenizer.ts:38

Returns: IterableIterator‹Token


readFileName

readFileName(): IdentifierToken

Defined in parser/tokenizer.ts:319

Returns: IdentifierToken


readFilter

readFilter(): FilterToken | null

Defined in parser/tokenizer.ts:69

Returns: FilterToken | null


readFilterArg

readFilterArg(): FilterArg | undefined

Defined in parser/tokenizer.ts:90

Returns: FilterArg | undefined


readFilters

readFilters(): FilterToken[]

Defined in parser/tokenizer.ts:61

Returns: FilterToken[]


readHTMLToken

readHTMLToken(options: NormalizedFullOptions): HTMLToken

Defined in parser/tokenizer.ts:118

Parameters:

Name Type
options NormalizedFullOptions

Returns: HTMLToken


readHash

readHash(): HashToken | undefined

Defined in parser/tokenizer.ts:210

Returns: HashToken | undefined


readHashes

readHashes(): HashToken[]

Defined in parser/tokenizer.ts:201

Returns: HashToken[]


readIdentifier

readIdentifier(): IdentifierToken

Defined in parser/tokenizer.ts:194

Returns: IdentifierToken


readOperator

readOperator(): OperatorToken | undefined

Defined in parser/tokenizer.ts:55

Returns: OperatorToken | undefined


readOutputToken

readOutputToken(options: NormalizedFullOptions): OutputToken

Defined in parser/tokenizer.ts:141

Parameters:

Name Type
options NormalizedFullOptions

Returns: OutputToken


readQuoted

readQuoted(): QuotedToken | undefined

Defined in parser/tokenizer.ts:304

Returns: QuotedToken | undefined


readRange

readRange(): RangeToken | undefined

Defined in parser/tokenizer.ts:286

Returns: RangeToken | undefined


readTagToken

readTagToken(options: NormalizedFullOptions): TagToken

Defined in parser/tokenizer.ts:129

Parameters:

Name Type
options NormalizedFullOptions

Returns: TagToken


readTo

readTo(end: string): number

Defined in parser/tokenizer.ts:238

Parameters:

Name Type
end string

Returns: number


readTopLevelToken

readTopLevelToken(options: NormalizedFullOptions): TopLevelToken

Defined in parser/tokenizer.ts:110

Parameters:

Name Type
options NormalizedFullOptions

Returns: TopLevelToken


readTopLevelTokens

readTopLevelTokens(options: NormalizedFullOptions): TopLevelToken[]

Defined in parser/tokenizer.ts:100

Parameters:

Name Type Default
options NormalizedFullOptions defaultOptions

Returns: TopLevelToken[]


readValue

readValue(): ValueToken | undefined

Defined in parser/tokenizer.ts:246

Returns: ValueToken | undefined


readValueOrThrow

readValueOrThrow(): ValueToken

Defined in parser/tokenizer.ts:298

Returns: ValueToken


readWord

readWord(): IdentifierToken

Defined in parser/tokenizer.ts:189

deprecated

Returns: IdentifierToken


remaining

remaining(): string

Defined in parser/tokenizer.ts:226

Returns: string


rmatch

rmatch(pattern: string): boolean

Defined in parser/tokenizer.ts:332

Parameters:

Name Type
pattern string

Returns: boolean


skipBlank

skipBlank(): void

Defined in parser/tokenizer.ts:347

Returns: void


snapshot

snapshot(begin: number): string

Defined in parser/tokenizer.ts:182

Parameters:

Name Type Default
begin number this.p

Returns: string