aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/css-tree/lib/definition-syntax/SyntaxError.js
blob: 5f631387dfa79a325c00947c104e63523220c8f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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('-') + '^'
    });
};