diff --git a/docs/Exports.md b/docs/Exports.md index dd8a1f4..fb9e3dd 100644 --- a/docs/Exports.md +++ b/docs/Exports.md @@ -37,6 +37,71 @@ Default: `{ prefixes: ['--'] }` Set this option to modify how variables are identified in a value. By default, this option is set to recognize CSS variables. For languages such as LESS and SCSS which have their own variable prefixes, additional prefixes can be added to the `prefixes` array. +##### `context` +Type: [`postcss.Input`][]
+Default: `undefined` + +[`postcss.Input`]: http://api.postcss.org/Input.html + +Set this option along with [`lineInContext`][] and [`columnInContext`][] to indicate the value's location in a larger CSS file that's been parsed by PostCSS. When these options are set, the values' `source` properties will refer to their locations inside the original CSS file which produces better error messages. + +[`lineInContext`]: #lineincontext +[`columnInContext`]: #columnincontext + +If this is set, `lineInContext` and `columnInContext` must be set as well. The [`parseDeclValue()`][] and [`parseAtRuleParams()`][] functions automatically set these options appropriately. + +[`parseDeclValue()`]: #parsedeclvaluedecl-options +[`parseAtRuleParams()`]: #parseatruleparamsrule-options + +##### `lineInContext` +Type: `Number`
+Default: `undefined` + +Indicates the line number in the [`context`][] on which the value being parsed begins. + +[`context`]: #context + +If this is set, `context` and [`columnInContext`][] must be set as well. The [`parseDeclValue()`][] and [`parseAtRuleParams()`][] functions automatically set these options appropriately. + +##### `columnInContext` +Type: `Number`
+Default: `undefined` + +Indicates the column number in the [`context`][] on which the value being parsed begins. + +If this is set, `context` and [`lineInContext`][] must be set as well. The [`parseDeclValue()`][] and [`parseAtRuleParams()`][] functions automatically set these options appropriately. + +### `parseDeclValue(decl, options)` + +A shorthand for calling [`parse()`][] on the value of a [`postcss.Declaration`][] object. This automatically sets the [`context`][], [`lineInContext`][], and [`columnInContext`][] options appropriately. + +[`postcss.Declaration`]: http://api.postcss.org/Declaration.html +[`parse()`]: #parsecss-options + +#### Parameters + +#### `decl` +Type: [`postcss.Declaration`][]
+_Required_ + +#### `options` +Type: `Object` + +### `parseAtRuleParams(rule, options)` + +A shorthand for calling [`parse()`][] on the parameters of a [`postcss.AtRule`][] object. This automatically sets the [`context`][], [`lineInContext`][], and [`columnInContext`][] options appropriately. + +[`postcss.AtRule`]: http://api.postcss.org/AtRule.html + +#### Parameters + +#### `decl` +Type: [`postcss.AtRule`][]
+_Required_ + +#### `options` +Type: `Object` + ### `stringify(node, builder)` A `Function` with a signature matching `(bit) => {}` used to concatenate or manipulate each portion (or bit) of the Node's own AST. The `nodeToString` method makes use of this, as a simple example. diff --git a/lib/SubInput.js b/lib/SubInput.js new file mode 100644 index 0000000..3c2030e --- /dev/null +++ b/lib/SubInput.js @@ -0,0 +1,56 @@ +/* + Copyright © 2018 Andrew Powell + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of this Source Code Form. +*/ + +// A PostCSS Input that exposes a substring of a larger Input as though it were +// the entire text to be parsed. +module.exports = class SubInput { + constructor(css, context, lineInContext, columnInContext) { + this.css = css; + this.context = context; + this.lineInContext = lineInContext; + this.columnInContext = columnInContext; + } + + error(message, line, column, opts = {}) { + let lineInContext; + let columnInContext; + if (line === 1) { + lineInContext = this.lineInContext; // eslint-disable-line prefer-destructuring + columnInContext = column + this.columnInContext - 1; + } else { + lineInContext = this.lineInContext + line - 1; + columnInContext = column; + } + + return this.context.error(message, lineInContext, columnInContext, opts); + } + + origin(line, column) { + let lineInContext; + let columnInContext; + if (line === 1) { + lineInContext = this.lineInContext; // eslint-disable-line prefer-destructuring + columnInContext = column + this.columnInContext - 1; + } else { + lineInContext = this.lineInContext + line - 1; + } + + return this.context.origin(lineInContext, columnInContext); + } + + mapResolve(file) { + return this.context.mapResolve(file); + } + + get from() { + return this.context.from; + } +}; diff --git a/lib/index.d.ts b/lib/index.d.ts index 97488dd..eda5d92 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -205,12 +205,28 @@ export interface Word extends NodeBase { export function parse(css: string, options?: ParseOptions): Root; -export interface ParseOptions { +export function parseDeclValue( + decl: postcss.Declaration, + options?: ParseOptionsWithoutContext +): Root; + +export function parseAtRuleParams( + rule: postcss.AtRule, + options?: ParseOptions +): Root; + +export interface ParseOptionsWithoutContext { ignoreUnknownWords?: boolean; interpolation?: boolean | InterpolationOptions; variables?: VariablesOptions; } +export interface ParseOptions extends ParseOptionsWithoutContext { + context: postcss.Input; + lineInContext: Number; + columnInContext: Number; +} + export interface InterpolationOptions { prefix: string; } diff --git a/lib/index.js b/lib/index.js index c8cf4ac..504a28f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -11,11 +11,58 @@ const Input = require('postcss/lib/input'); const Parser = require('./ValuesParser'); +const SubInput = require('./SubInput'); const { stringify } = require('./ValuesStringifier'); +const NEWLINE = '\n'.charCodeAt(0); +const FEED = '\f'.charCodeAt(0); +const CR = '\r'.charCodeAt(0); + +function positionAfter(node, chunks) { + let { line } = node.source.start; + let { column } = node.source.start; + for (const chunk of chunks) { + for (let i = 0; i < chunk.length; i++) { + const code = chunk.charCodeAt(i); + if ( + code === NEWLINE || + code === FEED || + (code === CR && chunk.charCodeAt(i + 1) !== NEWLINE) + ) { + column = 1; + line += 1; + } else { + column += 1; + } + } + } + + return { line, column }; +} + module.exports = { - parse(css, options) { - const input = new Input(css, options); + parse(css, opts) { + const options = opts || {}; + + let input; + if (options.context) { + if (!options.lineInContext || !options.columnInContext) { + throw new RangeError( + 'If the context option is passed, lineInContext and ' + + 'columnInContext must also be passed.' + ); + } + + input = new SubInput(css, options.context, options.lineInContext, options.columnInContext); + } else if (options.lineInContext || options.columnInContext) { + throw new RangeError( + "If the context option isn't passed, lineInContext and " + + 'columnInContext may not be passed.' + ); + } else { + input = new Input(css, options); + } + const parser = new Parser(input, options); parser.parse(); @@ -32,6 +79,26 @@ module.exports = { return parser.root; }, + parseDeclValue(decl, options) { + const { line, column } = positionAfter(decl, [decl.prop, decl.raws.between]); + return module.exports.parse(decl.value, { + ...options, + context: decl.source.input, + lineInContext: line, + columnInContext: column + }); + }, + + parseAtRuleParams(rule, options) { + const { line, column } = positionAfter(rule, ['@', rule.name, rule.raws.afterName]); + return module.exports.parse(rule.params, { + ...options, + context: rule.source.input, + lineInContext: line, + columnInContext: column + }); + }, + stringify, nodeToString(node) { diff --git a/lib/nodes/Func.js b/lib/nodes/Func.js index a4433de..e6fe3c9 100644 --- a/lib/nodes/Func.js +++ b/lib/nodes/Func.js @@ -86,7 +86,12 @@ class Func extends Container { // use a new parser to parse the params of the function. recursion here makes for easier maint // we must require this here due to circular dependency resolution const { parse } = require('../'); // eslint-disable-line global-require - const root = parse(params, opts); + const root = parse(params, { + ...opts, + context: parser.input, + lineInContext: brackets[2], + columnInContext: brackets[3] + 1 + }); const { nodes: children } = root; // TODO: correct line and character position (should we just pad the input? probably easiest) diff --git a/lib/nodes/Interpolation.js b/lib/nodes/Interpolation.js index 4f81edd..74cda29 100644 --- a/lib/nodes/Interpolation.js +++ b/lib/nodes/Interpolation.js @@ -66,7 +66,12 @@ class Interpolation extends Container { // use a new parser to parse the params of the function. recursion here makes for easier maint // we must require this here due to circular dependency resolution const { parse } = require('../'); // eslint-disable-line global-require - const { nodes: children } = parse(params, parser.options); + const { nodes: children } = parse(params, { + ...parser.options, + context: parser.input, + lineInContext: first[2], + columnInContext: first[3] + first[1].length + 1 + }); // TODO: correct line and character position (should we just pad the input? probably easiest) for (const child of children) { diff --git a/package-lock.json b/package-lock.json index 921bc1a..ba34905 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5161,6 +5161,15 @@ } } }, + "postcss-scss": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-2.0.0.tgz", + "integrity": "sha512-um9zdGKaDZirMm+kZFKKVsnKPF7zF7qBAtIfTSnZXD1jZ0JNZIxdB6TxQOjCnlSzLRInVl2v3YdBh/M881C4ug==", + "dev": true, + "requires": { + "postcss": "^7.0.0" + } + }, "postcss-value-parser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.0.tgz", diff --git a/package.json b/package.json index a9dab4a..17dcda6 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "lint-staged": "^10.0.8", "nyc": "^15.0.0", "perfy": "^1.1.5", + "postcss-scss": "^2.0.0", "postcss-value-parser": "^4.0.0", "postcss-values-parser": "^3.0.3", "pre-commit": "^1.2.2", diff --git a/test/errors.test.js b/test/errors.test.js new file mode 100644 index 0000000..fb5245d --- /dev/null +++ b/test/errors.test.js @@ -0,0 +1,79 @@ +/* + Copyright © 2020 Andrew Powell + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of this Source Code Form. +*/ +const test = require('ava'); + +const postcss = require('postcss'); +const scss = require('postcss-scss'); + +const { parse, parseDeclValue, parseAtRuleParams } = require('../lib'); + +const { throws, functionCall } = require('./fixtures/errors'); + +function snapshotError(t, callback) { + try { + callback(); + throw Error('Expected an error.'); + } catch (error) { + if (!('showSourceCode' in error)) { + throw error; + } + + t.snapshot(error); + t.snapshot(error.showSourceCode(false)); + } +} + +test(throws.decl, (t) => { + const root = postcss.parse(throws.decl, { + from: 'file:///fixtures/errors.js' + }); + snapshotError(t, () => parseDeclValue(root.nodes[0].nodes[0])); +}); + +test(throws.atRule, (t) => { + const root = postcss.parse(throws.atRule, { + from: 'file:///fixtures/errors.js' + }); + snapshotError(t, () => parseAtRuleParams(root.nodes[0])); +}); + +test(throws.interpolation, (t) => { + const root = scss.parse(throws.interpolation, { + from: 'file:///fixtures/errors.js' + }); + + const [decl] = root.nodes[0].nodes; + snapshotError(t, () => + parse(decl.prop, { + interpolation: { prefix: '#' }, + context: root.source.input, + lineInContext: decl.source.start.line, + columnInContext: decl.source.start.column + }) + ); +}); + +test(functionCall, (t) => { + const root = scss.parse(functionCall, { + from: 'file:///fixtures/errors.js' + }); + + const value = parseDeclValue(root.nodes[0].nodes[0]); + value.walk((node) => { + delete node.parent; // eslint-disable-line no-param-reassign + }); + + snapshotError(t, () => + value.walkFuncs((func) => { + if (func.name === 'var') throw func.error('Undefined variable!'); + }) + ); +}); diff --git a/test/fixtures/errors.js b/test/fixtures/errors.js new file mode 100644 index 0000000..1370359 --- /dev/null +++ b/test/fixtures/errors.js @@ -0,0 +1,18 @@ +/* + Copyright © 2020 Andrew Powell + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of this Source Code Form. +*/ +module.exports = { + throws: { + decl: 'a {\n b: +-2.;\n}', + atRule: '@foo +-2. {\n a {\n b: c;\n }\n}', + interpolation: 'a {\n background-#{+-2.}: white;\n}' + }, + functionCall: 'p {\n color: rgb(var(--some-color) / 70%);\n}' +}; diff --git a/test/snapshots/atword.test.js.md b/test/snapshots/atword.test.js.md index e5c8980..2537d89 100644 --- a/test/snapshots/atword.test.js.md +++ b/test/snapshots/atword.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `atword.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## @word diff --git a/test/snapshots/comment.test.js.md b/test/snapshots/comment.test.js.md index 1d77c3e..9a02279 100644 --- a/test/snapshots/comment.test.js.md +++ b/test/snapshots/comment.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `comment.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## /**/ diff --git a/test/snapshots/errors.test.js.md b/test/snapshots/errors.test.js.md new file mode 100644 index 0000000..e6dd4cd --- /dev/null +++ b/test/snapshots/errors.test.js.md @@ -0,0 +1,226 @@ +# Snapshot report for `test/errors.test.js` + +The actual snapshot is saved in `errors.test.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## @foo +-2. { + a { + b: c; + } +} + +> Snapshot 1 + + CssSyntaxError { + column: 6, + file: 'file:///fixtures/errors.js', + input: { + column: 6, + file: 'file:///fixtures/errors.js', + line: 1, + source: `@foo +-2. {␊ + a {␊ + b: c;␊ + }␊ + }`, + }, + line: 1, + reason: 'Unknown word', + source: `@foo +-2. {␊ + a {␊ + b: c;␊ + }␊ + }`, + message: 'file:///fixtures/errors.js:1:6: Unknown word', + } + +> Snapshot 2 + + `> 1 | @foo +-2. {␊ + | ^␊ + 2 | a {␊ + 3 | b: c;` + +## a { + b: +-2.; +} + +> Snapshot 1 + + CssSyntaxError { + column: 6, + file: 'file:///fixtures/errors.js', + input: { + column: 6, + file: 'file:///fixtures/errors.js', + line: 2, + source: `a {␊ + b: +-2.;␊ + }`, + }, + line: 2, + reason: 'Unknown word', + source: `a {␊ + b: +-2.;␊ + }`, + message: 'file:///fixtures/errors.js:2:6: Unknown word', + } + +> Snapshot 2 + + ` 1 | a {␊ + > 2 | b: +-2.;␊ + | ^␊ + 3 | }` + +## a { + background-#{+-2.}: white; +} + +> Snapshot 1 + + CssSyntaxError { + column: 16, + file: 'file:///fixtures/errors.js', + input: { + column: 16, + file: 'file:///fixtures/errors.js', + line: 2, + source: `a {␊ + background-#{+-2.}: white;␊ + }`, + }, + line: 2, + reason: 'Unknown word', + source: `a {␊ + background-#{+-2.}: white;␊ + }`, + message: 'file:///fixtures/errors.js:2:16: Unknown word', + } + +> Snapshot 2 + + ` 1 | a {␊ + > 2 | background-#{+-2.}: white;␊ + | ^␊ + 3 | }` + +## p { + color: rgb(var(--some-color) / 70%); +} + +> Snapshot 1 + + CssSyntaxError { + column: 14, + file: 'file:///fixtures/errors.js', + input: { + column: 14, + file: 'file:///fixtures/errors.js', + line: 2, + source: `p {␊ + color: rgb(var(--some-color) / 70%);␊ + }`, + }, + line: 2, + postcssNode: Func { + indexes: {}, + isColor: false, + isVar: true, + lastEach: 1, + name: 'var', + nodes: [ + Word { + isColor: false, + isHex: false, + isUrl: false, + isVariable: true, + raws: { + after: '', + before: '', + }, + source: { + end: { + column: 1, + line: 1, + }, + input: SubInput { + columnInContext: 5, + context: SubInput { + columnInContext: 5, + context: SubInput { + columnInContext: 10, + context: Input { + css: `p {␊ + color: rgb(var(--some-color) / 70%);␊ + }`, + file: 'file:///fixtures/errors.js', + hasBOM: false, + }, + css: 'rgb(var(--some-color) / 70%)', + lineInContext: 2, + }, + css: 'var(--some-color) / 70%', + lineInContext: 1, + }, + css: '--some-color', + lineInContext: 1, + }, + start: { + column: 1, + line: 1, + }, + }, + type: 'word', + value: '--some-color', + }, + ], + params: '(--some-color)', + raws: { + after: '', + before: '', + semicolon: false, + }, + source: { + end: { + column: 4, + line: 1, + }, + input: SubInput { + columnInContext: 5, + context: SubInput { + columnInContext: 10, + context: Input { + css: `p {␊ + color: rgb(var(--some-color) / 70%);␊ + }`, + file: 'file:///fixtures/errors.js', + hasBOM: false, + }, + css: 'rgb(var(--some-color) / 70%)', + lineInContext: 2, + }, + css: 'var(--some-color) / 70%', + lineInContext: 1, + }, + start: { + column: 1, + line: 1, + }, + }, + type: 'func', + }, + reason: 'Undefined variable!', + source: `p {␊ + color: rgb(var(--some-color) / 70%);␊ + }`, + message: 'file:///fixtures/errors.js:2:14: Undefined variable!', + } + +> Snapshot 2 + + ` 1 | p {␊ + > 2 | color: rgb(var(--some-color) / 70%);␊ + | ^␊ + 3 | }` diff --git a/test/snapshots/errors.test.js.snap b/test/snapshots/errors.test.js.snap new file mode 100644 index 0000000..ac2338b Binary files /dev/null and b/test/snapshots/errors.test.js.snap differ diff --git a/test/snapshots/func.test.js.md b/test/snapshots/func.test.js.md index 6142d51..b0fe4fe 100644 --- a/test/snapshots/func.test.js.md +++ b/test/snapshots/func.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `func.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## -webkit-linear-gradient(0) @@ -33,10 +33,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 25, + context: Input { + css: '-webkit-linear-gradient(0)', + hasBOM: false, + id: '', + }, css: '0', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -62,7 +67,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '-webkit-linear-gradient(0)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -102,10 +107,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RGBA( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -127,10 +137,15 @@ Generated by [AVA](https://ava.li). column: 4, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RGBA( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 4, @@ -151,10 +166,15 @@ Generated by [AVA](https://ava.li). column: 6, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RGBA( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 6, @@ -176,10 +196,15 @@ Generated by [AVA](https://ava.li). column: 10, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RGBA( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 10, @@ -200,10 +225,15 @@ Generated by [AVA](https://ava.li). column: 12, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RGBA( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 12, @@ -229,7 +259,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'RGBA( 29, 439 , 29 )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -269,10 +299,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RgBa( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -294,10 +329,15 @@ Generated by [AVA](https://ava.li). column: 4, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RgBa( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 4, @@ -318,10 +358,15 @@ Generated by [AVA](https://ava.li). column: 6, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RgBa( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 6, @@ -343,10 +388,15 @@ Generated by [AVA](https://ava.li). column: 10, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RgBa( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 10, @@ -367,10 +417,15 @@ Generated by [AVA](https://ava.li). column: 12, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'RgBa( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 12, @@ -396,7 +451,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'RgBa( 29, 439 , 29 )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -445,10 +500,20 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: SubInput { + columnInContext: 5, + context: Input { + css: 'bar(baz(black, 10%), 10%)', + hasBOM: false, + id: '', + }, + css: 'baz(black, 10%), 10%', + lineInContext: 1, + }, css: 'black, 10%', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -469,10 +534,20 @@ Generated by [AVA](https://ava.li). column: 6, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: SubInput { + columnInContext: 5, + context: Input { + css: 'bar(baz(black, 10%), 10%)', + hasBOM: false, + id: '', + }, + css: 'baz(black, 10%), 10%', + lineInContext: 1, + }, css: 'black, 10%', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 6, @@ -493,10 +568,20 @@ Generated by [AVA](https://ava.li). column: 8, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: SubInput { + columnInContext: 5, + context: Input { + css: 'bar(baz(black, 10%), 10%)', + hasBOM: false, + id: '', + }, + css: 'baz(black, 10%), 10%', + lineInContext: 1, + }, css: 'black, 10%', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 8, @@ -520,10 +605,15 @@ Generated by [AVA](https://ava.li). column: 4, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'bar(baz(black, 10%), 10%)', + hasBOM: false, + id: '', + }, css: 'baz(black, 10%), 10%', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -543,10 +633,15 @@ Generated by [AVA](https://ava.li). column: 16, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'bar(baz(black, 10%), 10%)', + hasBOM: false, + id: '', + }, css: 'baz(black, 10%), 10%', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 16, @@ -567,10 +662,15 @@ Generated by [AVA](https://ava.li). column: 18, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'bar(baz(black, 10%), 10%)', + hasBOM: false, + id: '', + }, css: 'baz(black, 10%), 10%', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 18, @@ -596,7 +696,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'bar(baz(black, 10%), 10%)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -636,10 +736,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -660,10 +765,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -684,10 +794,15 @@ Generated by [AVA](https://ava.li). column: 3, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 3, @@ -709,10 +824,15 @@ Generated by [AVA](https://ava.li). column: 9, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 9, @@ -733,10 +853,15 @@ Generated by [AVA](https://ava.li). column: 11, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 11, @@ -758,10 +883,15 @@ Generated by [AVA](https://ava.li). column: 16, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 16, @@ -782,10 +912,15 @@ Generated by [AVA](https://ava.li). column: 18, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 18, @@ -806,10 +941,15 @@ Generated by [AVA](https://ava.li). column: 20, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 20, @@ -831,10 +971,15 @@ Generated by [AVA](https://ava.li). column: 21, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 21, @@ -855,10 +1000,15 @@ Generated by [AVA](https://ava.li). column: 23, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 23, @@ -879,10 +1029,15 @@ Generated by [AVA](https://ava.li). column: 25, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(((768px - 100vw) / 2) - 15px)', + hasBOM: false, + id: '', + }, css: '((768px - 100vw) / 2) - 15px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 25, @@ -908,7 +1063,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'calc(((768px - 100vw) / 2) - 15px)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -948,10 +1103,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(-0.5 * var(foo))', + hasBOM: false, + id: '', + }, css: '-0.5 * var(foo)', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -973,10 +1133,15 @@ Generated by [AVA](https://ava.li). column: 6, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(-0.5 * var(foo))', + hasBOM: false, + id: '', + }, css: '-0.5 * var(foo)', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 6, @@ -1006,10 +1171,20 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 12, + context: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(-0.5 * var(foo))', + hasBOM: false, + id: '', + }, + css: '-0.5 * var(foo)', + lineInContext: 1, + }, css: 'foo', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -1032,10 +1207,15 @@ Generated by [AVA](https://ava.li). column: 11, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(-0.5 * var(foo))', + hasBOM: false, + id: '', + }, css: '-0.5 * var(foo)', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 8, @@ -1059,7 +1239,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'calc(-0.5 * var(foo))', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -1099,10 +1279,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(1px + -2vw - 4px)', + hasBOM: false, + id: '', + }, css: '1px + -2vw - 4px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -1124,10 +1309,15 @@ Generated by [AVA](https://ava.li). column: 5, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(1px + -2vw - 4px)', + hasBOM: false, + id: '', + }, css: '1px + -2vw - 4px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 5, @@ -1148,10 +1338,15 @@ Generated by [AVA](https://ava.li). column: 7, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(1px + -2vw - 4px)', + hasBOM: false, + id: '', + }, css: '1px + -2vw - 4px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 7, @@ -1173,10 +1368,15 @@ Generated by [AVA](https://ava.li). column: 12, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(1px + -2vw - 4px)', + hasBOM: false, + id: '', + }, css: '1px + -2vw - 4px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 12, @@ -1197,10 +1397,15 @@ Generated by [AVA](https://ava.li). column: 14, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'calc(1px + -2vw - 4px)', + hasBOM: false, + id: '', + }, css: '1px + -2vw - 4px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 14, @@ -1226,7 +1431,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'calc(1px + -2vw - 4px)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -1266,10 +1471,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'rgba( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -1291,10 +1501,15 @@ Generated by [AVA](https://ava.li). column: 4, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'rgba( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 4, @@ -1315,10 +1530,15 @@ Generated by [AVA](https://ava.li). column: 6, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'rgba( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 6, @@ -1340,10 +1560,15 @@ Generated by [AVA](https://ava.li). column: 10, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'rgba( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 10, @@ -1364,10 +1589,15 @@ Generated by [AVA](https://ava.li). column: 12, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 6, + context: Input { + css: 'rgba( 29, 439 , 29 )', + hasBOM: false, + id: '', + }, css: ' 29, 439 , 29 ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 12, @@ -1393,7 +1623,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'rgba( 29, 439 , 29 )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -1434,10 +1664,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( "/gfx/img/bg.jpg" )', + hasBOM: false, + id: '', + }, css: ' "/gfx/img/bg.jpg" ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -1462,7 +1697,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url( "/gfx/img/bg.jpg" )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -1503,10 +1738,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( "http://domain.com/gfx/img/bg.jpg" )', + hasBOM: false, + id: '', + }, css: ' "http://domain.com/gfx/img/bg.jpg" ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -1531,7 +1771,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url( "http://domain.com/gfx/img/bg.jpg" )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -1572,10 +1812,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( \'/gfx/img/bg.jpg\' )', + hasBOM: false, + id: '', + }, css: ' \'/gfx/img/bg.jpg\' ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -1600,7 +1845,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url( \'/gfx/img/bg.jpg\' )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -1641,10 +1886,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( \'http://domain.com/gfx/img/bg.jpg\' )', + hasBOM: false, + id: '', + }, css: ' \'http://domain.com/gfx/img/bg.jpg\' ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -1669,7 +1919,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url( \'http://domain.com/gfx/img/bg.jpg\' )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -1709,10 +1959,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( /gfx/img/bg.jpg )', + hasBOM: false, + id: '', + }, css: ' /gfx/img/bg.jpg ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -1737,10 +1992,15 @@ Generated by [AVA](https://ava.li). column: 3, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( /gfx/img/bg.jpg )', + hasBOM: false, + id: '', + }, css: ' /gfx/img/bg.jpg ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 3, @@ -1761,10 +2021,15 @@ Generated by [AVA](https://ava.li). column: 6, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( /gfx/img/bg.jpg )', + hasBOM: false, + id: '', + }, css: ' /gfx/img/bg.jpg ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 6, @@ -1789,10 +2054,15 @@ Generated by [AVA](https://ava.li). column: 7, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( /gfx/img/bg.jpg )', + hasBOM: false, + id: '', + }, css: ' /gfx/img/bg.jpg ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 7, @@ -1813,10 +2083,15 @@ Generated by [AVA](https://ava.li). column: 10, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( /gfx/img/bg.jpg )', + hasBOM: false, + id: '', + }, css: ' /gfx/img/bg.jpg ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 10, @@ -1841,10 +2116,15 @@ Generated by [AVA](https://ava.li). column: 11, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url( /gfx/img/bg.jpg )', + hasBOM: false, + id: '', + }, css: ' /gfx/img/bg.jpg ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 11, @@ -1869,7 +2149,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url( /gfx/img/bg.jpg )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -1910,10 +2190,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url("/gfx/img/bg.jpg" hello )', + hasBOM: false, + id: '', + }, css: '"/gfx/img/bg.jpg" hello ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -1938,10 +2223,15 @@ Generated by [AVA](https://ava.li). column: 19, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url("/gfx/img/bg.jpg" hello )', + hasBOM: false, + id: '', + }, css: '"/gfx/img/bg.jpg" hello ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 19, @@ -1966,7 +2256,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url("/gfx/img/bg.jpg" hello )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -2007,10 +2297,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url("http://domain.com/gfx/img/bg.jpg" hello )', + hasBOM: false, + id: '', + }, css: '"http://domain.com/gfx/img/bg.jpg" hello ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -2035,10 +2330,15 @@ Generated by [AVA](https://ava.li). column: 36, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url("http://domain.com/gfx/img/bg.jpg" hello )', + hasBOM: false, + id: '', + }, css: '"http://domain.com/gfx/img/bg.jpg" hello ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 36, @@ -2063,7 +2363,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url("http://domain.com/gfx/img/bg.jpg" hello )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -2272,10 +2572,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url(//123.example.com)', + hasBOM: false, + id: '', + }, css: '//123.example.com', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -2300,7 +2605,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url(//123.example.com)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -2344,10 +2649,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url(http://123.example.com)', + hasBOM: false, + id: '', + }, css: 'http://123.example.com', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -2368,10 +2678,15 @@ Generated by [AVA](https://ava.li). column: 5, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url(http://123.example.com)', + hasBOM: false, + id: '', + }, css: 'http://123.example.com', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 5, @@ -2396,10 +2711,15 @@ Generated by [AVA](https://ava.li). column: 6, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url(http://123.example.com)', + hasBOM: false, + id: '', + }, css: 'http://123.example.com', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 6, @@ -2424,7 +2744,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'url(http://123.example.com)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -2473,10 +2793,20 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: SubInput { + columnInContext: 5, + context: Input { + css: 'url(var(foo))', + hasBOM: false, + id: '', + }, + css: 'var(foo)', + lineInContext: 1, + }, css: 'foo', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -2499,10 +2829,15 @@ Generated by [AVA](https://ava.li). column: 4, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'url(var(foo))', + hasBOM: false, + id: '', + }, css: 'var(foo)', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -2570,10 +2905,15 @@ Generated by [AVA](https://ava.li). column: 3, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'var( --foo )', + hasBOM: false, + id: '', + }, css: ' --foo ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 3, @@ -2598,7 +2938,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'var( --foo )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -2642,10 +2982,15 @@ Generated by [AVA](https://ava.li). column: 2, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'var( --foo)', + hasBOM: false, + id: '', + }, css: ' --foo', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 2, @@ -2670,7 +3015,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'var( --foo)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -2714,10 +3059,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'var(--foo )', + hasBOM: false, + id: '', + }, css: '--foo ', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -2742,7 +3092,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'var(--foo )', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -2786,10 +3136,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'var(--foo)', + hasBOM: false, + id: '', + }, css: '--foo', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -2814,7 +3169,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'var(--foo)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -2858,10 +3213,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'var(--foo, default-value)', + hasBOM: false, + id: '', + }, css: '--foo, default-value', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -2882,10 +3242,15 @@ Generated by [AVA](https://ava.li). column: 6, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'var(--foo, default-value)', + hasBOM: false, + id: '', + }, css: '--foo, default-value', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 6, @@ -2910,10 +3275,15 @@ Generated by [AVA](https://ava.li). column: 8, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 5, + context: Input { + css: 'var(--foo, default-value)', + hasBOM: false, + id: '', + }, css: '--foo, default-value', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 8, @@ -2938,7 +3308,7 @@ Generated by [AVA](https://ava.li). input: Input { css: 'var(--foo, default-value)', hasBOM: false, - id: '', + id: '', }, start: { column: 1, diff --git a/test/snapshots/func.test.js.snap b/test/snapshots/func.test.js.snap index da972ef..f357836 100644 Binary files a/test/snapshots/func.test.js.snap and b/test/snapshots/func.test.js.snap differ diff --git a/test/snapshots/integration.test.js.md b/test/snapshots/integration.test.js.md index 7f822c2..7afaddc 100644 --- a/test/snapshots/integration.test.js.md +++ b/test/snapshots/integration.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `integration.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## manipulation diff --git a/test/snapshots/interpolation.test.js.md b/test/snapshots/interpolation.test.js.md index b5bb0cb..cd36124 100644 --- a/test/snapshots/interpolation.test.js.md +++ b/test/snapshots/interpolation.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `interpolation.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## #{2 * 2px} @@ -30,10 +30,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 3, + context: Input { + css: '#{2 * 2px}', + hasBOM: false, + id: '', + }, css: '2 * 2px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -55,10 +60,15 @@ Generated by [AVA](https://ava.li). column: 3, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 3, + context: Input { + css: '#{2 * 2px}', + hasBOM: false, + id: '', + }, css: '2 * 2px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 3, @@ -79,10 +89,15 @@ Generated by [AVA](https://ava.li). column: 5, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 3, + context: Input { + css: '#{2 * 2px}', + hasBOM: false, + id: '', + }, css: '2 * 2px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 5, @@ -109,7 +124,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '#{2 * 2px}', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -146,10 +161,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 3, + context: Input { + css: '#{2px}', + hasBOM: false, + id: '', + }, css: '2px', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, @@ -176,7 +196,7 @@ Generated by [AVA](https://ava.li). input: Input { css: '#{2px}', hasBOM: false, - id: '', + id: '', }, start: { column: 1, @@ -217,10 +237,15 @@ Generated by [AVA](https://ava.li). column: 1, line: 1, }, - input: Input { + input: SubInput { + columnInContext: 3, + context: Input { + css: '#{batman}', + hasBOM: false, + id: '', + }, css: 'batman', - hasBOM: false, - id: '', + lineInContext: 1, }, start: { column: 1, diff --git a/test/snapshots/interpolation.test.js.snap b/test/snapshots/interpolation.test.js.snap index 2c88906..1c215ec 100644 Binary files a/test/snapshots/interpolation.test.js.snap and b/test/snapshots/interpolation.test.js.snap differ diff --git a/test/snapshots/numeric.test.js.md b/test/snapshots/numeric.test.js.md index c898dbe..2343849 100644 --- a/test/snapshots/numeric.test.js.md +++ b/test/snapshots/numeric.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `numeric.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## +2 @@ -43,6 +43,131 @@ Generated by [AVA](https://ava.li). }, ] +## -.3s + +> Snapshot 1 + + '-.3s' + +> Snapshot 2 + + '-.3s' + +> Snapshot 3 + + [ + Numeric { + raws: { + after: '', + before: '', + }, + source: { + end: { + column: 1, + line: 1, + }, + input: Input { + css: '-.3s', + hasBOM: false, + id: '', + }, + start: { + column: 1, + line: 1, + }, + }, + type: 'numeric', + unit: 's', + value: '-.3', + }, + ] + +## -.3s + 0.5s + +> Snapshot 1 + + '-.3s' + +> Snapshot 2 + + '-.3s + 0.5s' + +> Snapshot 3 + + [ + Numeric { + raws: { + after: '', + before: '', + }, + source: { + end: { + column: 1, + line: 1, + }, + input: Input { + css: '-.3s + 0.5s', + hasBOM: false, + id: '', + }, + start: { + column: 1, + line: 1, + }, + }, + type: 'numeric', + unit: 's', + value: '-.3', + }, + Operator { + raws: { + after: '', + before: ' ', + }, + source: { + end: { + column: 6, + line: 1, + }, + input: Input { + css: '-.3s + 0.5s', + hasBOM: false, + id: '', + }, + start: { + column: 6, + line: 1, + }, + }, + type: 'operator', + value: '+', + }, + Numeric { + raws: { + after: '', + before: ' ', + }, + source: { + end: { + column: 8, + line: 1, + }, + input: Input { + css: '-.3s + 0.5s', + hasBOM: false, + id: '', + }, + start: { + column: 8, + line: 1, + }, + }, + type: 'numeric', + unit: 's', + value: '0.5', + }, + ] + ## -.567800E-0012780em > Snapshot 1 @@ -505,6 +630,131 @@ Generated by [AVA](https://ava.li). }, ] +## 0.5s + +> Snapshot 1 + + '0.5s' + +> Snapshot 2 + + '0.5s' + +> Snapshot 3 + + [ + Numeric { + raws: { + after: '', + before: '', + }, + source: { + end: { + column: 1, + line: 1, + }, + input: Input { + css: '0.5s', + hasBOM: false, + id: '', + }, + start: { + column: 1, + line: 1, + }, + }, + type: 'numeric', + unit: 's', + value: '0.5', + }, + ] + +## 0.5s + 0.5s + +> Snapshot 1 + + '0.5s' + +> Snapshot 2 + + '0.5s + 0.5s' + +> Snapshot 3 + + [ + Numeric { + raws: { + after: '', + before: '', + }, + source: { + end: { + column: 1, + line: 1, + }, + input: Input { + css: '0.5s + 0.5s', + hasBOM: false, + id: '', + }, + start: { + column: 1, + line: 1, + }, + }, + type: 'numeric', + unit: 's', + value: '0.5', + }, + Operator { + raws: { + after: '', + before: ' ', + }, + source: { + end: { + column: 6, + line: 1, + }, + input: Input { + css: '0.5s + 0.5s', + hasBOM: false, + id: '', + }, + start: { + column: 6, + line: 1, + }, + }, + type: 'operator', + value: '+', + }, + Numeric { + raws: { + after: '', + before: ' ', + }, + source: { + end: { + column: 8, + line: 1, + }, + input: Input { + css: '0.5s + 0.5s', + hasBOM: false, + id: '', + }, + start: { + column: 8, + line: 1, + }, + }, + type: 'numeric', + unit: 's', + value: '0.5', + }, + ] + ## 10q > Snapshot 1 @@ -1052,256 +1302,6 @@ Generated by [AVA](https://ava.li). }, ] -## -.3s - -> Snapshot 1 - - '-.3s' - -> Snapshot 2 - - '-.3s' - -> Snapshot 3 - - [ - Numeric { - raws: { - after: '', - before: '', - }, - source: { - end: { - column: 1, - line: 1, - }, - input: Input { - css: '-.3s', - hasBOM: false, - id: '', - }, - start: { - column: 1, - line: 1, - }, - }, - type: 'numeric', - unit: 's', - value: '-.3', - }, - ] - -## -.3s + 0.5s - -> Snapshot 1 - - '-.3s' - -> Snapshot 2 - - '-.3s + 0.5s' - -> Snapshot 3 - - [ - Numeric { - raws: { - after: '', - before: '', - }, - source: { - end: { - column: 1, - line: 1, - }, - input: Input { - css: '-.3s + 0.5s', - hasBOM: false, - id: '', - }, - start: { - column: 1, - line: 1, - }, - }, - type: 'numeric', - unit: 's', - value: '-.3', - }, - Operator { - raws: { - after: '', - before: ' ', - }, - source: { - end: { - column: 6, - line: 1, - }, - input: Input { - css: '-.3s + 0.5s', - hasBOM: false, - id: '', - }, - start: { - column: 6, - line: 1, - }, - }, - type: 'operator', - value: '+', - }, - Numeric { - raws: { - after: '', - before: ' ', - }, - source: { - end: { - column: 8, - line: 1, - }, - input: Input { - css: '-.3s + 0.5s', - hasBOM: false, - id: '', - }, - start: { - column: 8, - line: 1, - }, - }, - type: 'numeric', - unit: 's', - value: '0.5', - }, - ] - -## 0.5s - -> Snapshot 1 - - '0.5s' - -> Snapshot 2 - - '0.5s' - -> Snapshot 3 - - [ - Numeric { - raws: { - after: '', - before: '', - }, - source: { - end: { - column: 1, - line: 1, - }, - input: Input { - css: '0.5s', - hasBOM: false, - id: '', - }, - start: { - column: 1, - line: 1, - }, - }, - type: 'numeric', - unit: 's', - value: '0.5', - }, - ] - -## 0.5s + 0.5s - -> Snapshot 1 - - '0.5s' - -> Snapshot 2 - - '0.5s + 0.5s' - -> Snapshot 3 - - [ - Numeric { - raws: { - after: '', - before: '', - }, - source: { - end: { - column: 1, - line: 1, - }, - input: Input { - css: '0.5s + 0.5s', - hasBOM: false, - id: '', - }, - start: { - column: 1, - line: 1, - }, - }, - type: 'numeric', - unit: 's', - value: '0.5', - }, - Operator { - raws: { - after: '', - before: ' ', - }, - source: { - end: { - column: 6, - line: 1, - }, - input: Input { - css: '0.5s + 0.5s', - hasBOM: false, - id: '', - }, - start: { - column: 6, - line: 1, - }, - }, - type: 'operator', - value: '+', - }, - Numeric { - raws: { - after: '', - before: ' ', - }, - source: { - end: { - column: 8, - line: 1, - }, - input: Input { - css: '0.5s + 0.5s', - hasBOM: false, - id: '', - }, - start: { - column: 8, - line: 1, - }, - }, - type: 'numeric', - unit: 's', - value: '0.5', - }, - ] - ## 500ms > Snapshot 1 diff --git a/test/snapshots/operator.test.js.md b/test/snapshots/operator.test.js.md index 7590e21..4ca4118 100644 --- a/test/snapshots/operator.test.js.md +++ b/test/snapshots/operator.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `operator.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## 10 % modulo diff --git a/test/snapshots/punctuation.test.js.md b/test/snapshots/punctuation.test.js.md index 6403a37..4144b14 100644 --- a/test/snapshots/punctuation.test.js.md +++ b/test/snapshots/punctuation.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `punctuation.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## (1,2) diff --git a/test/snapshots/unicode-range.test.js.md b/test/snapshots/unicode-range.test.js.md index 300d794..3593fbd 100644 --- a/test/snapshots/unicode-range.test.js.md +++ b/test/snapshots/unicode-range.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `unicode-range.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## U+0-7F diff --git a/test/snapshots/variable.test.js.md b/test/snapshots/variable.test.js.md index 8f0848f..3dc1b5f 100644 --- a/test/snapshots/variable.test.js.md +++ b/test/snapshots/variable.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `variable.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## $batman diff --git a/test/snapshots/word.test.js.md b/test/snapshots/word.test.js.md index 973d83b..0cd9c26 100644 --- a/test/snapshots/word.test.js.md +++ b/test/snapshots/word.test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `word.test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## \"word\" \s