summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRedfire <redfire75369@hotmail.com>2022-08-14 01:45:46 +0800
committerGitHub <noreply@github.com>2022-08-13 19:45:46 +0200
commit2e900ba2760db8da9a6c88f08b959eacac57b149 (patch)
tree2000f57b5354a272849e8514078caceb600f8bef
parente6b7ab5f916c842b55753fb35e766c1af7bd722f (diff)
Added Forge Config and ZenCode Support (#783)
* Added ZenCode Support * Sorted languages according to language key * Added Minecraft Forge Config Support * Added Forge Config to README Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>
-rw-r--r--README.md2
-rw-r--r--languages.json302
-rw-r--r--tests/data/forgecfg.cfg79
-rw-r--r--tests/data/zencode.zs21
4 files changed, 259 insertions, 145 deletions
diff --git a/README.md b/README.md
index 1ab7d12..a31d3f9 100644
--- a/README.md
+++ b/README.md
@@ -363,6 +363,7 @@ Factor
FEN
Fish
FlatBuffers
+ForgeConfig
Forth
FortranLegacy
FortranModern
@@ -510,6 +511,7 @@ Xml
XSL
Xtend
Yaml
+ZenCode
Zig
Zsh
```
diff --git a/languages.json b/languages.json
index 658742a..66adcef 100644
--- a/languages.json
+++ b/languages.json
@@ -19,15 +19,15 @@
"line_comment": ["--"],
"extensions": ["ada", "adb", "ads", "pad"]
},
- "Alex": {
- "extensions": ["x"]
- },
"Agda": {
"nested": true,
"line_comment": ["--"],
"multi_line_comments": [["{-", "-}"]],
"extensions": ["agda"]
},
+ "Alex": {
+ "extensions": ["x"]
+ },
"Alloy": {
"line_comment": ["--", "//"],
"multi_line_comments": [["/*", "*/"]],
@@ -52,18 +52,6 @@
"multi_line_comments": [["/*", "*/"]],
"extensions": ["asn1"]
},
- "Assembly": {
- "line_comment": [";"],
- "quotes": [["\\\"", "\\\""], ["'", "'"]],
- "extensions": ["asm"]
- },
- "AssemblyGAS": {
- "name": "GNU Style Assembly",
- "line_comment": ["//"],
- "multi_line_comments": [["/*", "*/"]],
- "quotes": [["\\\"", "\\\""]],
- "extensions": ["s"]
- },
"Asp": {
"name": "ASP",
"line_comment": ["'", "REM"],
@@ -82,6 +70,18 @@
"webinfo"
]
},
+ "Assembly": {
+ "line_comment": [";"],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "extensions": ["asm"]
+ },
+ "AssemblyGAS": {
+ "name": "GNU Style Assembly",
+ "line_comment": ["//"],
+ "multi_line_comments": [["/*", "*/"]],
+ "quotes": [["\\\"", "\\\""]],
+ "extensions": ["s"]
+ },
"Ats": {
"name": "ATS",
"line_comment": ["//"],
@@ -112,14 +112,6 @@
"shebangs": ["#!/bin/awk -f"],
"extensions": ["awk"]
},
- "Sh": {
- "name": "Shell",
- "shebangs": ["#!/bin/sh"],
- "line_comment": ["#"],
- "quotes": [["\\\"", "\\\""], ["'", "'"]],
- "env": ["sh"],
- "extensions": ["sh"]
- },
"Bash": {
"name": "BASH",
"shebangs": ["#!/bin/bash"],
@@ -128,29 +120,6 @@
"env": ["bash"],
"extensions": ["bash"]
},
- "BrightScript": {
- "quotes": [["\\\"", "\\\""]],
- "line_comment": ["'", "REM"],
- "extensions": ["brs"]
- },
- "Elvish": {
- "line_comment": ["#"],
- "quotes": [["\\\"", "\\\""], ["'", "'"]],
- "env": ["elvish"],
- "extensions": ["elv"]
- },
- "Fennel" : {
- "line_comment": [";", ";;"],
- "quotes": [["\\\"", "\\\""]],
- "extensions": ["fnl"]
- },
- "Fish": {
- "shebangs": ["#!/bin/fish"],
- "line_comment": ["#"],
- "quotes": [["\\\"", "\\\""], ["'", "'"]],
- "env": ["fish"],
- "extensions": ["fish"]
- },
"Batch": {
"line_comment": ["REM", "::"],
"extensions": ["bat", "btm", "cmd"]
@@ -160,6 +129,11 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["bean", "beancount"]
},
+ "BrightScript": {
+ "quotes": [["\\\"", "\\\""]],
+ "line_comment": ["'", "REM"],
+ "extensions": ["brs"]
+ },
"C": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
@@ -196,15 +170,15 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["clj"]
},
- "ClojureScript": {
+ "ClojureC": {
"line_comment": [";"],
"quotes": [["\\\"", "\\\""]],
- "extensions": ["cljs"]
+ "extensions": ["cljc"]
},
- "ClojureC": {
+ "ClojureScript": {
"line_comment": [";"],
"quotes": [["\\\"", "\\\""]],
- "extensions": ["cljc"]
+ "extensions": ["cljs"]
},
"CMake": {
"line_comment": ["#"],
@@ -334,14 +308,6 @@
"quotes": [["\\\"", "\\\""], ["''", "''"]],
"extensions": ["dhall"]
},
- "DreamMaker": {
- "name": "Dream Maker",
- "line_comment": ["//"],
- "multi_line_comments": [["/*", "*/"]],
- "nested": true,
- "extensions": ["dm", "dme"],
- "quotes": [["\\\"", "\\\""], ["{\\\"", "\\\"}"], ["'", "'"]]
- },
"Dockerfile": {
"line_comment": ["#"],
"extensions": ["dockerfile", "dockerignore"],
@@ -354,6 +320,14 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["resx"]
},
+ "DreamMaker": {
+ "name": "Dream Maker",
+ "line_comment": ["//"],
+ "multi_line_comments": [["/*", "*/"]],
+ "nested": true,
+ "extensions": ["dm", "dme"],
+ "quotes": [["\\\"", "\\\""], ["{\\\"", "\\\"}"], ["'", "'"]]
+ },
"Dust": {
"name": "Dust.js",
"multi_line_comments": [["{!", "!}"]],
@@ -384,6 +358,12 @@
"multi_line_comments": [["{-", "-}"]],
"extensions": ["elm"]
},
+ "Elvish": {
+ "line_comment": ["#"],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "env": ["elvish"],
+ "extensions": ["elv"]
+ },
"EmacsDevEnv": {
"name": "Emacs Dev Env",
"line_comment": [";"],
@@ -409,6 +389,18 @@
"blank": true,
"extensions": ["fen"]
},
+ "Fennel" : {
+ "line_comment": [";", ";;"],
+ "quotes": [["\\\"", "\\\""]],
+ "extensions": ["fnl"]
+ },
+ "Fish": {
+ "shebangs": ["#!/bin/fish"],
+ "line_comment": ["#"],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "env": ["fish"],
+ "extensions": ["fish"]
+ },
"FlatBuffers": {
"name": "FlatBuffers Schema",
"line_comment": ["//"],
@@ -416,12 +408,10 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["fbs"]
},
- "Fstar": {
- "name": "F*",
- "quotes": [["\\\"", "\\\""]],
- "line_comment": ["//"],
- "multi_line_comments": [["(*", "*)"]],
- "extensions": ["fst"]
+ "ForgeConfig": {
+ "name": "Forge Config",
+ "line_comment": ["#", "~"],
+ "extensions": ["cfg"]
},
"Forth": {
"line_comment": ["\\\\"],
@@ -464,6 +454,13 @@
"verbatim_quotes": [["@\\\"", "\\\""]],
"extensions": ["fs", "fsi", "fsx", "fsscript"]
},
+ "Fstar": {
+ "name": "F*",
+ "quotes": [["\\\"", "\\\""]],
+ "line_comment": ["//"],
+ "multi_line_comments": [["(*", "*)"]],
+ "extensions": ["fst"]
+ },
"Futhark": {
"line_comment": ["--"],
"extensions": ["fut"]
@@ -494,19 +491,19 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["gleam"]
},
- "Gml": {
- "name": "Gml",
+ "Glsl": {
+ "name": "GLSL",
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
"quotes": [["\\\"", "\\\""]],
- "extensions": ["gml"]
+ "extensions": ["vert", "tesc", "tese", "geom", "frag", "comp", "mesh", "task", "rgen", "rint", "rahit", "rchit", "rmiss", "rcall", "glsl"]
},
- "Glsl": {
- "name": "GLSL",
+ "Gml": {
+ "name": "Gml",
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
"quotes": [["\\\"", "\\\""]],
- "extensions": ["vert", "tesc", "tese", "geom", "frag", "comp", "mesh", "task", "rgen", "rint", "rahit", "rchit", "rmiss", "rcall", "glsl"]
+ "extensions": ["gml"]
},
"Go": {
"line_comment": ["//"],
@@ -537,6 +534,11 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["gw"]
},
+ "Hamlet": {
+ "multi_line_comments": [["<!--", "-->"]],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "extensions": ["hamlet"]
+ },
"Happy": {
"extensions": ["y", "ly"]
},
@@ -551,6 +553,12 @@
"multi_line_comments": [["{-", "-}"]],
"extensions": ["hs"]
},
+ "Haxe": {
+ "line_comment": ["//"],
+ "multi_line_comments": [["/*", "*/"]],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "extensions": ["hx"]
+ },
"Hcl": {
"name": "HCL",
"line_comment": ["#", "//"],
@@ -564,6 +572,11 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["ha"]
},
+ "Hex": {
+ "name": "HEX",
+ "blank": true,
+ "extensions": ["hex"]
+ },
"Hlsl": {
"name": "HLSL",
"line_comment": ["//"],
@@ -586,22 +599,6 @@
"mime": ["text/html"],
"extensions": ["html", "htm"]
},
- "Hamlet": {
- "multi_line_comments": [["<!--", "-->"]],
- "quotes": [["\\\"", "\\\""], ["'", "'"]],
- "extensions": ["hamlet"]
- },
- "Haxe": {
- "line_comment": ["//"],
- "multi_line_comments": [["/*", "*/"]],
- "quotes": [["\\\"", "\\\""], ["'", "'"]],
- "extensions": ["hx"]
- },
- "Hex": {
- "name": "HEX",
- "blank": true,
- "extensions": ["hex"]
- },
"Idris": {
"line_comment": ["--"],
"multi_line_comments": [["{-", "-}"]],
@@ -829,6 +826,11 @@
"important_syntax": ["```"],
"extensions": ["md", "markdown"]
},
+ "Meson": {
+ "line_comment": ["#"],
+ "quotes": [["'", "'"], ["'''", "'''"]],
+ "filenames": ["meson.build", "meson_options.txt"]
+ },
"Metal": {
"name": "Metal Shading Language",
"line_comment": ["//"],
@@ -836,6 +838,15 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["metal"]
},
+ "Mint": {
+ "blank": true,
+ "extensions": ["mint"]
+ },
+ "Mlatu": {
+ "line_comment": ["//"],
+ "quotes": [["\\\"", "\\\""]],
+ "extensions": ["mlt"]
+ },
"ModuleDef": {
"name": "Module-Definition",
"extensions": ["def"],
@@ -846,19 +857,11 @@
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["moon"]
},
- "Meson": {
- "line_comment": ["#"],
- "quotes": [["'", "'"], ["'''", "'''"]],
- "filenames": ["meson.build", "meson_options.txt"]
- },
- "Mint": {
- "blank": true,
- "extensions": ["mint"]
- },
- "Mlatu": {
- "line_comment": ["//"],
- "quotes": [["\\\"", "\\\""]],
- "extensions": ["mlt"]
+ "MsBuild": {
+ "name": "MSBuild",
+ "multi_line_comments": [["<!--", "-->"]],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "extensions": ["csproj", "vbproj", "fsproj", "props", "targets"]
},
"Mustache": {
"multi_line_comments": [["{{!", "}}"]],
@@ -876,6 +879,13 @@
"line_comment": ["#"],
"extensions": ["nix"]
},
+ "NotQuitePerl": {
+ "name": "Not Quite Perl",
+ "line_comment": ["#"],
+ "multi_line_comments": [["=begin", "=end"]],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "extensions": ["nqp"]
+ },
"ObjectiveC": {
"name": "Objective-C",
"line_comment": ["//"],
@@ -953,13 +963,6 @@
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["pest"]
},
- "NotQuitePerl": {
- "name": "Not Quite Perl",
- "line_comment": ["#"],
- "multi_line_comments": [["=begin", "=end"]],
- "quotes": [["\\\"", "\\\""], ["'", "'"]],
- "extensions": ["nqp"]
- },
"Php": {
"name": "PHP",
"line_comment": ["#", "//"],
@@ -986,6 +989,17 @@
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["pcss", "sss"]
},
+ "PowerShell": {
+ "line_comment": ["#"],
+ "multi_line_comments": [["<#", "#>"]],
+ "quotes": [
+ ["\\\"", "\\\""],
+ ["'", "'"],
+ ["\\\"@", "@\\\""],
+ ["@'", "'@"]
+ ],
+ "extensions": ["ps1", "psm1", "psd1", "ps1xml", "cdxml", "pssc", "psc1"]
+ },
"Processing": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
@@ -998,17 +1012,6 @@
"multi_line_comments": [["/*", "*/"]],
"extensions": ["p", "pro"]
},
- "PowerShell": {
- "line_comment": ["#"],
- "multi_line_comments": [["<#", "#>"]],
- "quotes": [
- ["\\\"", "\\\""],
- ["'", "'"],
- ["\\\"@", "@\\\""],
- ["@'", "'@"]
- ],
- "extensions": ["ps1", "psm1", "psd1", "ps1xml", "cdxml", "pssc", "psc1"]
- },
"PSL": {
"name": "PSL Assertion",
"line_comment": ["//"],
@@ -1044,13 +1047,6 @@
"mime": ["text/x-python"],
"extensions": ["py", "pyw"]
},
- "Qcl": {
- "name": "QCL",
- "line_comment": ["//"],
- "multi_line_comments": [["/*", "*/"]],
- "quotes": [["\\\"", "\\\""]],
- "extensions": ["qcl"]
- },
"Q": {
"name": "Q",
"nested": true,
@@ -1058,6 +1054,13 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["q"]
},
+ "Qcl": {
+ "name": "QCL",
+ "line_comment": ["//"],
+ "multi_line_comments": [["/*", "*/"]],
+ "quotes": [["\\\"", "\\\""]],
+ "extensions": ["qcl"]
+ },
"Qml": {
"name": "QML",
"line_comment": ["//"],
@@ -1093,6 +1096,10 @@
"quotes": [["\\\"", "\\\""], ["'", "'"], ["`", "`"]],
"extensions": ["rpy"]
},
+ "ReStructuredText": {
+ "blank": true,
+ "extensions": ["rst"]
+ },
"RON": {
"name": "Rusty Object Notation",
"line_comment": ["//"],
@@ -1129,10 +1136,6 @@
"quotes": [["\\\"", "\\\""], ["#\\\"", "\\\"#"]],
"verbatim_quotes": [["r##\\\"", "\\\"##"], ["r#\\\"", "\\\"#"]]
},
- "ReStructuredText": {
- "blank": true,
- "extensions": ["rst"]
- },
"Sass": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
@@ -1161,6 +1164,14 @@
],
"filenames": ["sconstruct", "sconscript"]
},
+ "Sh": {
+ "name": "Shell",
+ "shebangs": ["#!/bin/sh"],
+ "line_comment": ["#"],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "env": ["sh"],
+ "extensions": ["sh"]
+ },
"Sml": {
"name": "Standard ML (SML)",
"quotes": [["\\\"", "\\\""]],
@@ -1322,6 +1333,11 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["u"]
},
+ "UnrealDeveloperMarkdown": {
+ "name": "Unreal Markdown",
+ "important_syntax": ["```"],
+ "extensions": ["udn"]
+ },
"UnrealPlugin": {
"name": "Unreal Plugin",
"blank": true,
@@ -1353,11 +1369,6 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["ush"]
},
- "UnrealDeveloperMarkdown": {
- "name": "Unreal Markdown",
- "important_syntax": ["```"],
- "extensions": ["udn"]
- },
"UrWeb": {
"name": "Ur/Web",
"quotes": [["\\\"", "\\\""]],
@@ -1413,19 +1424,19 @@
"line_comment": ["'"],
"extensions": ["vb"]
},
- "VisualStudioSolution": {
- "name": "Visual Studio Solution",
- "blank": true,
- "extensions": ["sln"]
- },
"VisualStudioProject": {
"name": "Visual Studio Project",
"multi_line_comments": [["<!--", "-->"]],
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["vcproj", "vcxproj"]
},
+ "VisualStudioSolution": {
+ "name": "Visual Studio Solution",
+ "blank": true,
+ "extensions": ["sln"]
+ },
"VimScript": {
- "name": "Vim script",
+ "name": "Vim Script",
"line_comment": ["\\\""],
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["vim"]
@@ -1477,12 +1488,6 @@
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["xsl", "xslt"]
},
- "MsBuild": {
- "name": "MSBuild",
- "multi_line_comments": [["<!--", "-->"]],
- "quotes": [["\\\"", "\\\""], ["'", "'"]],
- "extensions": ["csproj", "vbproj", "fsproj", "props", "targets"]
- },
"Xtend": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
@@ -1495,6 +1500,13 @@
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["yaml", "yml"]
},
+ "ZenCode": {
+ "line_comment": ["//", "#"],
+ "multi_line_comments": [["/*", "*/"]],
+ "quotes": [["\\\"", "\\\""], ["'", "'"]],
+ "verbatim_quotes": [["@\\\"", "\\\""], ["@'", "'"]],
+ "extensions": ["zs"]
+ },
"Zig": {
"line_comment": ["//"],
"quotes": [["\\\"", "\\\""]],
diff --git a/tests/data/forgecfg.cfg b/tests/data/forgecfg.cfg
new file mode 100644
index 0000000..2b8fcdf
--- /dev/null
+++ b/tests/data/forgecfg.cfg
@@ -0,0 +1,79 @@
+# 79 lines 20 code 40 comments 19 blanks
+
+# Configuration file
+
+~CONFIG_VERSION: 0.4.0
+
+##########################################################################################################
+# advanced
+#--------------------------------------------------------------------------------------------------------#
+# Advanced config options to change the way JEI functions.
+##########################################################################################################
+
+advanced {
+ # Move the JEI search bar to the bottom center of the screen. [default: false]
+ B:centerSearchBarEnabled=true
+ B:debugModeEnabled=false
+
+ # Choose if JEI should give ingredients direct to the inventory (inventory) or pick them up with the mouse (mouse_pickup).
+ # [Default: mouse_pickup]
+ # [Valid: [inventory, mouse_pickup]]
+ S:giveMode=inventory
+
+ # The maximum width of the ingredient list. [range: 4 ~ 100, default: 100]
+ I:maxColumns=100
+
+ # The maximum height of the recipe GUI. [range: 175 ~ 5000, default: 350]
+ I:maxRecipeGuiHeight=350
+
+ # How the mod name should be formatted in the tooltip for JEI GUIs. Leave blank to disable. [Default: blue italic] [Valid: [black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua, red, light_purple, yellow, white, obfuscated, bold, strikethrough, underline, italic]]
+ S:modNameFormat=blue italic
+
+ # Enable JEI memory usage optimizations. [default: true]
+ B:optimizeMemoryUsage=true
+}
+
+
+##########################################################################################################
+# search
+#--------------------------------------------------------------------------------------------------------#
+# Options relating to the search bar.
+##########################################################################################################
+
+search {
+ # Search mode for Colors (prefix: ^)
+ # [Default: disabled]
+ # [Valid: [enabled, require_prefix, disabled]]
+ S:colorSearchMode=DISABLED
+
+ # Search mode for Creative Tab Names (prefix: %)
+ # [Default: disabled]
+ # [Valid: [enabled, require_prefix, disabled]]
+ S:creativeTabSearchMode=DISABLED
+
+ # Search mode for Mod Names (prefix: @)
+ # [Default: require_prefix]
+ # [Valid: [enabled, require_prefix, disabled]]
+ S:modNameSearchMode=require_prefix
+
+ # Search mode for Ore Dictionary Names (prefix: $)
+ # [Default: disabled]
+ # [Valid: [enabled, require_prefix, disabled]]
+ S:oreDictSearchMode=require_prefix
+
+ # Search mode for resources ids (prefix: &)
+ # [Default: disabled]
+ # [Valid: [enabled, require_prefix, disabled]]
+ S:resourceIdSearchMode=enabled
+
+ # Search mode for Tooltips (prefix: #)
+ # [Default: enabled]
+ # [Valid: [enabled, require_prefix, disabled]]
+ S:tooltipSearchMode=enabled
+}
+
+
+searchadvancedtooltips {
+ # config.jei.searchAdvancedTooltips.search.comment [default: false]
+ B:search=false
+}
diff --git a/tests/data/zencode.zs b/tests/data/zencode.zs
new file mode 100644
index 0000000..e6ab8dd
--- /dev/null
+++ b/tests/data/zencode.zs
@@ -0,0 +1,21 @@
+// 21 lines 9 code 7 comments 5 blanks
+
+// This is a single line comment.
+/* This is a multiline comment on a single line. */
+/*
+ This is a multiline comment.
+*/
+
+var str = "/*";
+var arr = [str, @"wysiwyg", '\"'];
+
+for item in arr {
+ print(item); // Found the */
+}
+
+// Comment with quote "
+
+var badStr = // Comment before value
+ "\"";
+badStr = // Another comment before value
+ @'zen';