-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathexample.eon
More file actions
54 lines (51 loc) · 1.17 KB
/
example.eon
File metadata and controls
54 lines (51 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// This is an example of an Eon file.
string: "Hello Eon!"
bool: true
integer: 42
list: [1, 2, 3]
keywords: [null, false, true]
special_numbers: [+inf, -inf, +nan]
monsters: [
{
name: "Rabbit of Caerbannog"
strength: 1000
}
{
name: "Ni"
desires: "A shrubbery"
}
]
// Map keys can be any valid Eon value
any_map: {
"42": "This key is an string"
42: "This key is an integer"
[]: "This key is an empty list"
}
// Strings come in four flavors:
basic_strings: [
"I'm a string."
"I contain \"quotes\"."
"Newline:\nUnicode: \u{262E} (☮)"
]
multiline_basic_strings: [
"""\
It was the best of strings.
It was the worst of strings."""
// The above is equivalent to:
"It was the best of strings.\n\t\tIt was the worst of strings."
]
literal_strings: {
// Literal strings uses single quotes, and no escaping is performed.
// What you see is exactly what you get:
windows_path: 'C:\System32\foo.dll'
quotes: 'I use "quotes" in this string'
regex: '[+\-0-9\.][0-9a-zA-Z\.+\-_]*'
}
multiline_literal_strings: {
quote_re: '''(["'])[^"']*$1'''
python: '''
# The first newline is ignored, but everything else is kept
def main():
print('Hello world!')
'''
}