-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
The trailing comments of an entry should really belong to the leading comments of the next entry.
import scaposer._
val Right(Seq(first, second)) = Parser.parse(raw"""
# comment
msgctxt "context1"
msgid "aaa"
msgstr "AAA"
#, fuzzy
msgctxt "context2"
msgid "bbb"
msgstr "BBB"
""")
scala> first.asInstanceOf[SingularTranslation].otherComments // should be empty
res1: Seq[String] = List(#, fuzzy)
scala> second.asInstanceOf[SingularTranslation].ctxComments // should be non-empty
res2: Seq[String] = List()In this example, the comment containing the fuzzy flag is parsed as part of the first entry, but it would be expected to be part of the second entry. (As tools should ignore fuzzy translations, it is important that the comment is matched with the correct entry.)
If you accept pull requests, I'd be happy to look into sending a fix.
Tested with 1.11.1 using Scala 2.11.12.
Metadata
Metadata
Assignees
Labels
No labels