implements 'export' feature

This commit is contained in:
Araq 2012-12-01 19:10:47 +01:00
commit c98e3d2c27
10 changed files with 137 additions and 40 deletions

View file

@ -0,0 +1,8 @@
# module A
import mexportb
export mexportb.TMyObject, mexportb.xyz
export mexportb.q
proc `$`*(x: TMyObject): string = "my object"

View file

@ -0,0 +1,7 @@
# module B
type TMyObject* = object
const xyz* = 13
proc q*(x: int): int = 6
proc q*(x: string): string = "8"

10
tests/compile/texport.nim Normal file
View file

@ -0,0 +1,10 @@
discard """
output: "my object68"
"""
import mexporta
# B.TMyObject has been imported implicitly here:
var x: TMyObject
echo($x, q(0), q"0")