Mercurial > vim
annotate runtime/syntax/ave.vim @ 33791:370543108ba1 v9.0.2114
patch 9.0.2114: overflow detection not accurate when adding digits
Commit: https://github.com/vim/vim/commit/22cbc8a4e17ce61aa460c451a26e1bff2c3d2af9
Author: Christian Brabandt <cb@256bit.org>
Date: Sun Nov 19 10:47:21 2023 +0100
patch 9.0.2114: overflow detection not accurate when adding digits
Problem: overflow detection not accurate when adding digits
Solution: Use a helper function
Use a helper function to better detect overflows before adding integer
digits to a long or an integer variable respectively. Signal the
overflow to the caller function.
closes: #13539
Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Michael Henry <vim@drmikehenry.com>
Signed-off-by: Ernie Rael <errael@raelity.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 19 Nov 2023 11:00:07 +0100 |
parents | 8a1481e59d64 |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Copyright by Jan-Oliver Wagner | |
3 " Language: avenue | |
4 " Maintainer: Jan-Oliver Wagner <Jan-Oliver.Wagner@intevation.de> | |
5 " Last change: 2001 May 10 | |
6 | |
7 " Avenue is the ArcView built-in language. ArcView is | |
8 " a desktop GIS by ESRI. Though it is a built-in language | |
9 " and a built-in editor is provided, the use of VIM increases | |
10 " development speed. | |
11 " I use some technologies to automatically load avenue scripts | |
12 " into ArcView. | |
13 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
14 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
15 if exists("b:current_syntax") |
7 | 16 finish |
17 endif | |
18 | |
19 " Avenue is entirely case-insensitive. | |
20 syn case ignore | |
21 | |
22 " The keywords | |
23 | |
24 syn keyword aveStatement if then elseif else end break exit return | |
25 syn keyword aveStatement for each in continue while | |
26 | |
27 " String | |
28 | |
29 syn region aveString start=+"+ end=+"+ | |
30 | |
31 " Integer number | |
32 syn match aveNumber "[+-]\=\<[0-9]\+\>" | |
33 | |
34 " Operator | |
35 | |
36 syn keyword aveOperator or and max min xor mod by | |
10228
8a1481e59d64
commit https://github.com/vim/vim/commit/3e496b0ea31996b665824f45664dee1fdd73c4d0
Christian Brabandt <cb@256bit.org>
parents:
10051
diff
changeset
|
37 " 'not' is a kind of a problem: It's an Operator as well as a method |
7 | 38 " 'not' is only marked as an Operator if not applied as method |
39 syn match aveOperator "[^\.]not[^a-zA-Z]" | |
40 | |
41 " Variables | |
42 | |
43 syn keyword aveFixVariables av nil self false true nl tab cr tab | |
44 syn match globalVariables "_[a-zA-Z][a-zA-Z0-9]*" | |
45 syn match aveVariables "[a-zA-Z][a-zA-Z0-9_]*" | |
46 syn match aveConst "#[A-Z][A-Z_]+" | |
47 | |
48 " Comments | |
49 | |
50 syn match aveComment "'.*" | |
51 | |
52 " Typical Typos | |
53 | |
54 " for C programmers: | |
55 syn match aveTypos "==" | |
56 syn match aveTypos "!=" | |
57 | |
58 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
59 " Only when an item doesn't have highlighting+yet |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
60 |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
61 hi def link aveStatement Statement |
7 | 62 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
63 hi def link aveString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
64 hi def link aveNumber Number |
7 | 65 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
66 hi def link aveFixVariables Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
67 hi def link aveVariables Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
68 hi def link globalVariables Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
69 hi def link aveConst Special |
7 | 70 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
71 hi def link aveClassMethods Function |
7 | 72 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
73 hi def link aveOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
74 hi def link aveComment Comment |
7 | 75 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
76 hi def link aveTypos Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
77 |
7 | 78 |
79 let b:current_syntax = "ave" |