Skip to content

Commit

Permalink
Merge pull request #231 from psrenergy/rb/merge_pmd_fix
Browse files Browse the repository at this point in the history
Change pmd merge error to warning
  • Loading branch information
guilhermebodin authored Nov 26, 2024
2 parents e7382f7 + 2bac2f4 commit ed5acf0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/PMD/parser/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function _apply_merge!(parser::Parser, target::String, merge_path::Set{String})
end

if haskey(data, k)
_error(
_warning(
parser,
"Collection '$target' already has attribute '$k' being merged from '$source'",
)
Expand Down Expand Up @@ -585,6 +585,7 @@ function _parse_reference!(
state::S,
) where {S <: Union{PMD_DEF_MODEL, PMD_DEF_CLASS, PMD_MERGE_CLASS}}
m = match(r"(PARM|VECTOR|VETOR)\s+(REFERENCE)\s+(\S+)\s+(\S+)", line)
m1 = match(r"(PARM|VECTOR|VETOR)\s+(REFERENCE)\s+(\S+)", line)

if m !== nothing
kind = String(m[1])
Expand All @@ -610,6 +611,12 @@ function _parse_reference!(

parser.relation_mapper[state.collection][target][attribute] = relation

return true
elseif m1 !== nothing
_warning(
parser,
"Unhandled reference '$(m1[3])' within '$(state.collection)'",
)
return true
else
return false
Expand Down

0 comments on commit ed5acf0

Please sign in to comment.