Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self closing patch #64

Merged
merged 4 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/AcuteML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ julia>P1.id
```
"""
macro aml(expr)
expr = macroexpand(__module__, expr) # to expand @static
expr = macroexpand(__module__, expr) # to expand literal macros and @static
# expr = macroexpand(@__MODULE__, expr) # for functions debuging.

# check if aml is used before struct
if expr isa Expr && expr.head == :struct
Expand Down
10 changes: 5 additions & 5 deletions src/amlParse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function amlParse(expr::Expr)
argNames =Vector{Union{Missing,String}}(undef, numArgs)
argFuns = Vector{Union{Missing, Symbol, Function}}(undef, numArgs)
argAmlTypes = Type[]
local amlName::String
local docOrElmType::Type
amlName = "name"
docOrElmType = AbsDocOrNode
amlFun = Array{Union{Missing, Symbol, Function},0}(undef)

for iData = 1:numData # iterating over arguments of each type argument
Expand Down Expand Up @@ -64,8 +64,8 @@ function amlParse(expr::Expr)
################################################################
# Struct aml
########################
# Literal only xd/hd"aml name"
if isa(ei, Tuple{Int64,String})
# Literal only sc"aml name"
if isa(ei, Tuple{Type,String})

amlFun[1]=missing # function

Expand Down Expand Up @@ -107,7 +107,7 @@ function amlParse(expr::Expr)
argExpr.args[i] = nothing # removing "aml name" from expr args

########################
# Literal and Struct Function - xd/hd"aml name", F
# Literal and Struct Function - sc"aml name", F
elseif isa(ei.args[1], Tuple) && isa(ei.args[2], Union{Symbol,Function})

amlFun[1]=ei.args[2] # function
Expand Down
2 changes: 1 addition & 1 deletion src/xmlutils/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract type AbsAttribute <: AbsNode end
abstract type AbsEmpty <: AbsNormal end

# Ignore
abstract type AbsIgnore end
abstract type AbsIgnore <: AbsDocOrNode end

################################################################
function aml_dispatch(docOrElmType::Type{AbsDocOrNode}, name::String)
Expand Down