Bläddra i källkod

[added] new sntax packs from Xorgroth (F95)

KevinSmarts 5 år sedan
förälder
incheckning
52b89e5be6

+ 6 - 4
syntax/VSCode/qsrc/CHANGELOG.md

@@ -1,8 +1,10 @@
 # Change Log
 All notable changes to the "qsrc" extension will be documented in this file.
 
-Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
-
-## 0.0.1
+## 0.2.0
 - Initial release
-- Ported atom grammars to VS Code
+- Ported atom grammars to VS Code
+
+## 0.2.1
+- Added missing file
+- Updated extension to work with newer VS Code.

+ 13 - 53
syntax/VSCode/qsrc/README.md

@@ -1,65 +1,25 @@
 # qsrc README
 
-This is the README for your extension "qsrc". After writing up a brief description, we recommend including the following sections.
-
-## Features
-
-Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
-
-For example if there is an image subfolder under your extension project workspace:
-
-\!\[feature X\]\(images/feature-x.png\)
-
-> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
-
-## Requirements
-
-If you have any requirements or dependencies, add a section describing those and how to install and configure them.
-
-## Extension Settings
-
-Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
-
-For example:
-
-This extension contributes the following settings:
-
-* `myExtension.enable`: enable/disable this extension
-* `myExtension.thing`: set to `blah` to do something
-
 ## Known Issues
 
-Calling out known issues can help limit users opening duplicate issues against your extension.
-
-## Release Notes
-
-Users appreciate release notes as you update your extension.
+Currently multi-line block comments that start with "!'" don't work and line comments that use "!&"
 
-### 1.0.0
+## Installation
+Extract into your .vscode/packages folder.
+On Linux it's probably in the home folder.
+On Windows it's usually located in your user folder.
 
-Initial release of ...
+## Release Notes
 
-### 1.0.1
+Ported grammars from Atom to VS Code. Syntax highlighting for QSP code including Quest navigator.
 
-Fixed issue #.
+### 0.2.0
 
-### 1.1.0
+Initial release
+Ported from Atom
 
-Added features X, Y, and Z.
+### 0.2.1
+Missing file added
+Updated for newer versions of VS Code.
 
 -----------------------------------------------------------------------------------------------------------
-
-## Working with Markdown
-
-**Note:** You can author your README using Visual Studio Code.  Here are some useful editor keyboard shortcuts:
-
-* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
-* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
-* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets
-
-### For more information
-
-* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
-* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
-
-**Enjoy!**

+ 24 - 0
syntax/VSCode/qsrc/language-configuration.json

@@ -0,0 +1,24 @@
+{
+    // symbols used as brackets
+    "brackets": [
+        ["{", "}"],
+        ["[", "]"],
+        ["(", ")"]
+    ],
+    // symbols that are auto closed when typing
+    "autoClosingPairs": [
+        ["{", "}"],
+        ["[", "]"],
+        ["(", ")"],
+        ["\"", "\""],
+        ["'", "'"]
+    ],
+    // symbols that that can be used to surround a selection
+    "surroundingPairs": [
+        ["{", "}"],
+        ["[", "]"],
+        ["(", ")"],
+        ["\"", "\""],
+        ["'", "'"]
+    ]
+}

+ 10 - 9
syntax/VSCode/qsrc/package.json

@@ -1,25 +1,26 @@
 {
     "name": "qsrc",
     "displayName": "qsrc",
-    "description": "QSP",
-    "version": "0.0.1",
+    "description": "QSP grammar",
+    "version": "0.2.1",
     "publisher": "Xorgroth",
     "engines": {
-        "vscode": "^1.27.0"
+        "vscode": "^1.28.0"
     },
     "categories": [
         "Programming Languages"
     ],
     "contributes": {
         "languages": [{
-            "id": "QSP",
-            "aliases": ["QSP", "QSP"],
+            "id": "qsp",
+            "aliases": ["QSP", "qsp"],
             "extensions": ["qsrc qsp-txt txt-qsp"],
+            "configuration": "./language-configuration.json"
         }],
         "grammars": [{
-            "language": "QSP",
-            "scopeName": "source.qsp",
-            "path": "./syntaxes/QSP.tmLanguage.json"
+            "language": "qsp",
+            "scopeName": "scope.qsp",
+            "path": "./syntaxes/qsp.tmLanguage.json"
         }]
     }
-}
+}

+ 118 - 119
syntax/VSCode/qsrc/syntaxes/QSP.tmLanguage.json

