better parser errors
This commit is contained in:
parent
872c8e356d
commit
f83a8e3ca1
13 changed files with 639 additions and 78 deletions
29
error_test/parser/enum_errors.sui
Normal file
29
error_test/parser/enum_errors.sui
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Enum syntax errors
|
||||
|
||||
# Missing enum name
|
||||
enum
|
||||
Red
|
||||
Green
|
||||
end
|
||||
|
||||
# Missing variant name
|
||||
enum Color
|
||||
Red
|
||||
Green
|
||||
end
|
||||
|
||||
# Invalid variant syntax (missing parentheses for tuple variant)
|
||||
enum Result
|
||||
Ok int
|
||||
Err string
|
||||
end
|
||||
|
||||
# Missing comma between variants
|
||||
enum Color
|
||||
Red Green
|
||||
end
|
||||
|
||||
# Missing end keyword
|
||||
enum Color
|
||||
Red
|
||||
Green
|
||||
Loading…
Add table
Add a link
Reference in a new issue