Initial commit.

This commit is contained in:
Karchnu 2020-12-03 02:43:09 +01:00
commit 12487502ee
13 changed files with 2072 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
old/
bin/
lib/
src/zig-cache

7
assets/children.gui Normal file
View File

@ -0,0 +1,7 @@
Object {
property string thing: "i has the thing"
Object {
property string thing: "i has the other thing"
}
}

View File

@ -0,0 +1,16 @@
Rectangle {
color: "red"
width: 300
height: 200
Rectangle {
color: "blue"
width: 100
height: 100
anchors {
top: 50
left: 50
}
}
}

View File

@ -0,0 +1,6 @@
Object (the-object) {
property string thing: "i has the thing"
property string thing-alt: thing
property string thing-alt-2: self.thing
property string thing-alt-3: the-object.thing
}

View File

@ -0,0 +1,7 @@
Object {
property string thing: "i has the thing"
Object {
property string thing: parent.thing
}
}

View File

@ -0,0 +1,43 @@
Rectangle {
color: "red"
width: 300
height: 200
Rectangle {
color: "black"
width: 50
height: 50
anchors.centerIn: parent
}
Rectangle {
color: "blue"
width: 50
height: 50
anchors {
top: parent.top
left: parent.left
}
}
Rectangle {
color: "yellow"
width: 50
height: 50
anchors {
bottom: parent.bottom
right: parent.right
}
}
Rectangle {
color: "green"
width: 50
height: 50
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
}
}

View File

@ -0,0 +1,7 @@
Rectangle {
id: clickable
color: "blue"
width: 300
height: 300
onClick: emit ["hello, there", "i has events"]
}

View File

@ -0,0 +1,7 @@
Rectangle {
id: clickable
color: "blue"
width: 300
height: 300
onClick: emit!
}

View File

@ -0,0 +1,4 @@
Object {
property string a: "A"
property string b: "B"
}

View File

@ -0,0 +1,5 @@
Rectangle {
color: "red"
width: 300
height: 200
}

36
assets/syntax.gui Normal file
View File

@ -0,0 +1,36 @@
Object (id) {
property String property-string-lalala: "value"
property Number property-number+lalala??: 12.4
property (String|Number) lalala: 42
# Sets a whole hash as attribute.
property hash property-hash: {
a: b
}
### [[[ UNCERTAIN FEATURE STARTS HERE
# Sets specific properties in a predefined hash.
property-hash-overload {
a: b
c: 12
}
# Sets a single property in a predefined hash.
property-hash-overload-alt.a: b
### ]]] UNCERTAIN FEATURE ENDS HERE
Object (id-child-1) {
property string property-child: "value"
Object (id-child-1-1) {}
}
Object (id-child-2) {
property string property-child: "value-alt"
Object {}
}
"string-child, probably ignored"
12 # Integer child, probably ignored
}

9
assets/text_label.gui Normal file
View File

@ -0,0 +1,9 @@
Text {
text: "Hello, there!"
font {
family: SansSerif
pixelSize: 15
}
width: 200
height: 200
}

1921
src/tokenizer.zig Normal file

File diff suppressed because it is too large Load Diff