From d2f54a8fe0e28d41247115151ec4fdedebfd5df4 Mon Sep 17 00:00:00 2001 From: Zhiqiang Zhang Date: Fri, 30 Aug 2024 15:57:27 +0800 Subject: [PATCH] add slint language support (#1054) --- README.md | 1 + languages.json | 6 ++++++ tests/data/slint.slint | 26 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/data/slint.slint diff --git a/README.md b/README.md index 50788128f..a1f43950e 100644 --- a/README.md +++ b/README.md @@ -532,6 +532,7 @@ Svg Swift Swig SystemVerilog +Slint Tact Tcl Tex diff --git a/languages.json b/languages.json index 2e0c0d53d..2c0c1614c 100644 --- a/languages.json +++ b/languages.json @@ -1649,6 +1649,12 @@ "quotes": [["\\\"", "\\\""]], "extensions": ["sv", "svh"] }, + "Slint": { + "line_comment": ["//"], + "multi_line_comments": [["/*", "*/"]], + "quotes": [["\\\"", "\\\""]], + "extensions": ["slint"] + }, "Tact": { "line_comment": ["//"], "multi_line_comments": [["/*", "*/"]], diff --git a/tests/data/slint.slint b/tests/data/slint.slint new file mode 100644 index 000000000..5a594485b --- /dev/null +++ b/tests/data/slint.slint @@ -0,0 +1,26 @@ +// 26 lines 21 code 2 comments 3 blanks + +component MyButton inherits Text { + color: black; + // ... +} + +export component MyApp inherits Window { + preferred-width: 200px; + preferred-height: 100px; + Rectangle { + width: 200px; + height: 100px; + background: green; + + }/* */ + MyButton { + x:0;y:0; // hello + text: "hello"; + } + MyButton { // world + y:0; + x: 50px; + text: "world"; + } +} \ No newline at end of file