-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
286 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
@version 1.0 | ||
@name "Circle Tool" | ||
@by "HJfod" | ||
@input r 5.0 "Radius" | ||
@input id 1 "Object ID" | ||
@input count 40 "Object count" | ||
|
||
r *= 30.0 | ||
pos = getViewCenter() | ||
a = 0 | ||
for i in count { | ||
create(id, x = pos.x + cos(a) * r, y = pos.y + sin(a) * r, rotation = 360 - a) | ||
a += 360 / count | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@version 1.0 | ||
@name "Deselect Random" | ||
@by "HJfod" | ||
|
||
objs = getSelectedObjects() | ||
for obj in objs { | ||
if random() > 0.5 { | ||
obj.deselect() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
@version 1.0 | ||
@name "Swipe test" | ||
@by "HJfod" | ||
|
||
function vararg(named, x, y, args...) { | ||
// todo: why tf is this not just args[0], args[1]??? why is args not just an array??? | ||
print("named: {}, x: {}, y: {}, argument0: {}, argument1: {}", argument0, argument1) | ||
} | ||
|
||
vararg("hi", 5, true, "six", y = 6, ball) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"comments": { | ||
"lineComment": "//", | ||
"blockComment": [ "/*", "*/" ] | ||
}, | ||
"brackets": [ | ||
["{", "}"], | ||
["[", "]"], | ||
["(", ")"] | ||
], | ||
"autoClosingPairs": [ | ||
{ "open": "{", "close": "}", "autoCloseBefore": ";:.,=}])>` \n\t" }, | ||
["[", "]"], | ||
["(", ")"], | ||
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }, | ||
{ "open": "\"", "close": "\"", "notIn": ["string"] }, | ||
{ "open": "`", "close": "`", "notIn": ["string", "comment"] }, | ||
{ "open": "/**", "close": " */", "notIn": ["string"] } | ||
], | ||
"surroundingPairs": [ | ||
["{", "}"], | ||
["[", "]"], | ||
["(", ")"], | ||
["<", ">"], | ||
["\"", "\""], | ||
["'", "'"], | ||
["`", "`"] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "swipelang-support", | ||
"displayName": "Swipe Language Support", | ||
"description": "Support for the Swipe language for scripting in BetterEdit", | ||
"author": { | ||
"name": "HJfod", | ||
"url": "https://github.com/hjfod" | ||
}, | ||
"repository": { | ||
"url": "https://github.com/hjfod/BetterEdit" | ||
}, | ||
"publisher": "HJfod", | ||
"version": "0.0.1", | ||
"engines": { | ||
"vscode": "^1.67.0" | ||
}, | ||
"categories": [ | ||
"Programming Languages" | ||
], | ||
"contributes": { | ||
"languages": [{ | ||
"id": "swipe", | ||
"aliases": ["Swipe"], | ||
"extensions": [".swipe"], | ||
"configuration": "./language-configuration.json", | ||
"icon": { | ||
"dark": "./swipe.png", | ||
"light": "./swipe.png" | ||
} | ||
}], | ||
"grammars": [{ | ||
"language": "swipe", | ||
"scopeName": "source.swipe", | ||
"path": "./syntaxes/swipe.tmLanguage.json" | ||
}] | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
"name": "swipe", | ||
"patterns": [ | ||
{ | ||
"include": "#language" | ||
} | ||
], | ||
"repository": { | ||
"language": { | ||
"patterns": [ | ||
{ | ||
"include": "#comments" | ||
}, | ||
{ | ||
"include": "#constants" | ||
}, | ||
{ | ||
"include": "#keywords" | ||
}, | ||
{ | ||
"include": "#strings" | ||
}, | ||
{ | ||
"include": "#declarations" | ||
}, | ||
{ | ||
"include": "#parenthesis" | ||
}, | ||
{ | ||
"include": "#operators" | ||
}, | ||
{ | ||
"include": "#expression" | ||
} | ||
] | ||
}, | ||
"declarations": { | ||
"patterns": [ | ||
{ | ||
"match": "(?<=const\\s+)[a-zA-Z]+", | ||
"name": "variable.other.constant.swipe" | ||
}, | ||
{ | ||
"match": "(?<=new\\s*)[a-zA-Z0-9_]+", | ||
"name": "entity.name.type.swipe" | ||
}, | ||
{ | ||
"match": "\\b(\\w+\\!?)(?=\\s*\\()", | ||
"captures": { | ||
"1": { | ||
"name": "entity.name.function.swipe" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"keywords": { | ||
"patterns": [ | ||
{ | ||
"name": "keyword.control.swipe", | ||
"match": "\\b(for|while|if|else|try|return|break|continue|new)\\b" | ||
}, | ||
{ | ||
"name": "keyword.control.meta.swipe", | ||
"match": "(@([a-zA-Z]+))\\b" | ||
}, | ||
{ | ||
"name": "storage.type.swipe", | ||
"match": "(?<=@input\\s+)(number|string|boolean)\\b" | ||
}, | ||
{ | ||
"name": "keyword.other.swipe", | ||
"match": "\\b(in)\\b" | ||
}, | ||
{ | ||
"name": "storage.type.swipe", | ||
"match": "\\b(const|function)\\b" | ||
}, | ||
{ | ||
"name": "punctuation.swipe", | ||
"match": "(->)|\\.|;|,|:|\\?|#" | ||
} | ||
] | ||
}, | ||
"operators": { | ||
"name": "keyword.operator.swipe", | ||
"match": "[\\+\\-\\*\\/=<>\\^\\|\\&\\!%~@]" | ||
}, | ||
"strings": { | ||
"patterns": [ | ||
{ | ||
"name": "string.quoted.double.swipe", | ||
"begin": "\"", | ||
"end": "\"", | ||
"patterns": [ | ||
{ | ||
"name": "constant.character.escape.swipe", | ||
"match": "\\\\." | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"constants": { | ||
"patterns": [ | ||
{ | ||
"name": "constant.numeric.swipe", | ||
"match": "\\b(([0-9]*\\.[0-9]+)|([0-9]+))\\b" | ||
}, | ||
{ | ||
"name": "constant.numeric.swipe", | ||
"match": "0x[0-9A-Fa-f]+" | ||
}, | ||
{ | ||
"name": "constant.language.swipe", | ||
"match": "\\b((argument[0-9]*)|arguments|namedArguments|this)\\b" | ||
}, | ||
{ | ||
"name": "constant.language.swipe", | ||
"match": "\\b(true|false|null)\\b" | ||
} | ||
] | ||
}, | ||
"comments": { | ||
"patterns": [ | ||
{ | ||
"name": "comment.block", | ||
"begin": "/\\*", | ||
"end": "\\*/" | ||
}, | ||
{ | ||
"name": "comment.line", | ||
"begin": "//", | ||
"end": "\n" | ||
} | ||
] | ||
}, | ||
"parenthesis": { | ||
"patterns": [ | ||
{ | ||
"begin": "\\(", | ||
"end": "\\)", | ||
"beginCaptures": { | ||
"0": { "name": "punctuation.paren.open" } | ||
}, | ||
"endCaptures": { | ||
"0": { "name": "punctuation.paren.close" } | ||
}, | ||
"name": "expression.group", | ||
"patterns": [{ "include": "#language" }] | ||
}, | ||
{ | ||
"begin": "\\{", | ||
"end": "\\}", | ||
"beginCaptures": { | ||
"0": { "name": "punctuation.paren.open" } | ||
}, | ||
"endCaptures": { | ||
"0": { "name": "punctuation.paren.close" } | ||
}, | ||
"name": "expression.group", | ||
"patterns": [{ "include": "#language" }] | ||
}, | ||
{ | ||
"begin": "\\[", | ||
"end": "\\]", | ||
"beginCaptures": { | ||
"0": { "name": "punctuation.paren.open" } | ||
}, | ||
"endCaptures": { | ||
"0": { "name": "punctuation.paren.close" } | ||
}, | ||
"name": "expression.group", | ||
"patterns": [{ "include": "#language" }] | ||
} | ||
] | ||
} | ||
}, | ||
"scopeName": "source.swipe" | ||
} |