proc_macro
Version:
A JavaScript implementation of proc_macros.
28 lines • 1.01 kB
TypeScript
import Token from './token';
import { TokenStream } from '..';
declare type Delimiter = 'brace' | 'bracket' | 'parenthesis' | 'none';
/**
* A collection of tokens delimited by `{}`, `[]`, or `()`.
*/
export default class Group extends Token {
readonly delimiters: Delimiter;
readonly tokenStream: TokenStream;
constructor(delimiters: Delimiter, tokenStream: TokenStream);
eq(other: any): boolean;
static tokenize(tokenString: string): [Group, string];
/**
* Converts the char representation of delimiter into string type.
* @param char Delimiter to conver to string.
*/
static getDelimiterType(char: string): Delimiter;
static getDelimiters(delimiter: Delimiter): [string, string];
/**
* Gets the closing delimiter from the open delimiter.
* @param char The open delimiter.
*/
static getClosingDelimiter(char: string): string;
toParenthesisString(): string;
toJavaScript(): string;
}
export {};
//# sourceMappingURL=group.d.ts.map