mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Improve error message on import "foo", module "foo", and import statements out of order.
This commit is contained in:
committed by
Christoffer Lerno
parent
3173d09e56
commit
9ee24b5846
5
test/test_suite/import/import_error_out_of_order.c3
Normal file
5
test/test_suite/import/import_error_out_of_order.c3
Normal file
@@ -0,0 +1,5 @@
|
||||
module foo;
|
||||
|
||||
func void hello() {}
|
||||
|
||||
import bar; // #error: Imports are only allowed directly after the module declaration
|
||||
1
test/test_suite/import/import_error_string.c3
Normal file
1
test/test_suite/import/import_error_string.c3
Normal file
@@ -0,0 +1 @@
|
||||
import "Hello my friend"; // #error: An import should be followed by a plain identifier, not a string. Did you accidentally put the module name between ""?
|
||||
1
test/test_suite/module/module_error_string.c3
Normal file
1
test/test_suite/module/module_error_string.c3
Normal file
@@ -0,0 +1 @@
|
||||
module "Hello my friend"; // #error: 'module' should be followed by a plain identifier, not a string. Did you accidentally put the module name between ""?
|
||||
Reference in New Issue
Block a user