|
|
@ -22,7 +22,7 @@ var parseTests = []parseTest{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: `name = "jordan"`,
|
|
|
|
source: `name: "jordan"`,
|
|
|
|
root: &rootNode{
|
|
|
|
root: &rootNode{
|
|
|
|
children: []node{
|
|
|
|
children: []node{
|
|
|
|
&assignmentNode{"name", "jordan"},
|
|
|
|
&assignmentNode{"name", "jordan"},
|
|
|
@ -31,13 +31,13 @@ var parseTests = []parseTest{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: `
|
|
|
|
source: `
|
|
|
|
hostname = "jordanorelli.com"
|
|
|
|
hostname: "jordanorelli.com"
|
|
|
|
port = 9000
|
|
|
|
port: 9000
|
|
|
|
freq = 1e9
|
|
|
|
freq: 1e9
|
|
|
|
duty = 0.2
|
|
|
|
duty: 0.2
|
|
|
|
neg = -2
|
|
|
|
neg: -2
|
|
|
|
neg2 = -2.3
|
|
|
|
neg2: -2.3
|
|
|
|
imag = 1+2i
|
|
|
|
imag: 1+2i
|
|
|
|
`,
|
|
|
|
`,
|
|
|
|
root: &rootNode{
|
|
|
|
root: &rootNode{
|
|
|
|
children: []node{
|
|
|
|
children: []node{
|
|
|
@ -53,9 +53,9 @@ var parseTests = []parseTest{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: `
|
|
|
|
source: `
|
|
|
|
first_name = "jordan" # yep, that's my name
|
|
|
|
first_name: "jordan" # yep, that's my name
|
|
|
|
last_name = "orelli" # comments should be able to follow other shit
|
|
|
|
last_name: "orelli" # comments should be able to follow other shit
|
|
|
|
`,
|
|
|
|
`,
|
|
|
|
root: &rootNode{
|
|
|
|
root: &rootNode{
|
|
|
|
children: []node{
|
|
|
|
children: []node{
|
|
|
|
&assignmentNode{"first_name", "jordan"},
|
|
|
|
&assignmentNode{"first_name", "jordan"},
|
|
|
@ -67,8 +67,8 @@ var parseTests = []parseTest{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: `
|
|
|
|
source: `
|
|
|
|
heroes = ["lina", "cm"]
|
|
|
|
heroes: ["lina", "cm"]
|
|
|
|
`,
|
|
|
|
`,
|
|
|
|
root: &rootNode{
|
|
|
|
root: &rootNode{
|
|
|
|
children: []node{
|
|
|
|
children: []node{
|
|
|
|
&assignmentNode{"heroes", list{"lina", "cm"}},
|
|
|
|
&assignmentNode{"heroes", list{"lina", "cm"}},
|
|
|
@ -77,8 +77,8 @@ var parseTests = []parseTest{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: `
|
|
|
|
source: `
|
|
|
|
nested = [["one", "two"], ["three", "four"]]
|
|
|
|
nested: [["one", "two"], ["three", "four"]]
|
|
|
|
`,
|
|
|
|
`,
|
|
|
|
root: &rootNode{
|
|
|
|
root: &rootNode{
|
|
|
|
children: []node{
|
|
|
|
children: []node{
|
|
|
|
&assignmentNode{"nested", list{list{"one", "two"}, list{"three", "four"}}},
|
|
|
|
&assignmentNode{"nested", list{list{"one", "two"}, list{"three", "four"}}},
|
|
|
@ -87,11 +87,11 @@ var parseTests = []parseTest{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: `
|
|
|
|
source: `
|
|
|
|
nested = [
|
|
|
|
nested: [
|
|
|
|
["one", "two"],
|
|
|
|
["one", "two"],
|
|
|
|
["three", "four"],
|
|
|
|
["three", "four"],
|
|
|
|
]
|
|
|
|
]
|
|
|
|
`,
|
|
|
|
`,
|
|
|
|
root: &rootNode{
|
|
|
|
root: &rootNode{
|
|
|
|
children: []node{
|
|
|
|
children: []node{
|
|
|
|
&assignmentNode{"nested", list{list{"one", "two"}, list{"three", "four"}}},
|
|
|
|
&assignmentNode{"nested", list{list{"one", "two"}, list{"three", "four"}}},
|
|
|
@ -100,7 +100,7 @@ var parseTests = []parseTest{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: `
|
|
|
|
source: `
|
|
|
|
admin = {first_name: "jordan", last_name: "orelli"}
|
|
|
|
admin: {first_name: "jordan", last_name: "orelli"}
|
|
|
|
`,
|
|
|
|
`,
|
|
|
|
root: &rootNode{
|
|
|
|
root: &rootNode{
|
|
|
|
children: []node{
|
|
|
|
children: []node{
|
|
|
@ -113,11 +113,11 @@ var parseTests = []parseTest{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
source: `
|
|
|
|
source: `
|
|
|
|
http = {
|
|
|
|
http: {
|
|
|
|
port: 9000,
|
|
|
|
port: 9000,
|
|
|
|
routes: "/path/to/some/file",
|
|
|
|
routes: "/path/to/some/file",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
`,
|
|
|
|
root: &rootNode{
|
|
|
|
root: &rootNode{
|
|
|
|
children: []node{
|
|
|
|
children: []node{
|
|
|
|
&assignmentNode{"http", object{
|
|
|
|
&assignmentNode{"http", object{
|
|
|
|