NSON is a new object notation like JSON and unlike JSON. NSON is strict superset of JSON and differ from JSON in that NSON doesn't require any comma as a separator character.
For example, the following example, including several properties of an object, doesn't have any comma:
{"name": "Kota Mizushima" "age": 33
"like" : ["Scala" "Haskell" "Nemerle" "Rust"]}
Add the following lines to your build.sbt file:
libraryDependencies += "com.github.kmizu" %% "nson" % "0.0.2"
Then, you can use NValueParser as the followings:
import com.github.kmizu.nson.NValueParser
val nvalue = NValuePaser.parse(
"""
| {x: 1 y: 2}
""".stripMargin
)
println(nvalue.x.value) // => 1
println(nvalue.y.value) // => 2
64-bit signed integer.
10
20
0x10 // 16
-20 // -20
IEEE 754 double precision floating point number
1.0
1.5
2.0
3.0
true
false
""
"Hello, World"
"Foo"
"Bar"
[]
[1, 2, 3]
[1 2 3] //comma is omitted
[1
2
3] // line feed is also separator
{"x" : 1, "y": 2}
{ x : 1 y : 2} //comma is omitted
{"x"1"y"2} // colon is omitted
{"x" : 1
"y" : 2} // line feed is also separator
{ x : 1, y : 2} // identifier
{ x : 1 y : 2}