From 196b2fb7d0a7ce8100f635ec26d168351896cc81 Mon Sep 17 00:00:00 2001 From: Rohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:41:29 +0530 Subject: Add `language_brainfuck` (#418) * Create language_brainfuck.lua * Update manifest.json --- manifest.json | 13 ++++++++++++- plugins/language_brainfuck.lua | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 plugins/language_brainfuck.lua diff --git a/manifest.json b/manifest.json index 1297e92..1b03367 100644 --- a/manifest.json +++ b/manifest.json @@ -68,6 +68,7 @@ "language_bib": {}, "language_blade": {}, "language_blueprint": {}, + "language_brainfuck": {}, "language_buzz": {}, "language_c7": {}, "language_caddyfile": {}, @@ -160,7 +161,7 @@ "id": "meta_languages", "mod_version": "3", "type": "meta", - "version": "0.1.11" + "version": "0.1.12" }, { "description": "Align multiple carets and selections *([clip](https://user-images.githubusercontent.com/2798487/165631951-532f8d24-d596-4dd0-9d21-ff53c71ed32f.mp4))*", @@ -696,6 +697,16 @@ ], "version": "0.1" }, + { + "description": "Syntax for the [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) programming language", + "id": "language_brainfuck", + "mod_version": "3", + "path": "plugins/language_brainfuck.lua", + "tags": [ + "language" + ], + "version": "0.1" + }, { "description": "A syntax highlighter for the [Buzz programming language](https://buzz-lang.dev/) in lite-xl.", "id": "language_buzz", diff --git a/plugins/language_brainfuck.lua b/plugins/language_brainfuck.lua new file mode 100644 index 0000000..31f2427 --- /dev/null +++ b/plugins/language_brainfuck.lua @@ -0,0 +1,23 @@ +-- Author: Rohan Vashisht: https://github.com/RohanVashisht1234/ + +-- mod-version:3 +local syntax = require "core.syntax" + +syntax.add { + name = "Brainfuck", -- tested ok + files = { + "%.bf$", -- tested ok + }, + patterns = { + { pattern = '%[', type = 'operator' }, -- tested ok + { pattern = '%]', type = 'operator' }, -- tested ok + { pattern = '%-', type = 'keyword' }, -- tested ok + { pattern = '<', type = 'keyword2' }, -- tested ok + { pattern = '>', type = 'keyword2' }, -- tested ok + { pattern = '+', type = 'string' }, -- tested ok + { pattern = ',', type = 'literal' }, -- tested ok + { pattern = '%.', type = 'string' }, -- tested ok + { pattern = '[^%-%.<>%+,%[%]]+', type = 'comment' }, -- tested ok + }, + symbols = {}, +} -- cgit v1.2.3