From a1309af6969969d420c2f010edafed83d7fadc09 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Wed, 23 Apr 2025 16:25:46 -0400 Subject: [PATCH] Updated some regexes One of the expressions used .* to mean 'any character except newline', but since I've enabled 'RE_SINGLE_LINE' mode, a dot matches a newline as well. --- config/c.conf | 6 +++++- config/go.conf | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/c.conf b/config/c.conf index eba8746..449b241 100644 --- a/config/c.conf +++ b/config/c.conf @@ -14,7 +14,11 @@ '\<(.*?)\>': BLUE # Assignments and comparisons # TODO: Add less than, greater than, not equal to, and struct pointer member access -'(?:\s|\b)(=|==|!=|<=|>=|\->)(\s|\b)' : CYAN +'(?:\s|\b)(=|==|!=|\<=|\>=|\->)(\s|\b)' : CYAN + +# Built-in boolean values, modifiers +'\b(static|const|true|false)\b': DARKBLUE + # Keywords '\b(if|else|while|do|for|return)\b': CYAN '(\n|^)(#ifdef|#ifndef|#define|#include)\b': CYAN diff --git a/config/go.conf b/config/go.conf index 35544c2..47230c2 100644 --- a/config/go.conf +++ b/config/go.conf @@ -1,7 +1,7 @@ # Priority decreases going downward ie. If two regexes match the same piece of # text, the one defined earlier will take precedence over the one defined later. # Comments -'//.*': GRAY +'//[^\n]*': GRAY '/\*[^*]*\*+(?:[^/*][^*]*\*+)*/': GRAY # Numbers and special values '\b\-?[0-9]*\b': MAGENTA