From af3a6f1e3dc49bcd701571cfeec21664a11471fa Mon Sep 17 00:00:00 2001 From: singularitti Date: Thu, 26 Oct 2023 02:32:22 -0400 Subject: [PATCH] Fix `Symbol`ize options for `CellParametersCard` in `tryparse` --- src/PWscf/input.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PWscf/input.jl b/src/PWscf/input.jl index 866f4f2..61286cd 100644 --- a/src/PWscf/input.jl +++ b/src/PWscf/input.jl @@ -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)