If you run an import, you only include everything that's part of a scope. This includes, variables, classes, and functions. Anything else should cause a compile error. This cleans up the error by adding a String() method to each Stmt in our AST.
12 lines
206 B
Plaintext
12 lines
206 B
Plaintext
$someint = 42
|
|
class someclass {
|
|
print "p2" {
|
|
msg => "i'm inside of someclass",
|
|
}
|
|
}
|
|
|
|
# this should generate a compile error
|
|
print "unused" {
|
|
msg => "i'm unused because i'm inside an imported module",
|
|
}
|