Syntax
The fundamentals of this language make it seem so useless and… silly. Just bear with it, it will make sense eventually.
Top-Level Syntax
All SillyScript code represents data. It can represent a list or dictionary.
While SillyScript can export to multiple data formats, JSON is the main one used in this documentation to represent how the structure of the language works.
List
The contents on the left side is an entirely valid SillyScript file.
| SillyScript | JSON |
|---|---|
|
This is an entire valid SillyScript file:
|
It is the equivalent of this JSON:
|
Dictionary
| SillyScript | JSON |
|---|---|
|
This is ALSO an entire valid SillyScript file:
|
It is the equivalent of this JSON:
|
Combination
SillyScript will automatically figure out if the file should be a List type of Dictionary type. These two types cannot be combined.
This is NOT a valid SillyScript file. The string must be labeled, or the labels must be removed from the number and boolean.
my_number: 1;
"This is a string";
myBool: false;
Lists and dictionaries can be mixed by adding them as sub-elements to each other using the proper syntax.
List
Use the blank colon syntax to create a new scope for a list.
:
1;
2;
3;
Dictionary
Use the blank colon syntax to create a new scope for a dictionary.
:
key1: 1;
something: 2;
bla: 3;
Combination
Here is an example of combining list and dictionaries and its equivalent in JSON:
| SillyScript | JSON |
|---|---|
|
A complicated structure in SillyScript.
|
What it represents in JSON.
|