From d836f2f14501fa0efbaa8b7dff2e1e65826cc163 Mon Sep 17 00:00:00 2001 From: able Date: Sat, 11 May 2024 18:05:38 -0500 Subject: [PATCH] support hblang --- rust-toolchain.toml | 2 +- src/filetype.rs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ecc21cc..00e2877 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly" +channel = "nightly-2023-09-17" components = ["rust-src", "llvm-tools"] diff --git a/src/filetype.rs b/src/filetype.rs index 4b6707b..92824a4 100644 --- a/src/filetype.rs +++ b/src/filetype.rs @@ -113,6 +113,27 @@ impl FileType { }, }; } + if file_name.ends_with(".hb") { + return Self { + name: String::from("HBLang"), + hl_opts: HighlightingOptions { + numbers: true, + strings: true, + characters: true, + comments: true, + multiline_comments: true, + primary_keywords: vec![ + "if".to_string(), + "else".to_string(), + "return".to_string(), + "loop".to_string(), + "break".to_string(), + ], + secondary_keywords: vec![":=".to_string(), "int".to_string()], + }, + }; + } + Self::default() } }