better parser errors
This commit is contained in:
parent
872c8e356d
commit
f83a8e3ca1
13 changed files with 639 additions and 78 deletions
45
error_test/parser/top_level_errors.sui
Normal file
45
error_test/parser/top_level_errors.sui
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# Top-level declaration errors
|
||||
|
||||
# Invalid top-level token
|
||||
invalid_token
|
||||
|
||||
# Incomplete use statement
|
||||
use
|
||||
|
||||
# Missing path in use
|
||||
use as alias
|
||||
|
||||
# Invalid use syntax
|
||||
use "path" invalid
|
||||
|
||||
# Incomplete load statement
|
||||
load
|
||||
|
||||
# Missing alias in load
|
||||
load "lib"
|
||||
|
||||
# Invalid load syntax
|
||||
load "lib" invalid alias
|
||||
|
||||
# Incomplete extern declaration
|
||||
extern
|
||||
|
||||
# Missing return type in extern
|
||||
extern add(x: int, y: int)
|
||||
|
||||
# Invalid extern syntax
|
||||
extern add(x: int, y: int) -> int invalid
|
||||
|
||||
# Incomplete impl declaration
|
||||
impl
|
||||
|
||||
# Missing methods in impl
|
||||
impl MyType
|
||||
end
|
||||
|
||||
# Incomplete trait declaration
|
||||
trait
|
||||
|
||||
# Missing methods in trait
|
||||
trait MyTrait
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue