From 74cd94e81956badb14d3d5189a03a1acc6b6d5ca Mon Sep 17 00:00:00 2001 From: jperon Date: Thu, 20 Apr 2023 20:47:21 +0200 Subject: Add language_lilypond (#234) * language_lilypond * Update language_lilypond.lua Co-authored-by: Guldoman * Update language_lilypond.lua Co-authored-by: Guldoman * language_lilypond: update manifest.json * Update plugins/language_lilypond.lua Co-authored-by: Guldoman --------- Co-authored-by: Guldoman --- manifest.json | 7 +++++++ plugins/language_lilypond.lua | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 plugins/language_lilypond.lua diff --git a/manifest.json b/manifest.json index 77c4bd2..dc7668f 100644 --- a/manifest.json +++ b/manifest.json @@ -613,6 +613,13 @@ "mod_version": "3", "url": "https://raw.githubusercontent.com/whiteh0le/lite-plugins/main/plugins/language_ksy.lua?raw=1" }, + { + "description": "Syntax for the [LilyPond](https://lilypond.org/) music typesetting language", + "version": "0.1", + "path": "plugins/language_lilypond.lua", + "id": "language_lilypond", + "mod_version": "3" + }, { "description": "Syntax for [Liquid](https://shopify.github.io/liquid/) templating language", "version": "0.1", diff --git a/plugins/language_lilypond.lua b/plugins/language_lilypond.lua new file mode 100644 index 0000000..a3f84f1 --- /dev/null +++ b/plugins/language_lilypond.lua @@ -0,0 +1,22 @@ +-- mod-version:3 +local syntax = require "core.syntax" + +syntax.add { + name = "LilyPond", + files = { "%.i?ly$" }, + comment = "%%", + block_comment = { "%%{", "%%}" }, + patterns = { + { pattern = "#%(()[%a_]%S*", type = { "operator", "function" } }, + { pattern = {"%%{", "%%}"}, type = "comment" }, + { pattern = "%%.*", type = "comment" }, + { pattern = "#[%w_-]*", type = "keyword2" }, + { pattern = "\\%a%w+", type = "keyword" }, + { pattern = "\\\\", type = "operator" }, + { pattern = "[%(%){}%[%]<>=/~%-%_']", type = "operator" }, + { pattern = {'"', '"', "\\"}, type = "string" }, + { pattern = "-?%.?%d+", type = "number" }, + }, + symbols = {} +} + -- cgit v1.2.3