From 29ee3fac1afacf0ff3707fbd3e60fb80e0ad6616 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 22 Dec 2024 11:12:29 +0530 Subject: [PATCH] fix: rename {hsl,rgb}_function_parser > parser (#111) --- lua/colorizer/parser/hsl.lua | 2 +- lua/colorizer/parser/rgb.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/colorizer/parser/hsl.lua b/lua/colorizer/parser/hsl.lua index 3e10455..1d3ee0b 100644 --- a/lua/colorizer/parser/hsl.lua +++ b/lua/colorizer/parser/hsl.lua @@ -18,7 +18,7 @@ local hsl_to_rgb = require("colorizer.color").hsl_to_rgb -- - `prefix` (string): "hsl" or "hsla" to specify the CSS function type. -- @return number|nil The end index of the parsed `hsl/hsla` function within the line, or `nil` if no match was found. -- @return string|nil The RGB hexadecimal color (e.g., "ff0000" for red), or `nil` if parsing failed -function M.hsl_function_parser(line, i, opts) +function M.parser(line, i, opts) local min_len = #"hsla(0,0%,0%)" - 1 local min_commas, min_spaces = 2, 2 local pattern = "^" diff --git a/lua/colorizer/parser/rgb.lua b/lua/colorizer/parser/rgb.lua index 4ebf97b..d0acc3e 100644 --- a/lua/colorizer/parser/rgb.lua +++ b/lua/colorizer/parser/rgb.lua @@ -16,7 +16,7 @@ local count = require("colorizer.utils").count -- - `prefix` (string): "rgb" or "rgba" to specify the CSS function type -- @return number|nil The end index of the parsed `rgb/rgba` function within the line, or `nil` if parsing failed -- @return string|nil The RGB hexadecimal color (e.g., "ff0000" for red), or `nil` if parsing failed -function M.rgb_function_parser(line, i, opts) +function M.parser(line, i, opts) local min_len = #"rgba(0,0,0)" - 1 local min_commas, min_spaces, min_percent = 2, 2, 3 local pattern = "^"