@tbela99/css-parser 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +354 -4
  2. package/README.md +69 -1077
  3. package/dist/config.json.js +76 -3
  4. package/dist/index-umd-web.js +26838 -18743
  5. package/dist/index.cjs +26819 -18731
  6. package/dist/index.d.ts +2471 -1884
  7. package/dist/lib/ast/clone.js +46 -0
  8. package/dist/lib/ast/expand.js +90 -65
  9. package/dist/lib/ast/features/calc.js +86 -43
  10. package/dist/lib/ast/features/if.js +221 -0
  11. package/dist/lib/ast/features/index.js +1 -0
  12. package/dist/lib/ast/features/inlinecssvariables.js +33 -28
  13. package/dist/lib/ast/features/prefix.js +406 -44
  14. package/dist/lib/ast/features/shorthand.js +6 -9
  15. package/dist/lib/ast/features/transform.js +14 -15
  16. package/dist/lib/ast/find.js +175 -0
  17. package/dist/lib/ast/math/expression.js +145 -99
  18. package/dist/lib/ast/math/math.js +30 -41
  19. package/dist/lib/ast/minify.js +551 -232
  20. package/dist/lib/ast/transform/compute.js +82 -69
  21. package/dist/lib/ast/transform/matrix.js +12 -26
  22. package/dist/lib/ast/transform/minify.js +154 -150
  23. package/dist/lib/ast/transform/perspective.js +1 -1
  24. package/dist/lib/ast/transform/rotate.js +1 -1
  25. package/dist/lib/ast/transform/scale.js +1 -1
  26. package/dist/lib/ast/transform/skew.js +1 -1
  27. package/dist/lib/ast/transform/translate.js +1 -1
  28. package/dist/lib/ast/transform/utils.js +3 -2
  29. package/dist/lib/ast/types.js +345 -30
  30. package/dist/lib/ast/walk.js +119 -64
  31. package/dist/lib/fs/resolve.js +94 -88
  32. package/dist/lib/parser/declaration/list.js +117 -26
  33. package/dist/lib/parser/declaration/map.js +141 -96
  34. package/dist/lib/parser/declaration/set.js +30 -25
  35. package/dist/lib/parser/parse.js +1810 -1739
  36. package/dist/lib/parser/tokenize.js +662 -403
  37. package/dist/lib/parser/utils/angle.js +29 -0
  38. package/dist/lib/parser/utils/at-rule-container.js +486 -0
  39. package/dist/lib/parser/utils/at-rule-font-feature-values.js +13 -0
  40. package/dist/lib/parser/utils/at-rule-generic.js +118 -0
  41. package/dist/lib/parser/utils/at-rule-import.js +393 -0
  42. package/dist/lib/parser/utils/at-rule-media.js +603 -0
  43. package/dist/lib/parser/utils/at-rule-support.js +431 -0
  44. package/dist/lib/parser/utils/at-rule-when-else.js +363 -0
  45. package/dist/lib/parser/utils/at-rule.js +31 -0
  46. package/dist/lib/parser/utils/cache.js +19 -0
  47. package/dist/lib/parser/utils/config.js +1 -0
  48. package/dist/lib/parser/utils/declaration.js +672 -91
  49. package/dist/lib/parser/utils/hash.js +1 -1
  50. package/dist/lib/parser/utils/selector.js +518 -0
  51. package/dist/lib/parser/utils/text.js +17 -1
  52. package/dist/lib/parser/utils/token.js +104 -0
  53. package/dist/lib/parser/utils/type.js +29 -18
  54. package/dist/lib/renderer/render.js +870 -269
  55. package/dist/lib/renderer/sourcemap/sourcemap.js +17 -7
  56. package/dist/lib/syntax/color/a98rgb.js +8 -12
  57. package/dist/lib/syntax/color/alpha.js +64 -0
  58. package/dist/lib/syntax/color/cmyk.js +23 -21
  59. package/dist/lib/syntax/color/color-mix.js +311 -237
  60. package/dist/lib/syntax/color/color.js +98 -92
  61. package/dist/lib/syntax/color/hex.js +29 -33
  62. package/dist/lib/syntax/color/hsl.js +7 -14
  63. package/dist/lib/syntax/color/hwb.js +14 -27
  64. package/dist/lib/syntax/color/lab.js +23 -24
  65. package/dist/lib/syntax/color/lch.js +16 -18
  66. package/dist/lib/syntax/color/oklab.js +21 -40
  67. package/dist/lib/syntax/color/oklch.js +16 -18
  68. package/dist/lib/syntax/color/p3.js +0 -8
  69. package/dist/lib/syntax/color/rec2020.js +9 -13
  70. package/dist/lib/syntax/color/relativecolor.js +160 -48
  71. package/dist/lib/syntax/color/rgb.js +14 -18
  72. package/dist/lib/syntax/color/srgb.js +30 -29
  73. package/dist/lib/syntax/color/utils/color-type.js +18 -0
  74. package/dist/lib/syntax/color/utils/colorspace.js +46 -0
  75. package/dist/lib/syntax/color/utils/components.js +36 -16
  76. package/dist/lib/syntax/color/utils/distance.js +21 -11
  77. package/dist/lib/syntax/color/utils/make-color.js +56 -0
  78. package/dist/lib/syntax/color/xyz.js +10 -22
  79. package/dist/lib/syntax/color/xyzd50.js +6 -20
  80. package/dist/lib/syntax/constants.js +464 -0
  81. package/dist/lib/syntax/syntax.js +825 -592
  82. package/dist/lib/validation/config.js +72 -33
  83. package/dist/lib/validation/config.json.js +1185 -85
  84. package/dist/lib/validation/match.js +3120 -0
  85. package/dist/lib/validation/parser/parse.js +683 -935
  86. package/dist/lib/validation/parser/typedef.js +106 -0
  87. package/dist/lib/validation/utils/list.js +4 -11
  88. package/dist/lib/validation/utils/whitespace.js +2 -8
  89. package/dist/node.js +102 -57
  90. package/dist/web.js +100 -48
  91. package/package.json +31 -17
  92. package/dist/lib/syntax/color/utils/constants.js +0 -214
  93. package/dist/lib/syntax/utils.js +0 -70
  94. package/dist/lib/validation/at-rules/container.js +0 -342
  95. package/dist/lib/validation/at-rules/counter-style.js +0 -90
  96. package/dist/lib/validation/at-rules/custom-media.js +0 -50
  97. package/dist/lib/validation/at-rules/document.js +0 -89
  98. package/dist/lib/validation/at-rules/else.js +0 -5
  99. package/dist/lib/validation/at-rules/font-feature-values.js +0 -63
  100. package/dist/lib/validation/at-rules/import.js +0 -150
  101. package/dist/lib/validation/at-rules/keyframes.js +0 -67
  102. package/dist/lib/validation/at-rules/layer.js +0 -41
  103. package/dist/lib/validation/at-rules/media.js +0 -255
  104. package/dist/lib/validation/at-rules/namespace.js +0 -81
  105. package/dist/lib/validation/at-rules/page-margin-box.js +0 -64
  106. package/dist/lib/validation/at-rules/page.js +0 -100
  107. package/dist/lib/validation/at-rules/supports.js +0 -295
  108. package/dist/lib/validation/at-rules/when.js +0 -185
  109. package/dist/lib/validation/atrule.js +0 -184
  110. package/dist/lib/validation/selector.js +0 -36
  111. package/dist/lib/validation/syntax.js +0 -1073
  112. package/dist/lib/validation/syntaxes/complex-selector-list.js +0 -27
  113. package/dist/lib/validation/syntaxes/complex-selector.js +0 -52
  114. package/dist/lib/validation/syntaxes/compound-selector.js +0 -196
  115. package/dist/lib/validation/syntaxes/family-name.js +0 -57
  116. package/dist/lib/validation/syntaxes/keyframe-selector.js +0 -36
  117. package/dist/lib/validation/syntaxes/layer-name.js +0 -57
  118. package/dist/lib/validation/syntaxes/relative-selector-list.js +0 -31
  119. package/dist/lib/validation/syntaxes/relative-selector.js +0 -38
  120. package/dist/lib/validation/syntaxes/selector-list.js +0 -5
  121. package/dist/lib/validation/syntaxes/selector.js +0 -5
  122. package/dist/lib/validation/syntaxes/url.js +0 -40
