-
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.
- Loading branch information
Showing
8 changed files
with
202 additions
and
48 deletions.
There are no files selected for viewing
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
77 changes: 77 additions & 0 deletions
77
external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.exp
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,77 @@ | ||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:5:9 | ||
│ | ||
5 │ let _tmp = 42; // reset parser to see if the next line compiles | ||
│ ^^^ | ||
│ │ | ||
│ Unexpected 'let' | ||
│ Expected an identifier | ||
|
||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:11:9 | ||
│ | ||
11 │ let _tmp = 42; // reset parser to see if the next line compiles | ||
│ ^^^ | ||
│ │ | ||
│ Unexpected 'let' | ||
│ Expected ',' or '}' | ||
|
||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:11:22 | ||
│ | ||
10 │ use a::m2::{foo | ||
│ - To match this '{' | ||
11 │ let _tmp = 42; // reset parser to see if the next line compiles | ||
│ ^ Expected '}' | ||
|
||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:17:9 | ||
│ | ||
17 │ let _tmp = 42; // reset parser to see if the next lines compile | ||
│ ^^^ | ||
│ │ | ||
│ Unexpected 'let' | ||
│ Expected ',' or '}' | ||
|
||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:17:22 | ||
│ | ||
16 │ use a::m2::{foo, bar | ||
│ - To match this '{' | ||
17 │ let _tmp = 42; // reset parser to see if the next lines compile | ||
│ ^ Expected '}' | ||
|
||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:24:9 | ||
│ | ||
24 │ let _tmp = 42; // reset parser to see if the next lines compile | ||
│ ^^^ | ||
│ │ | ||
│ Unexpected 'let' | ||
│ Expected ',' or '}' | ||
|
||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:24:22 | ||
│ | ||
23 │ use a::{m2::{foo, bar | ||
│ - To match this '{' | ||
24 │ let _tmp = 42; // reset parser to see if the next lines compile | ||
│ ^ Expected '}' | ||
|
||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:32:9 | ||
│ | ||
32 │ let _tmp = 42; // reset parser to see if the next lines compile | ||
│ ^^^ | ||
│ │ | ||
│ Unexpected 'let' | ||
│ Expected ',' or '}' | ||
|
||
error[E01002]: unexpected token | ||
┌─ tests/move_2024/ide_mode/use_incomplete.move:32:22 | ||
│ | ||
31 │ use a::{m2::{foo, bar}, m3 | ||
│ - To match this '{' | ||
32 │ let _tmp = 42; // reset parser to see if the next lines compile | ||
│ ^ Expected '}' | ||
|
49 changes: 49 additions & 0 deletions
49
external-crates/move/crates/move-compiler/tests/move_2024/ide_mode/use_incomplete.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,49 @@ | ||
module a::m { | ||
|
||
public fun test1() { | ||
use a::m2:: | ||
let _tmp = 42; // reset parser to see if the next line compiles | ||
m2::foo(); | ||
} | ||
|
||
public fun test2() { | ||
use a::m2::{foo | ||
let _tmp = 42; // reset parser to see if the next line compiles | ||
foo(); | ||
} | ||
|
||
public fun test3() { | ||
use a::m2::{foo, bar | ||
let _tmp = 42; // reset parser to see if the next lines compile | ||
foo(); | ||
bar(); | ||
} | ||
|
||
public fun test4() { | ||
use a::{m2::{foo, bar | ||
let _tmp = 42; // reset parser to see if the next lines compile | ||
foo(); | ||
bar(); | ||
|
||
} | ||
|
||
public fun test5() { | ||
use a::{m2::{foo, bar}, m3 | ||
let _tmp = 42; // reset parser to see if the next lines compile | ||
m3::baz(); | ||
foo(); | ||
bar(); | ||
} | ||
} | ||
|
||
module a::m2 { | ||
|
||
public fun foo() {} | ||
|
||
public fun bar() {} | ||
} | ||
|
||
module a::m3 { | ||
|
||
public fun baz() {} | ||
} |
8 changes: 4 additions & 4 deletions
8
...s/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.exp
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
8 changes: 5 additions & 3 deletions
8
.../move-compiler/tests/move_check/parser/use_module_member_invalid_missing_close_brace.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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
|
||
module 0x42::M { | ||
|
||
use 0x1::X::{S as XS | ||
use 0x42::M::{S as XS | ||
|
||
fun foo() { | ||
fun foo() {} | ||
|
||
} | ||
struct S has drop {} | ||
|
||
fun bar(_p: XS) {} | ||
} |
12 changes: 6 additions & 6 deletions
12
...tes/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.exp
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,9 +1,9 @@ | ||
error[E01002]: unexpected token | ||
┌─ tests/move_check/parser/use_module_member_invalid_missing_semicolon.move:5:1 | ||
┌─ tests/move_check/parser/use_module_member_invalid_missing_semicolon.move:6:5 | ||
│ | ||
5 │ } | ||
│ ^ | ||
│ │ | ||
│ Unexpected '}' | ||
│ Expected ';' | ||
6 │ fun foo() {} | ||
│ ^^^ | ||
│ │ | ||
│ Unexpected 'fun' | ||
│ Expected ';' | ||
|
8 changes: 7 additions & 1 deletion
8
...es/move-compiler/tests/move_check/parser/use_module_member_invalid_missing_semicolon.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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
|
||
module 0x42::M { | ||
|
||
use 0x1::X::{S as XS,} | ||
use 0x42::M::{S as XS,} | ||
|
||
fun foo() {} | ||
|
||
struct S has drop {} | ||
|
||
fun bar(_p: XS) {} | ||
} |