diff --git a/README.md b/README.md new file mode 100644 index 0000000..50788f0 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +Daedalus for Visual Studio Code [![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/szymonzak.daedalus.svg)](https://marketplace.visualstudio.com/items?itemName=szymonzak.daedalus) +============================= + +This is Visual Studio Code extension providing support of Daedalus language used for gameplay scripting in games on ZenGin engine (Gothic I, II & II:NoTR). +The project was developed primarily for [SoulFire](https://thehistoryofkhorinis.com). diff --git a/images/gothic-icon.png b/images/gothic-icon.png new file mode 100644 index 0000000..e335c80 Binary files /dev/null and b/images/gothic-icon.png differ diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..aa25710 --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,30 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "//", + // symbols used for start and end a block comment. Remove this entry if your language does not support block comments + "blockComment": [ "/*", "*/" ] + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + // symbols that that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..64a4cba --- /dev/null +++ b/package.json @@ -0,0 +1,50 @@ +{ + "name": "daedalus", + "displayName": "Daedalus", + "description": "Language for gameplay scripting in games on ZenGin engine (Gothic I, II & II: NoTR)", + "version": "0.1.0", + "publisher": "SzymonZak", + "keywords": [ + "gothic", + "modding" + ], + "preview": true, + "icon": "images/gothic-icon.png", + "repository": { + "type": "git", + "url": "https://github.com/Szmyk/daedalus-vscode.git" + }, + "engines": { + "vscode": "^1.14.0" + }, + "categories": [ + "Languages" + ], + "contributes": { + "languages": [ + { + "id": "daedalus", + "aliases": [ + "Daedalus", + "daedalus" + ], + "extensions": [ + ".d" + ], + "configuration": "./language-configuration.json" + } + ], + "grammars": [ + { + "language": "daedalus", + "scopeName": "daedalus", + "path": "./syntaxes/daedalus.tmLanguage" + } + ] + }, + "__metadata": { + "id": "73464e80-12a3-4e9e-b594-9ee5ce996453", + "publisherId": "c881cb11-f3a6-49a1-a536-0d957e2ac057", + "publisherDisplayName": "Szymon Zak" + } +} \ No newline at end of file diff --git a/syntaxes/daedalus.tmLanguage b/syntaxes/daedalus.tmLanguage new file mode 100644 index 0000000..4a8d1d6 --- /dev/null +++ b/syntaxes/daedalus.tmLanguage @@ -0,0 +1,332 @@ + + + + + fileTypes + + d + + + foldingStartMarker + (?x) + /\*\*(?!\*) + |^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) + + foldingStopMarker + (?<!\*)\*\*/|^\s*\} + name + Daedalus + patterns + + + patterns + + + captures + + 1 + + name + meta.toc-list.banner.block.daedalus + + + match + ^/\* =(\s*.*?)\s*= \*/$\n? + name + comment.block.daedalus + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.daedalus + + + end + \*/ + name + comment.block.c + + + match + \*/.*\n + name + invalid.illegal.stray-comment-end.daedalus + + + captures + + 1 + + name + meta.toc-list.banner.line.daedalus + + + match + ^// =(\s*.*?)\s*=\s*$\n? + name + comment.line.banner.daedalus + + + begin + // + beginCaptures + + 0 + + name + punctuation.definition.comment.daedalus + + + end + $\n? + name + comment.line.double-slash.daedalus + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.daedalus + + + + + + + + patterns + + + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b + name + constant.numeric.daedalus + + + + + + patterns + + + match + \b(float|string|int|void)\b + name + storage.type.daedalus + + + match + \b(class|instance|prototype)\b + name + storage.type.structure.daedalus + + + match + \b(const|var)\b + name + storage.modifier.daedalus + + + match + \b(func|NULL|null)\b + name + keyword.daedalus + + + match + \b(true|false)\b + name + constant.language.boolean.daedalus + + + match + \b(return|if|else)\b + name + keyword.control.daedalus + + + match + \b(if|else)\b + name + keyword.control.conditional.daedalus + + + match + \b(return)\b + name + keyword.control.statement.daedalus + + + match + \b(self|other|hero)\b + name + variable.daedalus + + + + + + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.daedalus + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.daedalus + + + name + string.quoted.double.daedalus + patterns + + + include + #string_escaped_char + + + + + + + + captures + + 1 + + name + punctuation.whitespace.function-call.leading.daedalus + + 2 + + name + support.function.any-method.daedalus + + 3 + + name + punctuation.definition.parameters.daedalus + + + match + (?x) (?: (?= \s ) (?:(?<=else|return) | (?<!\w)) (\s+))? + (\b + (?!(if|else|return)\s*\()(?:(?!NS)[A-Za-z_][A-Za-z0-9_]*+\b | :: )++ # actual name + ) + \s*(\() + + name + meta.function-call.daedalus + + + + captures + + 1 + + name + variable.other.daedalus + + 2 + + name + punctuation.definition.parameters.daedalus + + + match + (?x) + (?x) + (?: + (?: (?= \s ) (?<!else|return) (?<=\w)\s+ # or word + space before name + ) + ) + ( + (?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | # actual name + (?: (?<=operator) (?: [-*&<>=+!]+ | \(\) | \[\] ) )? + ) + \s*(\() + + name + meta.initialization.daedalus + + + include + #block + + + repository + + block + + begin + \{ + end + \} + name + meta.block.daedalus + patterns + + + include + #block_innards + + + + parens + + begin + \( + end + \) + name + meta.parens.daedalus + patterns + + + include + $base + + + + string_escaped_char + + patterns + + + match + \\(\\|[abefnprtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}) + name + constant.character.escape.daedalus + + + match + \\. + name + invalid.illegal.unknown-escape.daedalus + + + + + scopeName + daedalus + +