@@ -1,23 +1,15 @@
1
1
  import { multiply, toZero, identity } from './utils.js';
2
- import { EnumToken } from '../types.js';
3
- import { transformFunctions } from '../../syntax/syntax.js';
4
- import { length2Px } from '../../syntax/utils.js';
5
- import '../minify.js';
6
- import '../walk.js';
7
- import '../../parser/parse.js';
8
- import '../../parser/tokenize.js';
9
- import '../../parser/utils/config.js';
10
- import { getNumber, getAngle } from '../../syntax/color/color.js';
11
- import '../../syntax/color/utils/constants.js';
12
- import '../../renderer/sourcemap/lib/encode.js';
2
+ import { EnumToken, length2Px } from '../types.js';
13
3
  import { stripCommaToken } from '../../validation/utils/list.js';
14
4
  import { translateX, translateY, translateZ, translate, translate3d } from './translate.js';
5
+ import { getNumber, getAngle } from '../../syntax/color/color.js';
15
6
  import { rotate, rotate3D } from './rotate.js';
16
7
  import { scale3d, scale, scaleX, scaleY, scaleZ } from './scale.js';
17
8
  import { minify } from './minify.js';
18
9
  import { skew, skewX, skewY } from './skew.js';
19
10
  import { serialize, matrix } from './matrix.js';
