Skip to content

Commit 7e68208

Browse files
authored
fix(fmt): 'layout' is not a keyword (#10656)
1 parent db0ce45 commit 7e68208

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ foundry-linking = { path = "crates/linking" }
201201
foundry-block-explorers = { version = "0.17.0", default-features = false }
202202
foundry-compilers = { version = "0.16.1", default-features = false }
203203
foundry-fork-db = "0.15"
204-
solang-parser = { version = "=0.3.8", package = "foundry-solang-parser" }
204+
solang-parser = { version = "=0.3.9", package = "foundry-solang-parser" }
205205
solar-ast = { version = "=0.1.3", default-features = false }
206206
solar-parse = { version = "=0.1.3", default-features = false }
207207
solar-interface = { version = "=0.1.3", default-features = false }

crates/fmt/testdata/NonKeywords/fmt.sol

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
struct S {
22
uint256 error;
3-
// uint256 layout;
3+
uint256 layout;
44
uint256 at;
55
}
66
// uint256 transient;
77

88
function f() {
99
uint256 error = 0;
10-
// uint256 layout = 0;
10+
uint256 layout = 0;
1111
uint256 at = 0;
1212
// uint256 transient = 0;
1313

@@ -17,25 +17,26 @@ function f() {
1717
// transient = 0;
1818

1919
S memory x = S({
20+
// format
2021
error: 0,
21-
// layout: 0,
22+
layout: 0,
2223
at: 0
2324
});
2425
// transient: 0
2526

2627
x.error = 0;
27-
// x.layout = 0;
28+
x.layout = 0;
2829
x.at = 0;
2930
// x.transient = 0;
3031

3132
assembly {
3233
let error := 0
33-
// let layout := 0
34+
let layout := 0
3435
let at := 0
3536
// let transient := 0
3637

3738
error := 0
38-
// layout := 0
39+
layout := 0
3940
at := 0
4041
// transient := 0
4142
}

crates/fmt/testdata/NonKeywords/original.sol

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
struct S {
22
uint256 error;
3-
// uint256 layout;
3+
uint256 layout;
44
uint256 at;
55
// uint256 transient;
66
}
77

88
function f() {
99
uint256 error = 0;
10-
// uint256 layout = 0;
10+
uint256 layout = 0;
1111
uint256 at = 0;
1212
// uint256 transient = 0;
1313

@@ -17,25 +17,26 @@ function f() {
1717
// transient = 0;
1818

1919
S memory x = S({
20+
// format
2021
error: 0,
21-
// layout: 0,
22+
layout: 0,
2223
at: 0
2324
// transient: 0
2425
});
2526

2627
x.error = 0;
27-
// x.layout = 0;
28+
x.layout = 0;
2829
x.at = 0;
2930
// x.transient = 0;
3031

3132
assembly {
3233
let error := 0
33-
// let layout := 0
34+
let layout := 0
3435
let at := 0
3536
// let transient := 0
3637

3738
error := 0
38-
// layout := 0
39+
layout := 0
3940
at := 0
4041
// transient := 0
4142
}

crates/fmt/tests/formatter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ test_directories! {
217217
TryStatement,
218218
ConditionalOperatorExpression,
219219
NamedFunctionCallExpression,
220-
NonKeywords,
221220
ArrayExpressions,
222221
UnitExpression,
223222
ThisExpression,
@@ -242,3 +241,4 @@ test_directories! {
242241
}
243242

244243
test_dir!(SortedImports, TestConfig::skip_compare_ast_eq());
244+
test_dir!(NonKeywords, TestConfig::skip_compare_ast_eq());

0 commit comments

Comments
 (0)