/** * Copyright 2017 Matt Acosta * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { INode } from './INode'; import { ISyntaxNode } from '../syntax/ISyntaxNode'; import { Node } from './Node'; import { NodeFlags } from './NodeFlags'; import { NodeTransform } from './NodeTransform.Generated'; import { NodeVisitor } from './NodeVisitor.Generated'; import { SyntaxDiagnostic } from '../../diagnostics/SyntaxDiagnostic'; import { TokenKind } from '../TokenKind'; /** * A token that is not part of the language syntax. */ export declare class TriviaNode extends Node { /** * The type of the trivia token. */ readonly kind: TokenKind; /** * @inheritDoc */ protected _flags: NodeFlags; /** * @inheritDoc */ protected _fullWidth: number; /** * @inheritDoc */ protected hash: number; /** * Constructs a `TriviaNode` object. * * @param {TokenKind} kind * The type of the trivia token. * @param {number} fullWidth * The width of the trivia token. * @param {ReadonlyArray=} diagnostics * A list of diagnostics associated with the trivia token. */ constructor(kind: TokenKind, fullWidth: number, diagnostics?: ReadonlyArray); /** * @inheritDoc */ get flags(): NodeFlags; /** * @inheritDoc */ get fullWidth(): number; /** * @inheritDoc */ get isTrivia(): boolean; /** * @inheritDoc */ get leadingTriviaWidth(): number; /** * @inheritDoc */ accept(visitor: NodeVisitor): void; /** * @inheritDoc */ acceptResult(visitor: NodeTransform): T; /** * @inheritDoc */ childAt(index: number): INode | null; /** * @inheritDoc */ createSyntaxNode(parent: ISyntaxNode, offset: number): T; /** * @inheritDoc */ equals(value: TriviaNode): boolean; /** * @inheritDoc */ hashCode(): number; /** * @inheritDoc */ withDiagnostics(diagnostics: ReadonlyArray): TriviaNode; /** * @inheritDoc */ protected computeHashCode(): number; /** * @inheritDoc */ protected updateFlagsAndWidth(flags: NodeFlags, fullWidth: number): void; } /** * A token that was skipped by the parser. * * Skipped token nodes occur when neither the current parse context, nor any * enclosing contexts know how to handle a token. */ export declare class SkippedTokenNode extends TriviaNode { /** * Constructs a `SkippedTokenNode` object. * * @param {TokenKind} kind * The type of the skipped token. * @param {number} fullWidth * The width of the skipped token. * @param {ReadonlyArray=} diagnostics * A list of diagnostics associated with the skipped token. */ constructor(kind: TokenKind, fullWidth: number, diagnostics?: ReadonlyArray); /** * @inheritDoc */ withDiagnostics(diagnostics: ReadonlyArray): SkippedTokenNode; }