paradigmatic / Configrity

Simple, immutable and flexible configuration library for scala.
Other
132 stars 19 forks source link

A string value surrounded by double quotes, are inconsistent. #25

Open nmarshall23 opened 10 years ago

nmarshall23 commented 10 years ago

Let me demonstrate.

import org.streum.configrity._
val config = Configuration()
val config2 = config.set("foo",""""bar bar"""")
config2.save("foo.conf")
val config3 = Configuration.load("foo.conf")

val res1 = config2[String]("foo")
val res2 = config3[String]("foo")

Results in res1 equaling "bar bar". However res2 equals bar bar, that is a string that doesn't contain double quotes. What is happening is that while loading Configrity strips off the double quotes.

I think that to be consistent Configrity should keep the double quotes.

paradigmatic commented 10 years ago

Yes, I should rewrite the basic formats to be more precise about quotation rules (see issue #24 for instance). The problem is that I won't have much time until november, and that I am not a parser/regex specialist. So unfortunately I won't be able to fix this problem next week without help...