From 15dba79edc758183fae90687cbcedf62396f751e Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Sun, 5 Jul 2020 16:30:07 -0700 Subject: [PATCH] fixups --- pest/qml.pest | 2 +- res/HelloTwitter.qml | 24 ++++++++++++++++++++++++ res/RedRectangle.qml | 16 ---------------- res/example.qml | 4 ++-- 4 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 res/HelloTwitter.qml delete mode 100644 res/RedRectangle.qml diff --git a/pest/qml.pest b/pest/qml.pest index de84f13..42fb8de 100644 --- a/pest/qml.pest +++ b/pest/qml.pest @@ -33,6 +33,6 @@ function = {WHITE_SPACE* ~ ident ~ WHITE_SPACE* ~ "=" ~ WHITE_SPACE* ~ "[[" ~ fu property = {WHITE_SPACE* ~ ident ~ ":" ~ WHITE_SPACE* ~ (number|string |ident|function) ~ NEWLINE* } -body = {WHITE_SPACE* ~ ident ~ WHITE_SPACE ~ "{" ~ NEWLINE* ~ (property|function|body)+ ~ NEWLINE* ~ WHITE_SPACE* ~ "}" ~ NEWLINE?} +body = {WHITE_SPACE* ~ ident ~ WHITE_SPACE ~ "{" ~ NEWLINE* ~ (property|function|body)* ~ NEWLINE* ~ WHITE_SPACE* ~ "}" ~ NEWLINE?} qml = {import* ~ NEWLINE* ~ body} \ No newline at end of file diff --git a/res/HelloTwitter.qml b/res/HelloTwitter.qml new file mode 100644 index 0000000..0fae501 --- /dev/null +++ b/res/HelloTwitter.qml @@ -0,0 +1,24 @@ +Grid { + rows:2 + cols:2 + Rectangle { + color: "blue" + Text { + anchors.centerIn: parent + text: "Hello, Twitter! 🦀" + } + } + Rectangle { + color: "red" + } + Rectangle { + color: "red" + } + Rectangle { + color: "blue" + Text { + anchors.centerIn: parent + text: "Hello, Twitter! 🦀" + } + } +} diff --git a/res/RedRectangle.qml b/res/RedRectangle.qml deleted file mode 100644 index c8280cb..0000000 --- a/res/RedRectangle.qml +++ /dev/null @@ -1,16 +0,0 @@ -Grid { - rows:2 - cols:2 - Rectangle { - color: "blue" - } - Rectangle { - color: "red" - } - Rectangle { - color: "red" - } - Rectangle { - color: "blue" - } -} \ No newline at end of file diff --git a/res/example.qml b/res/example.qml index f094772..9459707 100644 --- a/res/example.qml +++ b/res/example.qml @@ -2,8 +2,8 @@ Grid { rows: 2 columns: 2 - RedRectangle { - null:null + HelloTwitter { + } Rectangle {