[PATCH] D158321: [emacs] Handle vector types, arbitary integer types and function names

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 10:53:45 PDT 2023


goldstein.w.n added a comment.

In D158321#4601329 <https://reviews.llvm.org/D158321#4601329>, @luke wrote:

> In D158321#4600816 <https://reviews.llvm.org/D158321#4600816>, @goldstein.w.n wrote:
>
>> Example of some syntax this is suppose to help?
>
> My bad, I did some last minute refactoring and didn't realise that the script didn't actually evaluate successfully. Fixed now.
>
> New bits of syntax that should be highlighted:
>
>   <vscale x 4 x i32>
>   <2 x float>
>   i25
>   @my_function
>
> Also by dropping the `symbols` arg to `regexp-opt`, we now properly highlight types that appear inside a vector constant, e.g. previously the first `i32` wasn't highlighted in `<i32 0, i32 1, i32 2, i32 3>`

Okay a few notes.
Object first: This fails for something like: `< 2x i64>`.

Subjective:
Personally not a fan of some of the new highlighting.

1. Personal preference would be in something like `<vscale x 2 x i64>` each of the component (`<`/`>`, `x`, `vscale`, `2`, and `i64`) would have seperate font-locks.

I'm not sure this is actually doable though. Can you set font for a portion of a regex match?



================
Comment at: llvm/utils/emacs/llvm-mode.el:46
+   ;; Function names
+   '("@[-a-zA-Z$._][-a-zA-Z$._0-9]*" . font-lock-function-name-face)
+   ;; Vector types
----------------
This should be a seperate patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158321/new/

https://reviews.llvm.org/D158321



More information about the llvm-commits mailing list