-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds enum paths, spread operator, more enum tests, fixes move_or_copy…
… precedence
- Loading branch information
Showing
11 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
external-crates/move/crates/move-analyzer/prettier-move/package.json
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
23 changes: 23 additions & 0 deletions
23
external-crates/move/crates/move-analyzer/prettier-move/tests/enum/enum.exp.move
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,23 @@ | ||
// options: | ||
// printWidth: 40 | ||
|
||
module tests::enum { | ||
public enum Test { | ||
A, | ||
B, | ||
C, | ||
} | ||
|
||
public enum Test<phantom C> { | ||
A(u8, u64), | ||
C(u8), | ||
B { a: u8, b: u64 }, | ||
} | ||
|
||
fun use_enum() { | ||
let _local = tests::enum::test::A( | ||
10, | ||
1000, | ||
); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
external-crates/move/crates/move-analyzer/prettier-move/tests/enum/enum.move
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,16 @@ | ||
// options: | ||
// printWidth: 40 | ||
|
||
module tests::enum { | ||
public enum Test { | ||
A, | ||
B, | ||
C, | ||
} | ||
|
||
public enum Test<phantom C> { A(u8, u64), C(u8), B { a: u8, b: u64 }, } | ||
|
||
fun use_enum() { | ||
let _local = tests::enum::test::A(10, 1000); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
external-crates/move/crates/move-analyzer/prettier-move/tests/functions/bind_unpack.exp.move
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,18 @@ | ||
// options: | ||
// printWidth: 40 | ||
|
||
/// Module: kek | ||
module kek::kek { | ||
public struct Kek { | ||
a: u8, | ||
b: u64, | ||
} | ||
|
||
public fun destroy( | ||
k1: Kek, | ||
k2: Kek, | ||
) { | ||
let Kek { a, .. } = k1; | ||
let Kek { .. } = k2; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
external-crates/move/crates/move-analyzer/prettier-move/tests/functions/bind_unpack.move
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,15 @@ | ||
// options: | ||
// printWidth: 40 | ||
|
||
/// Module: kek | ||
module kek::kek { | ||
public struct Kek { | ||
a: u8, | ||
b: u64, | ||
} | ||
|
||
public fun destroy(k1: Kek, k2: Kek) { | ||
let Kek { a, .. } = k1; | ||
let Kek { .. } = k2; | ||
} | ||
} |
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
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
Binary file modified
BIN
+4.7 KB
(100%)
external-crates/move/crates/move-analyzer/prettier-move/tree-sitter-move.wasm
Binary file not shown.