aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--manifest.json9
-rw-r--r--plugins/language_ejs.lua51
3 files changed, 61 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4db0b19..b42d339 100644
--- a/README.md
+++ b/README.md
@@ -267,6 +267,7 @@ but only with a `url` must provide a `checksum` that matches the existing plugin
| [`language_wren`](plugins/language_wren.lua?raw=1) | Syntax for the [Wren](http://wren.io/) programming language |
| [`language_yaml`](plugins/language_yaml.lua?raw=1) | Syntax for [YAML](https://yaml.org/) serialization language |
| [`language_zig`](plugins/language_zig.lua?raw=1) | Syntax for the [Zig](https://ziglang.org/) programming language |
+| [`language_ejs`](plugins/language_ejs.lua?raw=1) | Syntax for the [EJS](https://ejs.co/) javascript template engine |
## Libraries
diff --git a/manifest.json b/manifest.json
index 2d6762d..e06c513 100644
--- a/manifest.json
+++ b/manifest.json
@@ -84,6 +84,7 @@
"language_dart": {},
"language_diff": {},
"language_edp": {},
+ "language_ejs": {},
"language_elixir": {},
"language_elm": {},
"language_env": {},
@@ -699,6 +700,14 @@
"tags": ["language"]
},
{
+ "description": "Syntax for the [EJS](https://ejs.co/) javascript template engine",
+ "version": "0.1",
+ "path": "plugins/language_ejs.lua",
+ "id": "language_ejs",
+ "mod_version": "3",
+ "tags": ["language"]
+ },
+ {
"description": "Syntax for the [Elixir](https://elixir-lang.org) programming language",
"version": "0.2",
"path": "plugins/language_elixir.lua",
diff --git a/plugins/language_ejs.lua b/plugins/language_ejs.lua
new file mode 100644
index 0000000..f303bad
--- /dev/null
+++ b/plugins/language_ejs.lua
@@ -0,0 +1,51 @@
+-- mod-version:3
+
+-- Embedded JavaScript templating
+-- provides .ejs syntax support (fork of language_html.lua).
+
+local syntax = require "core.syntax"
+
+syntax.add {
+ name = "EJS",
+ files = { "%.ejs$" },
+ block_comment = { "<!--", "-->" },
+ patterns = {
+ {
+ pattern = {
+ "<%%",
+ "%%>"
+ },
+ syntax = '.js',
+ type = "function"
+ },
+ {
+ pattern = {
+ "<%s*[sS][cC][rR][iI][pP][tT]%f[%s>].->",
+ "<%s*/%s*[sS][cC][rR][iI][pP][tT]%s*>"
+ },
+ syntax = ".js",
+ type = "function"
+ },
+ {
+ pattern = {
+ "<%s*[sS][tT][yY][lL][eE]%f[%s>].->",
+ "<%s*/%s*[sS][tT][yY][lL][eE]%s*>"
+ },
+ syntax = ".css",
+ type = "function"
+ },
+ { pattern = { "<!%-%-", "%-%->" }, type = "comment" },
+ { pattern = { '%f[^>][^<]', '%f[<]' }, type = "normal" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "'", "'", '\\' }, type = "string" },
+ { pattern = "0x[%da-fA-F]+", type = "number" },
+ { pattern = "-?%d+[%d%.]*f?", type = "number" },
+ { pattern = "-?%.?%d+f?", type = "number" },
+ { pattern = "%f[^<]![%a_][%w_]*", type = "keyword2" },
+ { pattern = "%f[^<][%a_][%w_]*", type = "function" },
+ { pattern = "%f[^<]/[%a_][%w_]*", type = "function" },
+ { pattern = "[%a_][%w_]*", type = "keyword" },
+ { pattern = "[/<>=]", type = "operator" },
+ },
+ symbols = {},
+}