20
11
  import { perspective } from './perspective.js';
12
+ import { transformFunctions } from '../../syntax/constants.js';
21
13
 
22
14
  function compute(transformLists) {
23
15
  transformLists = transformLists.slice();
@@ -36,20 +28,21 @@ function compute(transformLists) {
36
28
  const serialized = serialize(matrix);
37
29
  if (cumulative.length > 0) {
38
30
  for (let i = 0; i < cumulative.length; i++) {
39
- if (cumulative[i].typ == EnumToken.IdenTokenType && cumulative[i].val == 'none') {
31
+ if (cumulative[i].typ == EnumToken.IdenTokenType && cumulative[i].val == "none") {
40
32
  cumulative.splice(i--, 1);
41
33
  }
42
34
  }
43
35
  if (cumulative.length == 0) {
44
36
  cumulative.push({
45
- typ: EnumToken.IdenTokenType, val: 'none'
37
+ typ: EnumToken.IdenTokenType,
38
+ val: "none",
46
39
  });
47
40
  }
48
41
  }
49
42
  return {
50
43
  matrix: serialize(toZero(matrix)),
51
44
  cumulative,
52
- minified: minify(matrix) ?? [serialized]
45
+ minified: minify(matrix) ?? [serialized],
53
46
  };
54
47
  }
55
48
  function computeMatrix(transformList, matrixVar) {
@@ -57,19 +50,24 @@ function computeMatrix(transformList, matrixVar) {
57
50
  let val;
58
51
  let i = 0;
59
52
  for (; i < transformList.length; i++) {
60
- if (transformList[i].typ != EnumToken.FunctionTokenType || !transformFunctions.includes(transformList[i].val)) {
53
+ if (transformList[i].typ != EnumToken.TransformFunctionTokenType ||
54
+ !transformFunctions.includes(transformList[i].val)) {
61
55
  return null;
62
56
  }
63
57
  switch (transformList[i].val) {
64
- case 'translate':
65
- case 'translateX':
66
- case 'translateY':
67
- case 'translateZ':
68
- case 'translate3d':
58
+ case "translate":
59
+ case "translateX":
60
+ case "translateY":
61
+ case "translateZ":
62
+ case "translate3d":
69
63
  {
70
64
  values.length = 0;
71
65
  const children = stripCommaToken(transformList[i].chi.slice());
72
- const valCount = transformList[i].val == 'translate3d' ? 3 : transformList[i].val == 'translate' ? 2 : 1;
66
+ const valCount = transformList[i].val == "translate3d"
67
+ ? 3
68
+ : transformList[i].val == "translate"
69
+ ? 2
70
+ : 1;
73
71
  for (let j = 0; j < children.length; j++) {
74
72
  if (children[j].typ == EnumToken.WhitespaceTokenType) {
75
73
  continue;
@@ -83,16 +81,16 @@ function computeMatrix(transformList, matrixVar) {
83
81
  if (values.length == 0 || values.length > valCount) {
84
82
  return null;
85
83
  }
86
- if (transformList[i].val == 'translateX') {
84
+ if (transformList[i].val == "translateX") {
87
85
  matrixVar = translateX(values[0], matrixVar);
88
86
  }
89
- else if (transformList[i].val == 'translateY') {
87
+ else if (transformList[i].val == "translateY") {
90
88
  matrixVar = translateY(values[0], matrixVar);
91
89
  }
92
- else if (transformList[i].val == 'translateZ') {
90
+ else if (transformList[i].val == "translateZ") {
93
91
  matrixVar = translateZ(values[0], matrixVar);
94
92
  }
95
- else if (transformList[i].val == 'translate') {
93
+ else if (transformList[i].val == "translate") {
96
94
  matrixVar = translate(values, matrixVar);
97
95
  }
98
96
  else {
@@ -101,43 +99,45 @@ function computeMatrix(transformList, matrixVar) {
101
99
  }
102
100
  }
103
101
  break;
104
- case 'rotate':
105
- case 'rotateX':
106
- case 'rotateY':
107
- case 'rotateZ':
108
- case 'rotate3d':
102
+ case "rotate":
103
+ case "rotateX":
104
+ case "rotateY":
105
+ case "rotateZ":
106
+ case "rotate3d":
109
107
  {
110
108
  let x = 0;
111
109
  let y = 0;
112
110
  let z = 0;
113
111
  let angle;
114
112
  let values = [];
115
- let valuesCount = transformList[i].val == 'rotate3d' ? 4 : 1;
113
+ let valuesCount = transformList[i].val == "rotate3d" ? 4 : 1;
116
114
  for (const child of stripCommaToken(transformList[i].chi.slice())) {
117
115
  values.push(child);
118
- if (transformList[i].val == 'rotateX') {
116
+ if (transformList[i].val == "rotateX") {
119
117
  x = 1;
120
118
  }
121
- else if (transformList[i].val == 'rotateY') {
119
+ else if (transformList[i].val == "rotateY") {
122
120
  y = 1;
123
121
  }
124
- else if (transformList[i].val == 'rotate' || transformList[i].val == 'rotateZ') {
122
+ else if (transformList[i].val == "rotate" ||
123
+ transformList[i].val == "rotateZ") {
125
124
  z = 1;
126
125
  }
127
126
  }
128
127
  if (values.length != valuesCount) {
129
128
  return null;
130
129
  }
131
- if (transformList[i].val == 'rotate3d') {
130
+ if (transformList[i].val == "rotate3d") {
132
131
  x = getNumber(values[0]);
133
132
  y = getNumber(values[1]);
134
133
  z = getNumber(values[2]);
135
134
  }
136
135
  angle = getAngle(values.at(-1));
137
- if ([x, y, z, angle].some(t => typeof t != 'number' || Number.isNaN(+t))) {
136
+ if ([x, y, z, angle].some((t) => typeof t != "number" || Number.isNaN(+t))) {
138
137
  return null;
139
138
  }
140
- if (transformList[i].val == 'rotate' || transformList[i].val == 'rotateZ') {
139
+ if (transformList[i].val == "rotate" ||
140
+ transformList[i].val == "rotateZ") {
141
141
  matrixVar = rotate(angle * 2 * Math.PI, matrixVar);
142
142
  }
143
143
  else {
@@ -145,11 +145,11 @@ function computeMatrix(transformList, matrixVar) {
145
145
  }
146
146
  }
147
147
  break;
148
- case 'scale':
149
- case 'scaleX':
150
- case 'scaleY':
151
- case 'scaleZ':
152
- case 'scale3d':
148
+ case "scale":
149
+ case "scaleX":
150
+ case "scaleY":
151
+ case "scaleZ":
152
+ case "scale3d":
153
153
  {
154
154
  values.length = 0;
155
155
  let child;
@@ -161,14 +161,14 @@ function computeMatrix(transformList, matrixVar) {
161
161
  }
162
162
  values.push(getNumber(child));
163
163
  }
164
- if (transformList[i].val == 'scale3d') {
164
+ if (transformList[i].val == "scale3d") {
165
165
  if (values.length != 3) {
166
166
  return null;
167
167
  }
168
168
  matrixVar = scale3d(...values, matrixVar);
169
169
  break;
170
170
  }
171
- if (transformList[i].val == 'scale') {
171
+ if (transformList[i].val == "scale") {
172
172
  if (values.length != 1 && values.length != 2) {
173
173
  return null;
174
174
  }
@@ -178,20 +178,20 @@ function computeMatrix(transformList, matrixVar) {
178
178
  if (values.length != 1) {
179
179
  return null;
180
180
  }
181
- else if (transformList[i].val == 'scaleX') {
181
+ else if (transformList[i].val == "scaleX") {
182
182
  matrixVar = scaleX(values[0], matrixVar);
183
183
  }
184
- else if (transformList[i].val == 'scaleY') {
184
+ else if (transformList[i].val == "scaleY") {
185
185
  matrixVar = scaleY(values[0], matrixVar);
186
186
  }
187
- else if (transformList[i].val == 'scaleZ') {
187
+ else if (transformList[i].val == "scaleZ") {
188
188
  matrixVar = scaleZ(values[0], matrixVar);
189
189
  }
190
190
  }
191
191
  break;
192
- case 'skew':
193
- case 'skewX':
194
- case 'skewY':
192
+ case "skew":
193
+ case "skewX":
194
+ case "skewY":
195
195
  {
196
196
  values.length = 0;
197
197
  let child;
@@ -206,18 +206,22 @@ function computeMatrix(transformList, matrixVar) {
206
206
  value = getAngle(child);
207
207
  values.push(value * 2 * Math.PI);
208
208
  }
209
- if (values.length == 0 || (values.length > (transformList[i].val == 'skew' ? 2 : 1))) {
209
+ if (values.length == 0 ||
210
+ values.length > (transformList[i].val == "skew" ? 2 : 1)) {
210
211
  return null;
211
212
  }
212
- if (transformList[i].val == 'skew') {
213
+ if (transformList[i].val == "skew") {
213
214
  matrixVar = skew(values, matrixVar);
214
215
  }
215
216
  else {
216
- matrixVar = transformList[i].val == 'skewX' ? skewX(values[0], matrixVar) : skewY(values[0], matrixVar);
217
+ matrixVar =
218
+ transformList[i].val == "skewX"
219
+ ? skewX(values[0], matrixVar)
220
+ : skewY(values[0], matrixVar);
217
221
  }
218
222
  }
219
223
  break;
220
- case 'perspective':
224
+ case "perspective":
221
225
  {
222
226
  const values = [];
223
227
  let child;
@@ -227,7 +231,7 @@ function computeMatrix(transformList, matrixVar) {
227
231
  if (child.typ == EnumToken.CommentTokenType || child.typ == EnumToken.WhitespaceTokenType) {
228
232
  continue;
229
233
  }
230
- if (child.typ == EnumToken.IdenTokenType && child.val == 'none') {
234
+ if (child.typ == EnumToken.IdenTokenType && child.val == "none") {
231
235
  values.push(child);
232
236
  continue;
233
237
  }
@@ -243,13 +247,17 @@ function computeMatrix(transformList, matrixVar) {
243
247
  matrixVar = perspective(values[0], matrixVar);
244
248
  }
245
249
  break;
246
- case 'matrix3d':
247
- case 'matrix':
250
+ case "matrix3d":
251
+ case "matrix":
248
252
  {
249
253
  const values = [];
250
254
  let value;
251
255
  for (const token of transformList[i].chi) {
252
- if ([EnumToken.WhitespaceTokenType, EnumToken.CommentTokenType, EnumToken.CommaTokenType].includes(token.typ)) {
256
+ if ([
257
+ EnumToken.WhitespaceTokenType,
258
+ EnumToken.CommentTokenType,
259
+ EnumToken.CommaTokenType,
260
+ ].includes(token.typ)) {
253
261
  continue;
254
262
  }
255
263
  value = getNumber(token);
@@ -258,7 +266,7 @@ function computeMatrix(transformList, matrixVar) {
258
266
  }
259
267
  values.push(value);
260
268
  }
261
- if (transformList[i].val == 'matrix') {
269
+ if (transformList[i].val == "matrix") {
262
270
  if (values.length != 6) {
263
271
  return null;
264
272
  }
@@ -279,19 +287,22 @@ function splitTransformList(transformList) {
279
287
  let pattern = null;
280
288
  const tokens = [];
281
289
  for (let i = 0; i < transformList.length; i++) {
282
- if (transformList[i].typ == EnumToken.CommentTokenType || transformList[i].typ == EnumToken.WhitespaceTokenType) {
290
+ if (transformList[i].typ == EnumToken.CommentTokenType ||
291
+ transformList[i].typ == EnumToken.WhitespaceTokenType) {
283
292
  continue;
284
293
  }
285
- if (pattern == null || (transformList[i].typ == EnumToken.FunctionTokenType && !transformList[i].val.startsWith(pattern))) {
286
- if (transformList[i].typ == EnumToken.FunctionTokenType) {
287
- if (transformList[i].val.startsWith('scale')) {
288
- pattern = 'scale';
294
+ if (pattern == null ||
295
+ (transformList[i].typ == EnumToken.TransformFunctionTokenType &&
296
+ !transformList[i].val.startsWith(pattern))) {
297
+ if (transformList[i].typ == EnumToken.TransformFunctionTokenType) {
298
+ if (transformList[i].val.startsWith("scale")) {
299
+ pattern = "scale";
289
300
  }
290
- else if (transformList[i].val.startsWith('rotate')) {
291
- pattern = 'rotate';
301
+ else if (transformList[i].val.startsWith("rotate")) {
302
+ pattern = "rotate";
292
303
  }
293
- else if (transformList[i].val.startsWith('translate')) {
294
- pattern = 'translate';
304
+ else if (transformList[i].val.startsWith("translate")) {
305
+ pattern = "translate";
295
306
  }
296
307
  else {
297
308
  pattern = null;
@@ -300,7 +311,9 @@ function splitTransformList(transformList) {
300
311
  continue;
301
312
  }
302
313
  }
303
- if (pattern != null && transformList[i].typ == EnumToken.FunctionTokenType && transformList[i].val.startsWith(pattern)) {
314
+ if (pattern != null &&
315
+ transformList[i].typ == EnumToken.TransformFunctionTokenType &&
316
+ transformList[i].val.startsWith(pattern)) {
304
317
  tokens[tokens.length - 1].push(transformList[i]);
305
318
  continue;
306
319
  }
@@ -1,18 +1,11 @@
1
- import { is2DMatrix, identity } from './utils.js';
1
+ import { identity, is2DMatrix } from './utils.js';
2
2
  import { EnumToken } from '../types.js';
3
3
  import { eq } from '../../parser/utils/eq.js';
4
4
  import { getNumber } from '../../syntax/color/color.js';
5
- import '../../syntax/color/utils/constants.js';
6
- import '../minify.js';
7
- import '../walk.js';
8
- import '../../parser/parse.js';
9
- import '../../parser/tokenize.js';
10
- import '../../parser/utils/config.js';
11
- import '../../renderer/sourcemap/lib/encode.js';
12
5
 
13
6
  function parseMatrix(mat) {
14
7
  if (mat.typ == EnumToken.IdenTokenType) {
15
- return mat.val == 'none' ? identity() : null;
8
+ return mat.val == "none" ? identity() : null;
16
9
  }
17
10
  const children = mat.chi.filter((t) => t.typ == EnumToken.NumberTokenType || t.typ == EnumToken.IdenTokenType);
18
11
  const values = [];
@@ -66,46 +59,39 @@ function serialize(matrix) {
66
59
  if (eq(matrix, identity())) {
67
60
  return {
68
61
  typ: EnumToken.IdenTokenType,
69
- val: 'none'
62
+ val: "none",
70
63
  };
71
64
  }
72
65
  if (is2DMatrix(matrix)) {
73
66
  // https://drafts.csswg.org/css-transforms-2/#two-dimensional-subset
74
67
  return {
75
- typ: EnumToken.FunctionTokenType,
76
- val: 'matrix',
77
- chi: [
78
- matrix[0],
79
- matrix[1],
80
- matrix[4],
81
- matrix[4 + 1],
82
- matrix[3 * 4],
83
- matrix[3 * 4 + 1]
84
- ].reduce((acc, t) => {
68
+ typ: EnumToken.TransformFunctionTokenType,
69
+ val: "matrix",
70
+ chi: [matrix[0], matrix[1], matrix[4], matrix[4 + 1], matrix[3 * 4], matrix[3 * 4 + 1]].reduce((acc, t) => {
85
71
  if (acc.length > 0) {
86
72
  acc.push({ typ: EnumToken.CommaTokenType });
87
73
  }
88
74
  acc.push({
89
75
  typ: EnumToken.NumberTokenType,
90
- val: t
76
+ val: t,
91
77
  });
92
78
  return acc;
93
- }, [])
79
+ }, []),
94
80
  };
95
81
  }
96
82
  return {
97
- typ: EnumToken.FunctionTokenType,
98
- val: 'matrix3d',
83
+ typ: EnumToken.TransformFunctionTokenType,
84
+ val: "matrix3d",
99
85
  chi: matrix.reduce((acc, curr) => {
100
86
  if (acc.length > 0) {
101
87
  acc.push({ typ: EnumToken.CommaTokenType });
102
88
  }
103
89
  acc.push({
104
90
  typ: EnumToken.NumberTokenType,
105
- val: curr
91
+ val: curr,
106
92
  });
107
93
  return acc;
108
- }, [])
94
+ }, []),
109
95
  };
110
96
  }
111
97