Mercurial > vim
annotate runtime/syntax/asm.vim @ 22387:36f13f35bd78 v8.2.1742
patch 8.2.1742: test still fails without the terminal feature
Commit: https://github.com/vim/vim/commit/7e9210ea5320e0c3fd9fd93e3f3f1a59e029cf46
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 25 23:12:51 2020 +0200
patch 8.2.1742: test still fails without the terminal feature
Problem: Test still fails without the terminal feature.
Solution: Put check for terminal feature in separate function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 25 Sep 2020 23:15:03 +0200 |
parents | 46763b01cd9a |
children | 8dad79c661d1 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: GNU Assembler | |
2042 | 3 " Maintainer: Erik Wognsen <erik.wognsen@gmail.com> |
4 " Previous maintainer: | |
5 " Kevin Dahlhausen <kdahlhaus@yahoo.com> | |
5663
1dea14d4c738
Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents:
3465
diff
changeset
|
6 " Last Change: 2014 Feb 04 |
2152 | 7 |
8 " Thanks to Ori Avtalion for feedback on the comment markers! | |
7 | 9 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
10 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
11 if exists("b:current_syntax") |
7 | 12 finish |
13 endif | |
14 | |
3256 | 15 let s:cpo_save = &cpo |
16 set cpo&vim | |
17 | |
7 | 18 syn case ignore |
19 | |
20 " storage types | |
21 syn match asmType "\.long" | |
22 syn match asmType "\.ascii" | |
23 syn match asmType "\.asciz" | |
24 syn match asmType "\.byte" | |
25 syn match asmType "\.double" | |
26 syn match asmType "\.float" | |
27 syn match asmType "\.hword" | |
28 syn match asmType "\.int" | |
29 syn match asmType "\.octa" | |
30 syn match asmType "\.quad" | |
31 syn match asmType "\.short" | |
32 syn match asmType "\.single" | |
33 syn match asmType "\.space" | |
34 syn match asmType "\.string" | |
35 syn match asmType "\.word" | |
36 | |
37 syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1 | |
38 syn match asmIdentifier "[a-z_][a-z0-9_]*" | |
39 | |
40 " Various #'s as defined by GAS ref manual sec 3.6.2.1 | |
41 " Technically, the first decNumber def is actually octal, | |
42 " since the value of 0-7 octal is the same as 0-7 decimal, | |
3256 | 43 " I (Kevin) prefer to map it as decimal: |
7 | 44 syn match decNumber "0\+[1-7]\=[\t\n$,; ]" |
45 syn match decNumber "[1-9]\d*" | |
46 syn match octNumber "0[0-7][0-7]\+" | |
47 syn match hexNumber "0[xX][0-9a-fA-F]\+" | |
48 syn match binNumber "0[bB][0-1]*" | |
49 | |
2152 | 50 syn keyword asmTodo contained TODO |
51 | |
3256 | 52 |
53 " GAS supports one type of multi line comments: | |
2152 | 54 syn region asmComment start="/\*" end="\*/" contains=asmTodo |
3256 | 55 |
3465 | 56 " GAS (undocumentedly?) supports C++ style comments. Unlike in C/C++ however, |
57 " a backslash ending a C++ style comment does not extend the comment to the | |
58 " next line (hence the syntax region does not define 'skip="\\$"') | |
59 syn region asmComment start="//" end="$" keepend contains=asmTodo | |
60 | |
3256 | 61 " Line comment characters depend on the target architecture and command line |
62 " options and some comments may double as logical line number directives or | |
63 " preprocessor commands. This situation is described at | |
64 " http://sourceware.org/binutils/docs-2.22/as/Comments.html | |
65 " Some line comment characters have other meanings for other targets. For | |
66 " example, .type directives may use the `@' character which is also an ARM | |
67 " comment marker. | |
68 " As a compromise to accommodate what I arbitrarily assume to be the most | |
69 " frequently used features of the most popular architectures (and also the | |
70 " non-GNU assembly languages that use this syntax file because their asm files | |
71 " are also named *.asm), the following are used as line comment characters: | |
2152 | 72 syn match asmComment "[#;!|].*" contains=asmTodo |
3256 | 73 |
74 " Side effects of this include: | |
75 " - When `;' is used to separate statements on the same line (many targets | |
76 " support this), all statements except the first get highlighted as | |
77 " comments. As a remedy, remove `;' from the above. | |
78 " - ARM comments are not highlighted correctly. For ARM, uncomment the | |
79 " following two lines and comment the one above. | |
80 "syn match asmComment "@.*" contains=asmTodo | |
81 "syn match asmComment "^#.*" contains=asmTodo | |
82 | |
83 " Advanced users of specific architectures will probably want to change the | |
84 " comment highlighting or use a specific, more comprehensive syntax file. | |
7 | 85 |
86 syn match asmInclude "\.include" | |
87 syn match asmCond "\.if" | |
88 syn match asmCond "\.else" | |
89 syn match asmCond "\.endif" | |
90 syn match asmMacro "\.macro" | |
91 syn match asmMacro "\.endm" | |
92 | |
5663
1dea14d4c738
Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents:
3465
diff
changeset
|
93 " Assembler directives start with a '.' and may contain upper case (e.g., |
1dea14d4c738
Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents:
3465
diff
changeset
|
94 " .ABORT), numbers (e.g., .p2align), dash (e.g., .app-file) and underscore in |
1dea14d4c738
Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents:
3465
diff
changeset
|
95 " CFI directives (e.g., .cfi_startproc). This will also match labels starting |
1dea14d4c738
Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents:
3465
diff
changeset
|
96 " with '.', including the GCC auto-generated '.L' labels. |
1dea14d4c738
Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents:
3465
diff
changeset
|
97 syn match asmDirective "\.[A-Za-z][0-9A-Za-z-_]*" |
7 | 98 |
99 | |
100 syn case match | |
101 | |
102 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
103 " Only when an item doesn't have highlighting yet |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
104 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
5663
diff
changeset
|
105 " The default methods for highlighting. Can be overridden later |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
106 hi def link asmSection Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
107 hi def link asmLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
108 hi def link asmComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
109 hi def link asmTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
110 hi def link asmDirective Statement |
7 | 111 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
112 hi def link asmInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
113 hi def link asmCond PreCondit |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
114 hi def link asmMacro Macro |
7 | 115 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
116 hi def link hexNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
117 hi def link decNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
118 hi def link octNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
119 hi def link binNumber Number |
7 | 120 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
121 hi def link asmIdentifier Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
122 hi def link asmType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
123 |
7 | 124 |
125 let b:current_syntax = "asm" | |
126 | |
3256 | 127 let &cpo = s:cpo_save |
128 unlet s:cpo_save | |
129 | |
7 | 130 " vim: ts=8 |