key-value-file
Version:
A simple key/value file parser/writer
25 lines (24 loc) • 935 B
TypeScript
/// <reference types="node" />
import { StringWalker } from 'string-walker';
import { Token, TokenType } from './token';
export declare class Tokenizer extends StringWalker {
private _tokens;
private spaceAndTab;
constructor(data: string | Buffer);
get tokens(): Token[];
tokenize(): Token[];
protected eatWhitespace(): void;
protected eatNewline(): void;
protected eatSpacesAndTabs(): void;
protected pushToken(type: TokenType, value: string): void;
protected pushCurrentToken(type: TokenType): void;
protected readKey(): void;
protected readValue(): void;
protected isQuoteChar(n?: number): boolean;
protected isCommentStart(n?: number): boolean;
protected isNewline(n?: number): boolean;
protected isSpaceOrTab(n?: number): boolean;
protected findStringEnd(): number;
protected handleTrailingComment(endpos: number): void;
protected readComment(): void;
}