Skip to content

Commit d94d542

Browse files
committed
Syntax Highlighting
1 parent 6c6016d commit d94d542

File tree

7 files changed

+3785
-155
lines changed

7 files changed

+3785
-155
lines changed

README.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,17 @@ Welcome to the **DuckyScript Cookbook** — your quacktastic assistant for whipp
66

77
_This is not an official extension of Hak5 or Flipper Zero but was developed by a third party._
88

9-
⚠️ This extension is in a beta version, many things still need to be added, report them if you like! ⚠️
10-
11-
<img src="https://github.com/VSCodium/icons/raw/main/icons/linux/nobg/blue1/paulo22s.png" width="50" /> - _VSCodium soon..._ - <a href="https://marketplace.visualstudio.com/items?itemName=Aleff.duckyscriptcookbook"><img src="https://code.visualstudio.com/assets/images/code-stable.png" width="50" /></a>
9+
<a href="https://marketplace.visualstudio.com/items?itemName=Aleff.duckyscriptcookbook"><img src="https://code.visualstudio.com/assets/images/code-stable.png" width="50" /></a>
1210

1311
![](https://github.com/aleff-github/Deposito/blob/main/DuckyScriptCookbook/Hak5%20Disclaimer.png?raw=true)
1412

15-
## Index
16-
17-
- [What's Cooking? 🍳](#whats-cooking-)
18-
- [Features That Will Make You Quack with Joy 🥳](#features-that-will-make-you-quack-with-joy-)
19-
- [🐤 A Duck Icon for Your Text Files](#-a-duck-icon-for-your-text-files)
20-
- [📖 Ready-to-Use Recipes (Sadly, Not Edible)](#-ready-to-use-recipes-sadly-not-edible)
21-
- [📝 Useful Snippets and Where to Find Them](#-useful-snippets-and-where-to-find-them)
22-
- [😎 A Cool Style to Show Off to Your Desk Neighbors](#-a-cool-style-to-show-off-to-your-desk-neighbors)
23-
- [How to Use This Ducktastic Extension 🦆💻](#how-to-use-this-ducktastic-extension-)
24-
- [Why You'll Love It ❤️](#why-youll-love-it-%EF%B8%8F)
25-
- [Feedback and Contributions 🗣️](feedback-and-contributions-%EF%B8%8F)
26-
- [License 📄](#license-)
27-
- [Special Thanks 🎉](#special-thanks-)
28-
- [↳ Stargazers](#-stargazers)
29-
- [↳ Forkers](#-forkers)
30-
- [Credits](#credits)
13+
## New Feature: Syntax Highlighting Dark && Light
14+
15+
To properly enable Syntax Highlighting you need to enable the Dark or Light theme of DuckyScript. To do this you can click F1, type “theme” and select the theme you like best.
16+
17+
![](https://github.com/aleff-github/Deposito/blob/main/DuckyScriptCookbook/dark.png?raw=true)
3118

19+
![](https://github.com/aleff-github/Deposito/blob/main/DuckyScriptCookbook/light.png?raw=true)
3220

3321
## What's Cooking? 🍳
3422

language-configuration.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"comments": {
3+
"lineComment": "REM"
4+
},
5+
"brackets": [
6+
["{", "}"],
7+
["[", "]"],
8+
["(", ")"]
9+
],
10+
"autoClosingPairs": [
11+
{ "open": "{", "close": "}" },
12+
{ "open": "[", "close": "]" },
13+
{ "open": "(", "close": ")" },
14+
{ "open": "\"", "close": "\"" },
15+
{ "open": "'", "close": "'" }
16+
],
17+
"surroundingPairs": [
18+
{ "open": "{", "close": "}" },
19+
{ "open": "[", "close": "]" },
20+
{ "open": "(", "close": ")" },
21+
{ "open": "\"", "close": "\"" },
22+
{ "open": "'", "close": "'" }
23+
],
24+
"folding": {
25+
"markers": {
26+
"start": "^REM_BLOCK",
27+
"end": "^END_REM"
28+
}
29+
}
30+
}

media/css/main.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ body {
4545
-webkit-user-drag: none;
4646
-khtml-user-drag: none;
4747

48-
background: rgb(37, 37, 38);
48+
background: #4373c2;
4949
color: white;
5050
}
5151

@@ -124,7 +124,7 @@ body {
124124
display: flex;
125125
justify-content: center;
126126
align-items: center;
127-
background: #000;
127+
background: #011627;
128128
min-height: 100vh;
129129
}
130130
.list {

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "duckyscriptcookbook",
33
"displayName": "DuckyScript Cookbook",
44
"description": "DuckyScript Cookbook is a VSCode extension that simplifies writing DuckyScript code for USB Rubber Ducky devices.",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"publisher": "Aleff",
77
"engines": {
88
"vscode": "^1.74.3"
@@ -12,6 +12,7 @@
1212
},
1313
"categories": [
1414
"Programming Languages",
15+
"Themes",
1516
"Snippets"
1617
],
1718
"main": "./out/extension.js",
@@ -21,6 +22,7 @@
2122
"id": "duckyscript",
2223
"aliases": [
2324
"DuckyScript",
25+
"duckyscript",
2426
"ds"
2527
],
2628
"extensions": [
@@ -31,7 +33,8 @@
3133
"icon": {
3234
"light": "./images/icon.png",
3335
"dark": "./images/icon.png"
34-
}
36+
},
37+
"configuration": "./language-configuration.json"
3538
}
3639
],
3740
"grammars": [
@@ -44,7 +47,7 @@
4447
"themes": [
4548
{
4649
"label": "DarkDuckyScript",
47-
"uiTheme": "vs-dark",
50+
"uiTheme": "vs",
4851
"path": "./themes/DarkDuckyScript-color-theme.json"
4952
},
5053
{

syntaxes/duckyscript.tmLanguage.json

Lines changed: 23 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,54 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
32
"name": "DuckyScript",
3+
"scopeName": "source.duckyscript",
44
"patterns": [
55
{
66
"include": "#comments"
77
},
88
{
99
"include": "#keywords"
10+
},
11+
{
12+
"include": "#code_blocks"
1013
}
1114
],
1215
"repository": {
1316
"comments": {
1417
"patterns": [
1518
{
16-
"include": "#in_line_comment"
19+
"name": "comments.inline.duckyscript",
20+
"match": "^\\s*\\t*REM\\s+.*$"
1721
},
1822
{
19-
"include": "#multi_line_comment"
20-
}
21-
],
22-
"repository": {
23-
"in_line_comment": {
24-
"patterns": [
25-
{
26-
"name": "comment.inline.duckyscript",
27-
"match": "^REM\\s+.*$"
28-
}
29-
]
30-
},
31-
"multi_line_comment": {
32-
"begin": "^REM_BLOCK(?:\\s.*)?$",
23+
"begin": "^\\s*\\t*REM_BLOCK(?:\\s.*)?$",
3324
"end": "^.*END_REM",
34-
"name": "comment.block.duckyscript"
25+
"name": "comments.block.duckyscript"
3526
}
36-
}
27+
]
3728
},
3829
"keywords": {
3930
"patterns": [
4031
{
41-
"include": "#declaration_keywords"
32+
"name": "keywords.declaration.duckyscript",
33+
"match": "(#|\\$)([A-Za-z0-9_-]+)"
4234
},
4335
{
44-
"include": "#operator_keywords"
36+
"name": "keywords.operator.duckyscript",
37+
"match": "(=|\\+|-|\\*|/|%|\\^|&|!=|<|>|\\|)"
4538
},
4639
{
47-
"include": "#statement_keywords"
40+
"name": "keywords.statement.duckyscript",
41+
"match": "(?<=\\s|\\t|^)(EXTENSION|END_EXTENSION|DEFINE|VAR|IF|ELSE|THEN|END_IF|WHILE|END_WHILE|FUNCTION|END_FUNCTION|[A-Za-z0-9]+\\(.*\\))(?=\\s|\\t|$)"
4842
},
4943
{
50-
"include": "#true_condition_keywords"
51-
}
52-
],
53-
"repository": {
54-
"declaration_keywords": {
55-
"patterns": [
56-
{
57-
"name": "keyword.declaration.duckyscript",
58-
"match": "(DEFINE|VAR)"
59-
}
60-
]
61-
},
62-
"operator_keywords": {
63-
"patterns": [
64-
{
65-
"name": "keyword.operator.duckyscript",
66-
"match": "(=|+|-|*|/|%|^)"
67-
}
68-
]
44+
"name": "keywords.truecondition.duckyscript",
45+
"match": "(TRUE|FALSE)"
6946
},
70-
"statement_keywords": {
71-
"patterns": [
72-
{
73-
"name": "keyword.statement.duckyscript",
74-
"match": "(IF|ELSE|THEN|END_IF|WHILE|END_WHILE)"
75-
}
76-
]
77-
},
78-
"true_condition_keywords": {
79-
"patterns": [
80-
{
81-
"name": "keyword.truecondition.duckyscript",
82-
"match": "(TRUE|FALSE)"
83-
}
84-
]
47+
{
48+
"name": "keywords.command.duckyscript",
49+
"match": "(?<=\\s|\\t|^)(STRING|STRING_POWERSHELL|STRING_BATCH|STRING_BASH|STRING_JAVASCRIPT|STRING_PYTHON|STRING_RUBY|STRING_HTML|END_STRING|STRINGLN|STRINGLN_POWERSHELL|STRINGLN_BATCH|STRINGLN_BASH|STRINGLN_JAVASCRIPT|STRINGLN_PYTHON|STRINGLN_RUBY|STRINGLN_HTML|END_STRINGLN|DELAY|ATTACKMODE|ENTER|ESCAPE|SHIFT|ALT|CTRL|GUI|DOWNARROW|DOWN|UPARROW|UP|LEFTARROW|LEFT|RIGHTARROW|RIGHT|TAB|CAPSLOCK|DELETE|DEL|END|ESC|HOME|INSERT|PAGEUP|PAGEDOWN|PRINTSCREEN|SPACE|BACKSPACE|BREAK|PAUSE|MENU|APP|F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|NUMLOCK|SCROLLLOCK|WINDOWS|CONTROL|COMMAND|OPTION|INJECT_MOD|WAIT_FOR_BUTTON_PRESS|LED_OFF|LED_R|LED_G|HID|STORAGE|OFF|ATTACKMODE|RANDOM_LOWERCASE_LETTER|RANDOM_UPPERCASE_LETTER|RANDOM_LETTER|RANDOM_NUMBER|RANDOM_SPECIAL|RANDOM_CHAR|VID_RANDOM|PID_RANDOM|MAN_RANDOM|PROD_RANDOM|SERIAL_RANDOM|HOLD|RESET|RESTART_PAYLOAD|STOP_PAYLOAD|HIDE_PAYLOAD|RESTORE_PAYLOAD|WAIT_FOR_CAPS_ON|WAIT_FOR_CAPS_OFF|WAIT_FOR_CAPS_CHANGE|WAIT_FOR_NUM_ON|WAIT_FOR_NUM_OFF|WAIT_FOR_NUM_CHANGE|WAIT_FOR_SCROLL_ON|WAIT_FOR_SCROLL_OFF|WAIT_FOR_SCROLL_CHANGE|SAVE_HOST_KEYBOARD_LOCK_STATE|RESTORE_HOST_KEYBOARD_LOCK_STATE|EXFIL)(?=\\s|\\t|$)"
8550
}
86-
}
51+
]
8752
}
88-
},
89-
"scopeName": "source.asp"
90-
}
53+
}
54+
}

0 commit comments

Comments
 (0)