-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
doml.scroll
94 lines (81 loc) · 2.03 KB
/
doml.scroll
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import ../code/conceptPage.scroll
id doml
name DOML
appeared 2017
tags dataNotation
standsFor Data Oriented Markup Language
writtenIn markdown
repoStats
firstCommit 2017
commits 117
committers 2
files 13
newestCommit 2018
country Australia
originCommunity https://github.com/DOML-Lang
example
# Version 0.3
// Construct a new Color
Test = Color() {
RGB = 255, 64, 128,
}
// Constructors do exist
// the parameter names are purely for your own merit, they will check if its possible however (will be possible on most systems)
TheSame = Color::Normalized(r: 1, g: 0.25, b: 0.5) {
Name = "Bob"
}
// You can also just declare an object without scoping it
Other = Color()
Other.Name = "X"
// You can declare random other values
MyValue = 2
// You can also edit the original Test at any point EITHER by doing
Test.R = 50
// Or by doing
Test.{
G = 128
}
// You can declare arrays like
ArrayObject = []Color {
::Normalized(0.95, 0.55, 0.22){
Name = "Other", // Trailing commas are always allowed
},
// You can still do an empty construction
::() {
RGB = 50, 25, 125,
},
// And thus you can leave out the ::()
{
RGB = 50, 25, 125,
},
}
// You can also copy objects by doing
NewObj = Other
// Or can do something like
NewObj.Name = ArrayObject[0].Name
// You can also declare arrays inside object definitions
MyTags = Tags() {
// Note: all have to be of the same type
SetTags = ["Hello", "Other", "bits", "bobs", "kick"]
Name = MyTags.GetTags[0] // And indexing them works like you would think
}
// You can declare dictionaries like
// Dictionaries within objects can also be created similarly
MyDictionary = [String : Color] {
{
"Bob" : Color::Normalized(0.5, 1.2, 3.5) {
Name = "Bob's Color"
}
},
}
// No need to keep classes around in this example
# Deinit all
githubRepo https://github.com/DOML-Lang/DOML
firstCommit 2017
stars 4
forks 1
subscribers 2
created 2017
updated 2021
description The specification document for DOML
issues 7