Skip to content

Commit

Permalink
Fix Symbolize options for CellParametersCard in tryparse
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Oct 26, 2023
1 parent d729922 commit af3a6f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/PWscf/input.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,13 @@ function Base.tryparse(::Type{CellParametersCard}, str::AbstractString)
m = match(CELL_PARAMETERS_BLOCK, str)
# Function `match` only searches for the first match of the regular expression, so it could be a `nothing`
if m !== nothing
option = Symbol(m[:option])
if isempty(option)
rawoption = m[:option]
option = if isempty(rawoption)
@warn "Neither unit nor lattice parameter are specified. DEPRECATED, will no longer be allowed!"
@info "'bohr' is assumed."
option = :bohr
:bohr
else
Symbol(rawoption)
end
content = m[:data]
data = Matrix{Float64}(undef, 3, 3)
Expand Down

0 comments on commit af3a6f1

Please sign in to comment.