Commit: runtime(odin): improve float number syntax
Christian Brabandt <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <[email protected]> |
runtime(odin): improve float number syntax Commit: https://github.com/vim/vim/commit/6ccd0351a78be76eda9ed48fff19f52660a8971c Author: Maxim Kim <[email protected]> Date: Fri Aug 21 15:09:36 2026 +0000 runtime(odin): improve float number syntax - highlight exp numbers without decimal point, e.g. 12e-5 - highlight hex floats, e.g. 0hff3a001f - remove non-existent 0z number literals - do not highlight unary minus as a part of a number closes: #21107 Signed-off-by: Maxim Kim <[email protected]> Signed-off-by: Christian Brabandt <[email protected]> diff --git a/runtime/syntax/odin.vim b/runtime/syntax/odin.vim index e8aa1f875..d9327fdae 100644 --- a/runtime/syntax/odin.vim +++ b/runtime/syntax/odin.vim @@ -4,7 +4,7 @@ vim9script # Language: Odin # Maintainer: Maxim Kim <[email protected]> # Website: https://github.com/habamax/vim-odin -# Last Change: 2026 Aug 16 +# Last Change: 2026 Aug 21 if exists("b:current_syntax") finish @@ -63,10 +63,11 @@ syntax region odinAttributeBraces \ transparent oneline \ contained -syntax match odinInteger " -?<[0-9]+%(_[0-9]+)*>" display -syntax match odinFloat " -?<[0-9]+%(_[0-9]+)*%(\.[0-9]+%(_[0-9]+)*)%([eE][+-]=[0-9]+%(_[0-9]+)*)=" display +syntax match odinInteger " <[0-9]+%(_[0-9]+)*>" display +syntax match odinFloat " <[0-9]+%(_[0-9]+)*%(\.[0-9]+%(_[0-9]+)*)%([eE][+-]=[0-9]+%(_[0-9]+)*)=" display +syntax match odinFloat " <[0-9]+%(_[0-9]+)*[eE][+-]?[0-9]+%(_[0-9]+)*" display syntax match odinHex " <0[xX][0-9A-Fa-f]+%(_[0-9A-Fa-f]+)*>" display -syntax match odinDoz " <0[zZ][0-9A-Ba-b]+%(_[0-9A-Ba-b]+)*>" display +syntax match odinHexFloat " <0[hH][0-9A-Fa-f]+%(_[0-9A-Fa-f]+)*>" display syntax match odinOct " <0[oO][0-7]+%(_[0-7]+)*>" display syntax match odinBin " <0[bB][01]+%(_[01]+)*>" display @@ -107,10 +108,10 @@ highlight def link odinBool Boolean highlight def link odinNull Constant highlight def link odinUninitialized Constant highlight def link odinFloat Float +highlight def link odinHexFloat odinFloat highlight def link odinInteger Number highlight def link odinHex Number highlight def link odinOct Number highlight def link odinBin Number -highlight def link odinDoz Number b:current_syntax = "odin" -- -- 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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1wxQxZ-00FPn1-Vy%40256bit.org.