…and you could check this patch using this:

#!/bin/bash

diff -u \
<(
git show | grep -P '#define highlighting_lexer_' | awk '{print $3}' | \
while read -r lexer_id; do
  read -r lexer_name
  test "${lexer_name%_*}" = highlighting_lexer && continue
  echo "$lexer_id $lexer_name"
done | sort -u
) \
<(
git grep -h 'LexerModule.*SCLEX_' | sed -r 's/^.*(SCLEX_\w*)\W[^"]*("[^"]*").*$/\1 \2/' | sort -u
)

which should give you a diff between the changes in the patch (LEXER_ID "name") and the LexerModule() calls with their names. What I see myself:

$ bash check-lexer-names.sh
--- /dev/fd/63	2023-11-02 22:53:41.310224390 +0100
+++ /dev/fd/62	2023-11-02 22:53:41.310224390 +0100
@@ -1,19 +1,21 @@
 SCLEX_ABAQUS "abaqus"
 SCLEX_ADA "ada"
+SCLEX_AS "as"
 SCLEX_ASCIIDOC "asciidoc"
 SCLEX_ASM "asm"
 SCLEX_AU3 "au3"
 SCLEX_BASH "bash"
 SCLEX_BATCH "batch"
+SCLEX_BLITZBASIC "blitzbasic"
 SCLEX_CAML "caml"
 SCLEX_CMAKE "cmake"
 SCLEX_COBOL "COBOL"
 SCLEX_COFFEESCRIPT "coffeescript"
 SCLEX_CPP "cpp"
+SCLEX_CPPNOCASE "cppnocase"
 SCLEX_CSS "css"
 SCLEX_D "d"
 SCLEX_DIFF "diff"
-SCLEX_ERLANG "erlang"
 SCLEX_F77 "f77"
 SCLEX_FORTH "forth"
 SCLEX_FORTRAN "fortran"
@@ -24,10 +26,13 @@
 SCLEX_JULIA "julia"
 SCLEX_LATEX "latex"
 SCLEX_LISP "lisp"
+SCLEX_LITERATEHASKELL "literatehaskell"
 SCLEX_LUA "lua"
 SCLEX_MAKEFILE "makefile"
 SCLEX_MARKDOWN "markdown"
+SCLEX_MATLAB "matlab"
 SCLEX_NSIS "nsis"
+SCLEX_NULL "null"
 SCLEX_OCTAVE "octave"
 SCLEX_PASCAL "pascal"
 SCLEX_PERL "perl"
@@ -35,6 +40,7 @@
 SCLEX_PO "po"
 SCLEX_POWERSHELL "powershell"
 SCLEX_PROPERTIES "props"
+SCLEX_PUREBASIC "purebasic"
 SCLEX_PYTHON "python"
 SCLEX_R "r"
 SCLEX_RUBY "ruby"

Tells me the patch doesn't change SCLEX_AS, SCLEX_BLITZBASIC, SCLEX_CPPNOCASE, SCLEX_LITERATEHASKELL, SCLEX_MATLAB, SCLEX_NULL and SCLEX_PUREBASIC. This looks fine, as we don't use these lexers -- and if I failed to transform an integer to a string I'd have a nasty warning (buried in the middle of the non-fixed ones, though πŸ˜‰). It also tells me I transformed SCLEX_ERLANG that didn't exist, but that's a glitch in the grep as mentioned above.
Basically, not seeing any -/+ pairs is a good sign πŸ™‚


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/3668/c1791600374@github.com>