Hi,
I was trying to generate the AST for the following code snippet:
function alma(c)
f(x,y) = 3x + 4y
A = Int8[1, 2, 3] * c
B = [4.0, 5.0, 6.0] .+ c
return f(A,B)/c
end
str = open(f->read(f, String), "expr.jl")
ex = Meta.parse(str)
dump(ex)
I got the following:
Expr
head: Symbol function
args: Array{Any}((2,))
1: Expr
head: Symbol call
args: Array{Any}((2,))
1: Symbol alma
2: Symbol c
2: Expr
head: Symbol block
args: Array{Any}((8,))
1: LineNumberNode
line: Int64 2
file: Symbol none
2: Expr
head: Symbol =
args: Array{Any}((2,))
1: Expr
head: Symbol call
args: Array{Any}((3,))
1: Symbol f
2: Symbol x
3: Symbol y
2: Expr
head: Symbol block
args: Array{Any}((2,))
1: LineNumberNode
2: Expr
3: LineNumberNode
line: Int64 3
file: Symbol none
4: Expr
head: Symbol =
args: Array{Any}((2,))
1: Symbol A
2: Expr
head: Symbol call
args: Array{Any}((3,))
1: Symbol *
2: Expr
3: Symbol c
5: LineNumberNode
line: Int64 4
file: Symbol none
6: Expr
head: Symbol =
args: Array{Any}((2,))
1: Symbol B
2: Expr
head: Symbol call
args: Array{Any}((3,))
1: Symbol .+
2: Expr
3: Symbol c
7: LineNumberNode
line: Int64 5
file: Symbol none
8: Expr
head: Symbol return
args: Array{Any}((1,))
1: Expr
head: Symbol call
args: Array{Any}((3,))
1: Symbol /
2: Expr
3: Symbol c
The return expression is wrong. Is this a bug or it should put this out?
Regards,
RUn