-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlang.pn
56 lines (53 loc) · 1.96 KB
/
lang.pn
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
55
56
general:
> Indentation starts a block. Tabs are preferred, and are equal to two
> spaces. (Valid) UTF-8 is allowed inside strings and comments. ASCII is
> allowed everywhere, except for control characters, which aren't allowed
> anywhere. Whitespace means tabs or spaces.
types:
scalar:
null: null
bool: [true, false]
int: [0, 20, +1, -40]
float: [0.0, +0.0, -0.0, +6.02e23, inf, +inf, -inf, nan]
vector:
data:
short: $0f1e2d3c
long:
$ 0000 0000 0000 0000 1111 1111 1111 1111
$ 2222 2222 2222 2222 3333 3333 3333 3333
$ 4444 4444 4444 4444 5555 5555 5555 5555
$ 6666 6666 6666 6666 7777 7777 7777 7777
$ 8888 8888 8888 8888 9999 9999 9999 9999
$ aaaa aaaa aaaa aaaa bbbb bbbb bbbb bbbb
$ cccc cccc cccc cccc dddd dddd dddd dddd
$ eeee eeee eeee eeee ffff ffff ffff ffff
string:
short: "use quotes\u0000use escapes"
long:
> Multi-line literals use ">", "|", and "!". One tab or space character
> may follow them and is ignored. With ">", non-empty input lines are
> joined to previous non-empty lines by a space. With "|" (always) or ">"
> (when the current or previous line is empty), each input line begins a
> new line.
>
> A trailing newline is added unless the last line uses "!". A "!" ends
> the string: no text may occur after the "!" (except an optional space or
> tab) and no ">" or "!" lines may follow it.
!
array:
short: [1, 2, 3]
long:
* "multi-line arrays"
* "use stars"
dict:
short: {use-braces: true, use-colons: true, "and sometimes quotes": true}
long:
multi-line: "maps"
use: "colons"
"quoted keys": "OK too"
# There are comments too, but they aren't a type.
# They have to follow the same indentation rules as everything else.
notes:
> Short vector literals must always fit on one line. They are essentially
> the same as JSON, except that dict keys do not have to be quoted if they
> contain only [0-9A-Za-z./+-].