Skip to content

Commit

Permalink
add slint language support (#1054)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzqs authored Aug 30, 2024
1 parent 143a99a commit d2f54a8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ Svg
Swift
Swig
SystemVerilog
Slint
Tact
Tcl
Tex
Expand Down
6 changes: 6 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,12 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["sv", "svh"]
},
"Slint": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
"quotes": [["\\\"", "\\\""]],
"extensions": ["slint"]
},
"Tact": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
Expand Down
26 changes: 26 additions & 0 deletions tests/data/slint.slint
Original file line number Diff line number Diff line change
@@ -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";
}
}

0 comments on commit d2f54a8

Please # to comment.