@@ -1,121 +1,120 @@
 {
-  "scopeName": "source.qsp",
-  "fileTypes": [
-    "qsrc",
-    "qsp-txt",
-    "txt-qsp"
-  ],
-  "name": "QSP",
-  "patterns": [
-    {
-      "name": "constant.character.LISP",
-      "match": "^(#)\\s?.+$"
-    },
-    {
-      "name": "constant.character.LISP",
-      "match": "\\b\\d+\\b"
-    },
-    {
-      "name": "variable.parameter.url.css",
-      "match": "^-{1,2}\\S.*?\\S-{1,2}$"
-    },
-    {
-      "name": "variable.parameter.url.css",
-      "match": "\\b(?i:([$]dyneval|[$]user_text|[$]usrtxt|[$]maintxt|[$]stattxt|[$]func|[$]curloc|[$]selobj|[$]selact|[$]curact|[$]getobj|[$]mid|[$](u|l)case|[$]trim|[$]replace|[$]str|[$]loc|[$]strfind))\\b"
-    },
-    {
-      "name": "variable.parameter.url.css",
-      "match": "\\b(?i:(dyneval|input|user_text|usrtxt|iif|rgb|isplay|msecscount|desc|maintxt|stattxt|qspver|func|curloc|selobj|no|and|mod|selact|curact|arrsize|arrpos|countobj|getobj|led|mid|(u|l)case|trim|replace|instr|isnum|val|str|loc|or|max|min|r(a)?nd|(arr|str)comp|str(find|pos)))\\b"
-    },
-    {
-      "name": "keyword.control.at-rule.charset.css",
-      "match": "\\b[$](?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b"
-    },
-    {
-      "name": "support.function.LISP",
-      "match": "\\b(?i:(act|exit|killvar|cla|\\*?clr|\\*?clear|gs|xgt|gt|goto|gosub|\\[|\\]|xgoto|if|else|elseif|end|jump|\\*|&|\\*?(n|p)l))\\b"
-    },
-    {
-      "name": "entity.other.attribute-name.class.css",
-      "match": "^(:)[^'\"]*$\n?"
-    },
-    {
-      "name": "keyword.control.at-rule.charset.css",
-      "match": "\\b(?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b"
-    },
-    {
-      "name": "keyword.control.at-rule.charset.css",
-      "match": "\\b(?i:(nosave|disablescroll|disablesubex|debug|usehtml|(b|f|l)color|fsize))\\b"
-    },
-    {
-      "name": "string.quoted.single.qsp",
-      "begin": "'",
-      "end": "'",
-      "patterns": [
-        {
-          "name": "string.interpolated.qsp",
-          "begin": "<<",
-          "end": ">>",
-          "patterns": [
-            {
-              "include": "$self"
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "name": "string.quoted.double.qsp",
-      "begin": "\"",
-      "end": "\"",
-      "patterns": [
-        {
-          "name": "string.interpolated.qsp",
-          "begin": "<<",
-          "end": ">>",
-          "patterns": [
-            {
-              "include": "$self"
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "folds": [
-        {
-          "type": "comment"
-        },
-        {
-          "type": "if_statement",
-          "start": {
-            "type": [
-              "elif_clause",
-              "else_clause"
-            ]
-          },
-          "end": "end"
-        }
-      ]
-    },
-    {
-      "name": "support.function.LISP",
-      "match": "(?i:(,|\\[|\\]|\\(|\\)|\\{|\\}|&|\\+|=|-|(<|>)=?|=?(<|>)))"
-    },
-    {
-      "name": "comment.block.exclamation.qsp",
-      "begin": "!{",
-      "end": "}!$"
-    },
-    {
-      "name": "comment.line.exclamation.qsp",
-      "begin": "^!.*",
-      "end": "$"
-    },
-    {
-      "name": "comment.line.exclamation.qsp",
-      "begin": "^\\s+!.*",
-      "end": "$"
-    }
-  ]
+	"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
+	"name": "QSP",
+	"patterns": [
+		{
+			"include": "#strings"
+		},
+		{
+			"name": "entity.other.attribute-name.qsp",
+			"match": "^(:)[^'\"]*$\n?"
+		},
+		{
+			"name": "variable.parameter.url.qsp",
+			"match": "^-{1,2}\\S.*?\\S-{1,2}$"
+		},
+		{
+			"name": "constant.character.qsp",
+			"match": "^(#)\\s?.+$"
+		},
+		{
+			"name": "constant.character.qsp",
+			"match": "\\b\\d+\\b"
+		},
+		{
+			"name": "variable.parameter.url.qsp",
+			"match": "\\b(?i:([$]dyneval|[$]user_text|[$]usrtxt|[$]maintxt|[$]stattxt|[$]func|[$]curloc|[$]selobj|[$]selact|[$]curact|[$]getobj|[$]mid|[$](u|l)case|[$]trim|[$]replace|[$]str|[$]loc|[$]strfind))\\b"
+		},
+		{
+			"name": "variable.parameter.url.qsp",
+			"match": "\\b(?i:(dyneval|input|user_text|usrtxt|iif|rgb|isplay|msecscount|desc|maintxt|stattxt|qspver|func|curloc|selobj|no|and|mod|selact|curact|arrsize|arrpos|countobj|getobj|led|mid|(u|l)case|trim|replace|instr|isnum|val|str|loc|or|max|min|r(a)?nd|(arr|str)comp|str(find|pos)))\\b"
+		},
+		{
+			"name": "keyword.control.qsp",
+			"match": "\\b[$](?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b"
+		},
+		{
+			"name": "keyword.control.qsp",
+			"match": "\\b(?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b"
+		},
+		{
+			"name": "keyword.control.qsp",
+			"match": "\\b(?i:(nosave|disablescroll|disablesubex|debug|usehtml|(b|f|l)color|fsize))\\b"
+		},
+		{
+			"name": "support.function.qsp",
+			"match": "\\b(?i:(act|exit|killvar|cla|\\*?clr|\\*?clear|gs|xgt|gt|goto|gosub|\\[|\\]|xgoto|if|else|elseif|end|jump|\\*|&|\\*?(n|p)l))\\b"
+		},
+		{
+			"name": "support.function.qsp",
+			"match": "(?i:(,|\\[|\\]|\\(|\\)|\\{|\\}|&|\\+|=|-|(<|>)=?|=?(<|>)))"
+		},
+		{
+			"name": "comment.block.exclamation.qsp",
+			"begin": "!{",
+			"end": "}!$"
+		},
+		{
+			"name": "comment.line.exclamation.qsp",
+			"begin": "^!.*",
+			"end": "$"
+		},
+		{
+			"name": "comment.line.exclamation.qsp",
+			"begin": "^\\s+!.*",
+			"end": "$"
+		},
+		{
+			"folds": [
+				{
+					"type": "comment"
+				},
+				{
+					"type": "if_statement",
+					"start": {
+						"type": [
+							"elif_clause",
+							"else_clause"
+						]
+					},
+					"end": "end"
+				}
+			]
+		}
+	],
+	"repository": {
+		"strings": {
+			"name": "string.quoted.double.qsp",
+			"begin": "\"",
+			"end": "\"",
+			"patterns": [
+				{
+					"name": "string.interpolated.qsp",
+					"begin": "<<",
+					"end": ">>",
+					"patterns": [
+						{
+							"include": "$self"
+						}
+					]
+				}
+			],
+			"name": "string.quoted.single.qsp",
+			"begin": "'",
+			"end": "'",
+			"patterns": [
+				{
+					"name": "string.interpolated.qsp",
+					"begin": "<<",
+					"end": ">>",
+					"patterns": [
+						{
+							"include": "$self"
+						}
+					]
+				}
+			]
+		}
+	},
+	"scopeName": "scope.qsp"
 }

+ 6 - 0
syntax/atom/qsrc/CHANGELOG.md

@@ -0,0 +1,6 @@
+# Change Log
+All notable changes to the "qsrc" extension will be documented in this file.
+
+## 0.2.0
+- Initial release
+- Removed QSP decoding, since it no longer worked.

+ 24 - 0
syntax/atom/qsrc/README.md

@@ -0,0 +1,24 @@
+# qsrc README
+
+## Known Issues
+
+Currently multi-line block comments that start with "!'" don't work and line comments that use "!&"
+
+## Installation
+Extract into your .atom/packages folder.
+On Linux it's probably in the home folder.
+On Windows it's usually located in your user folder.
+
+## Release Notes
+
+Ported grammars to Atom. Syntax highlighting for QSP code including Quest navigator.
+
+### 0.2.0
+
+Initial release
+Ported from Atom
+
+### 0.2.1
+Removed QSP decoding and encoding since it was non-functional.
+
+-----------------------------------------------------------------------------------------------------------

+ 121 - 0
syntax/atom/qsrc/grammars/qsp.json

@@ -0,0 +1,121 @@
+{
+  "scopeName": "source.qsrc",
+  "fileTypes": [
+    "qsrc",
+    "qsp-txt",
+    "txt-qsp"
+  ],
+  "name": "QSP",
+  "patterns": [
+    {
+      "name": "constant.character.LISP",
+      "match": "^(#)\\s?.+$"
+    },
+    {
+      "name": "constant.character.LISP",
+      "match": "\\b\\d+\\b"
+    },
+    {
+      "name": "variable.parameter.url.css",
+      "match": "^-{1,2}\\S.*?\\S-{1,2}$"
+    },
+    {
+      "name": "variable.parameter.url.css",
+      "match": "\\b(?i:([$]dyneval|[$]user_text|[$]usrtxt|[$]maintxt|[$]stattxt|[$]func|[$]curloc|[$]selobj|[$]selact|[$]curact|[$]getobj|[$]mid|[$](u|l)case|[$]trim|[$]replace|[$]str|[$]loc|[$]strfind))\\b"
+    },
+    {
+      "name": "variable.parameter.url.css",
+      "match": "\\b(?i:(dyneval|input|user_text|usrtxt|iif|rgb|isplay|msecscount|desc|maintxt|stattxt|qspver|func|curloc|selobj|no|and|mod|selact|curact|arrsize|arrpos|countobj|getobj|led|mid|(u|l)case|trim|replace|instr|isnum|val|str|loc|or|max|min|r(a)?nd|(arr|str)comp|str(find|pos)))\\b"
+    },
+    {
+      "name": "keyword.control.at-rule.charset.css",
+      "match": "\\b[$](?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b"
+    },
+    {
+      "name": "support.function.LISP",
+      "match": "\\b(?i:(act|exit|killvar|cla|\\*?clr|\\*?clear|gs|xgt|gt|goto|gosub|\\[|\\]|xgoto|if|else|elseif|end|jump|\\*|&|\\*?(n|p)l))\\b"
+    },
+    {
+      "name": "entity.other.attribute-name.class.css",
+      "match": "^(:)[^'\"]*$\n?"
+    },
+    {
+      "name": "keyword.control.at-rule.charset.css",
+      "match": "\\b(?i:(counter|ongload|ongsave|onnewloc|onactsel|onobjsel|onobjadd|onobjdel|usercom|fname|backimage|args|result))\\b"
+    },
+    {
+      "name": "keyword.control.at-rule.charset.css",
+      "match": "\\b(?i:(nosave|disablescroll|disablesubex|debug|usehtml|(b|f|l)color|fsize))\\b"
+    },
+    {
+      "name": "string.quoted.single.qsp",
+      "begin": "'",
+      "end": "'",
+      "patterns": [
+        {
+          "name": "string.interpolated.qsp",
+          "begin": "<<",
+          "end": ">>",
+          "patterns": [
+            {
+              "include": "$self"
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "name": "string.quoted.double.qsp",
+      "begin": "\"",
+      "end": "\"",
+      "patterns": [
+        {
+          "name": "string.interpolated.qsp",
+          "begin": "<<",
+          "end": ">>",
+          "patterns": [
+            {
+              "include": "$self"
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "folds": [
+        {
+          "type": "comment"
+        },
+        {
+          "type": "if_statement",
+          "start": {
+            "type": [
+              "elif_clause",
+              "else_clause"
+            ]
+          },
+          "end": "end"
+        }
+      ]
+    },
+    {
+      "name": "support.function.LISP",
+      "match": "(?i:(,|\\[|\\]|\\(|\\)|\\{|\\}|&|\\+|=|-|(<|>)=?|=?(<|>)))"
+    },
+    {
+      "name": "comment.block.exclamation.qsp",
+      "begin": "!{",
+      "end": "}!$"
+    },
+    {
+      "name": "comment.line.exclamation.qsp",
+      "begin": "^!.*",
+      "end": "$"
+    },
+    {
+      "name": "comment.line.exclamation.qsp",
+      "begin": "^\\s+!.*",
+      "end": "$"
+    }
+  ]
+}

+ 20 - 0
syntax/atom/qsrc/package.json

@@ -0,0 +1,20 @@
+{
+  "name": "language-qsrc",
+  "version": "0.2.1",
+  "description": "QSP language grammar",
+  "repository": "https://github.com/Xorgroth/language-qsp",
+  "keywords": [
+    "syntax",
+    "highlighting",
+    "grammar"
+  ],
+  "license": "The Unlicense",
+  "engines": {
+    "atom": ">=1.0.0 <2.0.0"
+  },
+  "grammars": {
+      "language": "QSP",
+      "scopeName": "source.qsrc",
+      "path": "./grammars/qsp.json"
+  }
+}