UNPKG

css-tree

Version:

A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations

13 lines (11 loc) 408 B
import { createCustomError } from '../utils/create-custom-error.js'; export function SyntaxError(message, input, offset) { return Object.assign(createCustomError('SyntaxError', message), { input, offset, rawMessage: message, message: message + '\n' + ' ' + input + '\n' + '--' + new Array((offset || input.length) + 1).join('-') + '^' }); };