decaffeinate-parser
Version:
A better AST for CoffeeScript, inspired by CoffeeScriptRedux.
17 lines (16 loc) • 755 B
TypeScript
import { Base } from 'decaffeinate-coffeescript2/lib/coffeescript/nodes';
import { Quasi } from '../nodes';
import ParseContext from './ParseContext';
export declare type TemplateLiteralComponents = {
quasis: Array<Quasi>;
unmappedExpressions: Array<Base | null>;
start: number;
end: number;
};
/**
* Reconstruct template literal information given the coffee-lex tokens and the
* CoffeeScript AST. Since the CoffeeScript AST doesn't attempt to represent a
* template literal (it's a bunch of + operations instead), the source locations
* are generally unreliable and we need to rely on the token locations instead.
*/
export default function getTemplateLiteralComponents(context: ParseContext, node: Base): TemplateLiteralComponents;