From 5cd86c6cff94256ed2db872c46b57da259a648ac Mon Sep 17 00:00:00 2001 From: dkearns Date: Tue, 12 Mar 2024 07:40:58 +1100 Subject: runtime(vim): Update base-syntax, improve number matching (#14175) - Limit blob literals to an even number of hexadecimal digits and correctly located dots. - Match octal numbers. The current version unsuccessfully attempts to match a leading '-' as part of the float literal. It's actually parsed as part of the literal for all numbers but the syntax file hasn't matched it like that for a long time and highlights negative numbers as UNARY-MINUS NUMBER. This will be fixed when better expression matching is implemented. Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/syntax/testdir/input/vim_expr.vim | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'runtime/syntax/testdir/input') diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index 439c1b6b46..cf5838ce05 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -29,3 +29,43 @@ echo $'Highlight interpolation:\t{{ { string({'foo': 'bar'}) } }}' echo $'Highlight interpolation:\t{{ { $'nested: {{ {1 + 2} }}' } }}' echo $"Highlight interpolation:\t{{ { string({"foo": "bar"}) } }}" echo $"Highlight interpolation:\t{{ { $"nested: {{ {1 + 2} }}" } }}" + +" Number + +" Hexadecimal +echo 0xFF +echo 0XFF +echo -0xFF +echo -0XFF + +" Decimal +echo 255 +echo -255 + +" Octal +echo 0377 +echo 0o377 +echo 0O377 +echo -0377 +echo -0o377 +echo -0O377 + +" Binary +echo 0b11111111 +echo 0B11111111 +echo -0b11111111 +echo -0B11111111 + +" Float +123.456 ++0.0001 +55.0 +-0.123 +1.234e03 +1.0E-6 +-3.1416e+88 + +" Blob +echo 0zFF00ED015DAF +echo 0zFF00.ED01.5DAF +echo 0zFF.00.ED.01.5D.AF -- cgit v1.2.3