Rework module system
Don't require/allow naming a module, instead require that the importer names it. Allow importing into the local scope with the name !Local. Simplify namespacing logic. Updates all tests to reflect these changes.
This commit is contained in:
7
test/named-imports/1.tri
Normal file
7
test/named-imports/1.tri
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
!import "lib/base.tri"
|
||||
|
||||
!import "test/named-imports/2.tri"
|
||||
!import "test/named-imports/3.tri" ThreeRenamed
|
||||
|
||||
main = equal? (equal? Two.x 2) (equal? ThreeRenamed.x 3)
|
2
test/named-imports/2.tri
Normal file
2
test/named-imports/2.tri
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
x = 2
|
2
test/named-imports/3.tri
Normal file
2
test/named-imports/3.tri
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
x = 3
|
Reference in New Issue
Block a user