Skip to content

Commit

Permalink
Temporary fix for check for nothing in function checking
Browse files Browse the repository at this point in the history
Should only add when nothing is specified
  • Loading branch information
aminya committed Dec 3, 2019
1 parent c65916c commit 35d2fef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/AcuteML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ macro aml(expr)
# Function provided
else
amlconst[i]=quote
if ($(esc(amlFunsI)))($amlVarsI)
if !isnothing($amlVarsI) && ($(esc(amlFunsI)))($amlVarsI)
addelementVect!(aml, $amlNamesI, $amlVarsI, $amlTypesI)
else
error("$($amlNamesI) doesn't meet criteria function")
Expand All @@ -378,15 +378,15 @@ macro aml(expr)

$amlVarsI = findallcontent($(esc(argTypesI)), $amlNamesI, aml, $amlTypesI)

if !(($(esc(amlFunsI)))($amlVarsI))
if !isnothing($amlVarsI) && !(($(esc(amlFunsI)))($amlVarsI))
error("$($amlNamesI) doesn't meet criteria function")
end
end

if mutability
amlmutability[i] = quote
if name == $amlSymI
if ($(esc(amlFunsI)))($(amlVarsCall[i]))
if !isnothing($(amlVarsCall[i])) && ($(esc(amlFunsI)))($(amlVarsCall[i]))
updateallcontent!(value, $amlNamesI, str.aml, $amlTypesI)
else
error("$($amlNamesI) doesn't meet criteria function")
Expand Down Expand Up @@ -419,7 +419,7 @@ macro aml(expr)
# Function provided
else
amlconst[i]=quote
if ($(esc(amlFunsI)))($amlVarsI)
if !isnothing($amlVarsI) && ($(esc(amlFunsI)))($amlVarsI)
addelementOne!(aml, $amlNamesI, $amlVarsI, $amlTypesI)
else
error("$($amlNamesI) doesn't meet criteria function")
Expand All @@ -430,14 +430,14 @@ macro aml(expr)

$amlVarsI = findfirstcontent($(esc(argTypesI)), $amlNamesI, aml, $amlTypesI)

if !(($(esc(amlFunsI)))($amlVarsI))
if !isnothing($amlVarsI) && !(($(esc(amlFunsI)))($amlVarsI))
error("$($amlNamesI) doesn't meet criteria function")
end
end
if mutability
amlmutability[i] = quote
if name == $amlSymI
if ($(esc(amlFunsI)))($(amlVarsCall[i]))
if !isnothing($(amlVarsCall[i])) && ($(esc(amlFunsI)))($(amlVarsCall[i]))
updatefirstcontent!(value, $amlNamesI, str.aml, $amlTypesI)
else
error("$($amlNamesI) doesn't meet criteria function")
Expand Down

0 comments on commit 35d2fef

Please sign in to comment.