all valid labels should work now

This commit is contained in:
ARM9 2015-07-15 19:40:39 +02:00
parent 6445d61998
commit 9b1daaa845
2 changed files with 16 additions and 6 deletions

View File

@ -3,6 +3,10 @@ syn keyword armTodo contained todo fixme danger note notice bug author date
syn match armNumericOp "[+-/*%<>=&|^!]"
" Assembler identifiers/labels
syn match armIdentifier "\<[.\$_A-Za-z0-9]\+\>"
syn match armLabel "\<[.\$_A-Za-z0-9]\+:"
" hex
syn match armNumber "[#\$]\?0x\x\+\>"
" dec
@ -13,7 +17,7 @@ syn match armNumber "[#\$]\?0b[01]\+\>"
syn match armNumber "\d*\.\d\+\>"
" Comments
syn region armComment start="//\|@" end="$" contains=armTodo
syn region armComment start="//\|@\|#" end="$" contains=armTodo
" syn region armComment start="^#\|//\|@" end="$" contains=armTodo
syn region armComment start="/\*" end="\*/" contains=armTodo
@ -21,10 +25,7 @@ syn region armComment start="/\*" end="\*/" contains=armTodo
syn region armString start="\"" skip=+\\"+ end="\"\|$"
syn region armString start="'" skip=+\\'+ end="'\|$"
" Assembler identifiers/labels/directives
syn match armIdentifier "\<\h\w*\>"
syn match armLabel "\<\h\w*:"
syn match armLabel "\<\d\{1,3\}[:fb]\>"
" local labels
syn match armCPreProc "^\s*#\s*\(include\|define\|undef\|if\|ifdef\|ifndef\|elif\|else\|endif\|error\|pragma\)\>"
so <sfile>:p:h/gas_directives.vim

View File

@ -1,3 +1,12 @@
foo:
_bar:
.car:
.L1:
.L09:
.1337f:
ab.b: b blabl
adc r0, r1
add R1, R2
0:
@ -25,7 +34,7 @@ fdivs
vdiv
vsqrt
.float 3.14159
.float .01, 3.14159
@ illegal
blx 0002f