If you do
include("file.jl")
export
test
test1
it doesn't give an error but it doesn't export the 2nd function. This seems weird to me.
Thus is valid syntax and this kind of issue is the best for a linter.
Why is this valid syntax? That鈥檚 my point; Maybe it shouldn鈥檛 be valid.
It's valid syntax because test1 is valid syntax. I can't check right now but I think if you put everything on the same line it will be an error.
Yichao is right. You can't even finish a module definition at the REPL with this syntax before encountering an error:
julia> module M
export a b
ERROR: syntax: extra token "b" after end of expression
Stacktrace:
[1] top-level scope at REPL[6]:0
right but
module M
export
a
b
is valid
even though b is not actually exported
Right, you're evaluating b on a line by itself. Not sure there's anything we can do about this.
I am just making things up that may not be possible but why not just do something under the hood to evaluate the exports on the same line
julia> module M
export a,b
end
Main.M
julia> module M
export a b
end
ERROR: syntax: extra token "b" after end of expression
Stacktrace:
[1] top-level scope at REPL[2]:0
that way if there's a missing comma it errors out rather than acts as if all is well
export a
b
already means something: it means export a; b 鈥斅爄t exports a and then evaluates b.
Got it. Just wanted to voice my thought. Thanks for the feedback/time!