add documentation info

master
Jordan Orelli 10 years ago
parent 662a746311
commit 113a1ab5d5

@ -10,53 +10,61 @@ moon file is syntactically valid.
The following is taken to be the contents of a file named ex.moon: The following is taken to be the contents of a file named ex.moon:
# ------------------------------------------------------------------------------
# example config format
#
# this is a working draft of things that are valid in a new config language to
# replace json as a config language for Go projects.
#
# comments are a thing now!
# ------------------------------------------------------------------------------
# the whole document is implicitly a namespace, so you can set key value pairs # the whole document is implicitly a namespace, so you can set key value pairs
# at the top level. # at the top level.
first_name: "jordan" first_name: jordan
last_name: "orelli" last_name: orelli
# lists of things should be supported # lists of things should be supported
items: [ items: [
"one" one
2 2
3.4 3.4
["five" 6 7.8] [five; 6 7.8]
] ]
# objects should be supported # objects should be supported
hash: {key: "value" other_key: "other_value"} hash: {key: value; other_key: other_value}
other_hash: { other_hash: {
key_1: "one" key_1: one
key_2: 2 key_2: 2
key_3: 3.4 key_3: 3.4
key_4: ["five" 6 7.8] key_4: [five; 6 7.8]
} }
# we may reference an item that was defined earlier # we may reference an item that was defined earlier using a sigil
repeat_hash: hash repeat_hash: @hash
# items can be hidden. i.e., they're only valid in the parse and eval stage as # items can be hidden. i.e., they're only valid in the parse and eval stage as
# intermediate values internal to the config file; they are *not* visible to # intermediate values internal to the config file; they are *not* visible to
# the host program. This is generally useful for composing larger, more # the host program. This is generally useful for composing larger, more
# complicated things. # complicated things.
.hidden_item: "it has a value" @hidden_item: it has a value
visible_item: @hidden_item
visible_item: .hidden_item
.person_one: { @person_one: {
name: "the first name here" name: the first name here
age: 28 age: 28
hometown: "crooklyn" hometown: crooklyn
} }
.person_two: { @person_two: {
name: "the second name here" name: the second name here
age: 30 age: 30
hometown: "tha bronx" hometown: tha bronx
} }
people: [.person_one .person_two] people: [@person_one @person_two]
Subcommands Subcommands

Loading…
Cancel
Save