Skip to content

Commit 32809c2

Browse files
committed
allow comment character in mmCIF data value
1 parent 058a5d1 commit 32809c2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/mmcif.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function splitline(s::AbstractString)
104104
in_token = false
105105
push!(tokens, s[start_i:(i - 1)])
106106
end
107-
elseif c == '#' && quote_open_char == ' '
107+
elseif c == '#' && !in_token
108108
return tokens
109109
elseif !in_token
110110
in_token = true

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,8 @@ end
17171717
@test splitline("foo 'bar'a' b") == ["foo", "bar'a", "b"]
17181718
@test splitline("foo \"bar' a\" b") == ["foo", "bar' a", "b"]
17191719
@test splitline("foo '' b") == ["foo", "", "b"]
1720+
@test splitline("foo #bar") == ["foo"]
1721+
@test splitline("foo b#ar") == ["foo", "b#ar"]
17201722
@test_throws ArgumentError splitline("foo 'bar")
17211723
@test_throws ArgumentError splitline("foo 'ba'r ")
17221724
@test_throws ArgumentError splitline("foo \"bar'")

0 commit comments

Comments
 (0)