Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(css/parser): Use new approach for parsing invalid tokens (#6224
- Loading branch information
1 parent
e2c1fcf
commit ac619e8
Showing
47 changed files
with
1,433 additions
and
1,200 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
crates/swc_css_codegen/tests/fixture/qualified_rule/recovery-1/input.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
a {}; | ||
|
||
b {}; | ||
|
||
c { } | ||
|
||
c {color: red; } |
10 changes: 10 additions & 0 deletions
10
crates/swc_css_codegen/tests/fixture/qualified_rule/recovery-1/output.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
a {} | ||
; | ||
|
||
b {} | ||
; | ||
|
||
c {} | ||
c { | ||
color: red; | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/swc_css_codegen/tests/fixture/qualified_rule/recovery-1/output.min.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
a{}; | ||
|
||
b {}; | ||
|
||
c {}c{color:red} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
crates/swc_css_codegen/tests/fixture/qualified_rule/recovery/output.min.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
{}{color:red}#broken# {color:red}$bad{color:red}$bad {color:red}$bad foo{color:red}$bad foo {color:red}$bad: rule;a{div.major { color: blue }color: red } | ||
a {div:hover{color:blue}color:red}a{div:hover{color:blue};color:red} | ||
{}{color:red}#broken# {color:red}$bad{color:red}$bad {color:red}$bad foo{color:red}$bad foo {color:red}$bad: rule; | ||
|
||
|
||
a {div.major { color: blue } color: red }a{div:hover{color:blue}color:red}a{div:hover{color:blue};color:red} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/swc_css_minifier/tests/fixture/compress-at-rule/layer/output.min.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ac619e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/bugs-1
417132
ns/iter (± 31386
)344659
ns/iter (± 58655
)1.21
es/full/minify/libraries/antd
1929838236
ns/iter (± 62155638
)1763024993
ns/iter (± 41243845
)1.09
es/full/minify/libraries/d3
448627098
ns/iter (± 26588188
)395332176
ns/iter (± 30802578
)1.13
es/full/minify/libraries/echarts
1685534636
ns/iter (± 57821745
)1513960726
ns/iter (± 27279797
)1.11
es/full/minify/libraries/jquery
121054014
ns/iter (± 7567893
)96085146
ns/iter (± 4272598
)1.26
es/full/minify/libraries/lodash
146773775
ns/iter (± 20427694
)124221774
ns/iter (± 33430190
)1.18
es/full/minify/libraries/moment
68356029
ns/iter (± 9635188
)59098084
ns/iter (± 2512245
)1.16
es/full/minify/libraries/react
23907140
ns/iter (± 2384930
)19228140
ns/iter (± 308378
)1.24
es/full/minify/libraries/terser
401071439
ns/iter (± 105774281
)284935298
ns/iter (± 3849592
)1.41
es/full/minify/libraries/three
597464635
ns/iter (± 30496218
)557622115
ns/iter (± 32410860
)1.07
es/full/minify/libraries/typescript
3710322952
ns/iter (± 91292997
)3325883354
ns/iter (± 58154515
)1.12
es/full/minify/libraries/victory
911988820
ns/iter (± 49920259
)781637165
ns/iter (± 23852358
)1.17
es/full/minify/libraries/vue
180925651
ns/iter (± 11752773
)147558217
ns/iter (± 17014846
)1.23
es/full/codegen/es3
33633
ns/iter (± 781
)33338
ns/iter (± 929
)1.01
es/full/codegen/es5
33781
ns/iter (± 1393
)33347
ns/iter (± 1449
)1.01
es/full/codegen/es2015
33687
ns/iter (± 1360
)33163
ns/iter (± 1364
)1.02
es/full/codegen/es2016
33704
ns/iter (± 1263
)33040
ns/iter (± 1144
)1.02
es/full/codegen/es2017
33601
ns/iter (± 1826
)32539
ns/iter (± 661
)1.03
es/full/codegen/es2018
33619
ns/iter (± 536
)32713
ns/iter (± 552
)1.03
es/full/codegen/es2019
33609
ns/iter (± 1886
)33198
ns/iter (± 905
)1.01
es/full/codegen/es2020
33720
ns/iter (± 985
)32566
ns/iter (± 1031
)1.04
es/full/all/es3
221332019
ns/iter (± 17767951
)185450719
ns/iter (± 7122511
)1.19
es/full/all/es5
206741870
ns/iter (± 14488315
)176648556
ns/iter (± 9748255
)1.17
es/full/all/es2015
161918906
ns/iter (± 16384092
)141243913
ns/iter (± 3748977
)1.15
es/full/all/es2016
163775795
ns/iter (± 16926496
)140373835
ns/iter (± 8625788
)1.17
es/full/all/es2017
163407731
ns/iter (± 11877118
)143748915
ns/iter (± 10618450
)1.14
es/full/all/es2018
156692344
ns/iter (± 12641828
)141307936
ns/iter (± 10894477
)1.11
es/full/all/es2019
160795826
ns/iter (± 11177785
)139028697
ns/iter (± 3783130
)1.16
es/full/all/es2020
151948687
ns/iter (± 15465789
)134901726
ns/iter (± 8130817
)1.13
es/full/parser
724786
ns/iter (± 35636
)709739
ns/iter (± 32116
)1.02
es/full/base/fixer
27052
ns/iter (± 1184
)25580
ns/iter (± 675
)1.06
es/full/base/resolver_and_hygiene
92554
ns/iter (± 3164
)89450
ns/iter (± 3912
)1.03
serialization of ast node
213
ns/iter (± 4
)211
ns/iter (± 3
)1.01
serialization of serde
218
ns/iter (± 17
)216
ns/iter (± 4
)1.01
This comment was automatically generated by workflow using github-action-benchmark.