-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.jx
More file actions
48 lines (46 loc) · 1.79 KB
/
example.jx
File metadata and controls
48 lines (46 loc) · 1.79 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
/**
* This is an example of a valid JX file. Note that it supports comments. These
* are ignored during parsing.
* example.jx
**/
{
// JX supports keys without quotes
Title: "JX file format";
// Values can be terminated with a comma or a semicolon, but semicolon is preferred for JX.
SubTitle: "A super-set of JSON",
// Strings can be quoted using single- or double-quotes, and may contain the other type of quote without escaping
QuotedString: 'This is "perfectly" fine';
"AnotherQuotedString": "This is 'also' ok";
// This is a variable that can be referenced anywhere. Variables have global scope
$FormatExtension: ".jx";
// This sets a default variable if the user hasn't passed one in yet
?$FormatLongName: "JSON Extra";
// Colors
$HighlightColor: #ffffff;
// This is an array (just like JSON)
Settings: [
// This is a string
"This is a string";
// And these are numbers
-45.189;
0xb8ac20;
// Colors are also supported, in numerous formats
#ff9900;
rgb( 255, 198, 0 );
rgba( 255, 198, 0, 0.5 );
// Here is an object (just like JSON)
{
// Here we are referencing that variable from before
Name: $FormatLongName;
// This is neat. lookbacks to other values are supported (but not look-aheads)
AnotherTitle: Title;
BackgroundColor: Settings[3];
// Equations
"My equation": sin( PI ) * 4 ^ 2 * (14 + 3);
// Strings
'Alert String': "Hello World. This is " + $FormatLongName;
// Colors
ForegroundColor: tint( Settings[6].BackgroundColor, $HighlightColor, 0.25 );
}
], // Trailing commas are ignored (do not result in error)
}