commit 4fcb92ee43ab536003156c406ec907396cc65253 from: Omar Polo date: Sun Nov 07 18:26:12 2021 UTC correctly highlight comments Algol68 support three styles of comments: 1) COMMENT ... COMMENT 2) CO ... CO 3) # ... # These can't be nested, although you can have things like COMMENT CO ... CO COMMENT as a whole comment because from `COMMENT' up to the next closer `COMMENT' is a single comment (duh.) commit - 6c5ab75422e36989043a11d63a59a4821e483d65 commit + 4fcb92ee43ab536003156c406ec907396cc65253 blob - 9ddd2e3f8a5952a2e0d88db7656611b8990ff404 blob + 496f4a59b5b124b2fc43fa6432dae6c7f274f170 --- a68-mode.el +++ a68-mode.el @@ -219,7 +219,23 @@ (setq-local font-lock-defaults '(a68-font-lock-keywords)) (setq-local indent-line-function #'a68-indent-line) (setq-local comment-start "#") - (setq-local comment-end "#")) + (setq-local comment-end "#") + (setq-local syntax-propertize-function + (syntax-propertize-rules ((rx (group bow "COMMENT" eow) + (group (*? anychar)) + (group bow "COMMENT" eow)) + (1 "<") + (3 ">")) + ((rx (group bow "CO" eow) + (group (*? anychar)) + (group bow "CO" eow)) + (1 "<") + (3 ">")) + ((rx (group "#") + (group (*? anychar)) + (group "#")) + (1 "<") + (3 ">"))))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.a68\\'" . a68-mode))