Skip to content

Commit

Permalink
Merge pull request #64 from aminya/self-closing-patch
Browse files Browse the repository at this point in the history
Self closing patch
  • Loading branch information
aminya authored Jan 9, 2020
2 parents 8f6ae9c + d3bba9c commit 7c415b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
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

0 comments on commit 7c415b0

Please sign in to comment.