Commit: runtime(algol68): Update syntax, support size prefixes in denotations

5 views
Skip to first unread message

Christian Brabandt

unread,
Jun 20, 2026, 12:45:13 PMJun 20
to vim...@googlegroups.com
runtime(algol68): Update syntax, support size prefixes in denotations

Commit: https://github.com/vim/vim/commit/4e6e1fc5ead838eb7e37dd100e497adc7d7b0331
Author: Doug Kearns <dougk...@gmail.com>
Date: Sat Jun 20 16:35:14 2026 +0000

runtime(algol68): Update syntax, support size prefixes in denotations

Explicitly match the LONG/SHORT size prefixes in integral, real and bits
denotations.

LONG/SHORT are matched as part of the denotation rather than as a mode.

closes: #20512

Signed-off-by: Doug Kearns <dougk...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/syntax/algol68.vim b/runtime/syntax/algol68.vim
index 9f9611861..41b9797c5 100644
--- a/runtime/syntax/algol68.vim
+++ b/runtime/syntax/algol68.vim
@@ -3,7 +3,7 @@
" Version: 0.4
" Maintainer: Janis Papanagnou
" Previous Maintainer: NevilleD...@sgr-a.net
-" Last Change: 2026 May 19
+" Last Change: 2026 Jun 13

if exists("b:current_syntax")
finish
@@ -41,7 +41,8 @@ syn keyword algol68Repeat FOR FROM BY UPTO DOWNTO TO WHILE DO UNTIL OD
syn keyword algol68Statement PAR BEGIN END EXIT
syn keyword algol68Struct STRUCT
syn keyword algol68PreProc VECTOR
-syn keyword algol68Type FLEX HEAP LOC LONG REF SHORT
+syn match algol68Type "\<\%(LONG\|SHORT\)\>"
+syn keyword algol68Type FLEX HEAP LOC REF
syn keyword algol68Type VOID BOOL INT REAL COMPL CHAR STRING COMPLEX
syn keyword algol68Type BITS BYTES FILE CHANNEL PIPE SEMA SOUND
syn keyword algol68Type FORMAT STRUCT UNION
@@ -120,16 +121,16 @@ syn match algol68DefiningOperator "\u[A-Z0-9]" contained
syn match algol68DefiningOperator "[!%&+\-?^~][*/<=>]\?\%(:=\|=:\)\?" contained
syn match algol68DefiningOperator "\%([!%&+\-?^~]\|[*/<=>]\)[*/<=>]\?\%(:=\|=:\)\?" contained

-syn match algol68Number "\<\d\+\%(\s\+\d\+\)*\>"
+syn match algol68Number "\<\%(\%(LONG\s\+\)\+\|\%(SHORT\s\+\)\+\)\=\d\+\%(\s\+\d\+\)*\>"

-syn match algol68Float "

Janis Papanagnou

unread,
Jul 11, 2026, 11:04:28 AM (15 hours ago) Jul 11
to vim...@googlegroups.com
Hi Doug,

I just noticed an inconsistency in the highlighting of Algol 68 operator names.

Names of operators are not highlighted in definitions, like 'LT' in "OP LT" here:
OP LT = (UNICHAR a,b)BOOL: ABS bits OF a LT ABS bits OF b;

But in - comma separated! - sequences of operator definitions like
OP LT = (UNICHAR a,b)BOOL: ABS bits OF a LT ABS bits OF b,
LE = (UNICHAR a,b)BOOL: ABS bits OF a LE ABS bits OF b,
EQ = (UNICHAR a,b)BOOL: ABS bits OF a EQ ABS bits OF b;
the 'LT' (as above) is not highlighted, while 'LE' and 'EQ' are highlighted.
(All applications of operators, as in "a LT b", are correctly highlighted.)

I'd say that the defined name should always be highlighted after an 'OP'.
But I cannot identify where the issue in the syntax file is actually located.
Any idea? - Thanks!

Janis

Janis Papanagnou

unread,
Jul 11, 2026, 11:28:46 AM (15 hours ago) Jul 11
to vim...@googlegroups.com
On a second thought, highlighting operator definitions, or specifically
user-defined operators, may not be realized in easy ways (if at all).
So what remains would be just fixing the inconsistency!
A way could be to not highlight the standard Algol 68 operators where
they are followed by an '=' sign - a safe criterion for a definition, I'd say.
Then the 'LE' and 'EQ' definitions below would not become highlighted,
while their use in expressions would still be.
What do you think?

________________________________________
Von: vim...@googlegroups.com <vim...@googlegroups.com> im Auftrag von Janis Papanagnou <janis_pa...@hotmail.com>
Gesendet: Samstag, 11. Juli 2026 17:04
An: vim...@googlegroups.com
Betreff: runtime(algol68): highlighting of operator names in OP definitions

Hi Doug,

Janis

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/DU0PR02MB104221A7BB47812FD071E6B98F3FC2%40DU0PR02MB10422.eurprd02.prod.outlook.com.

Reply all
Reply to author
Forward
0 new messages