1
0
mirror of https://github.com/kalmarek/SmallHyperbolic synced 2024-07-27 13:05:31 +02:00

fix _tf_missing

This commit is contained in:
Marek Kaluba 2022-01-18 11:21:20 +01:00
parent 8339cbd5cf
commit 9d6415dcb8
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -29,15 +29,16 @@ end
# parse_grouppresentations_abstract("./data/presentations_2_4_4.txt") # parse_grouppresentations_abstract("./data/presentations_2_4_4.txt")
function _tf_missing(x::Any) function _tf_missing(x::AbstractString)
s = strip(x) s = strip(x)
mis = !isnothing(match(r"(\?)*", x)) yes = !isnothing(match(r"yes"i, s))
no = !isnothing(match(r"no"i, x)) no = !isnothing(match(r"no"i, s))
yes = !isnothing(match(r"yes"i, x)) mis = !isnothing(match(r"(\?)+", s))
mis && return missing @debug "string for true/false/missing : $s" parsed=(yes, no, mis)
yes && !no && return true yes && !no && !mis && return true
!yes && no && return false !yes && no && !mis && return false
throw(ArgumentError("Unrecognized option: $x")) !yes && !no && mis && return missing
throw(ArgumentError("Unrecognized string as true/false/missing: $x"))
end end
function parse_vec(s::AbstractString) function parse_vec(s::AbstractString)