syntax: fix highlighting of bin/hex/oct strings containing '?'

This commit is contained in:
Vadim Yanitskiy 2022-01-21 19:31:37 +06:00
parent d0291c34f2
commit 08c3e2b36e
1 changed files with 7 additions and 4 deletions

View File

@ -169,10 +169,13 @@ syn match ttcnNumber "-infinity\>"
syn keyword ttcnBool true false syn keyword ttcnBool true false
syn keyword ttcnConst omit null pass fail inconc none error syn keyword ttcnConst omit null pass fail inconc none error
syn region ttcnString start=/"/ end=/"/ skip=/\\"/ oneline syn region ttcnString start=/"/ end=/"/ skip=/\\"/ oneline
syn match ttcnString /'[01]*'B/ " In binary strings strings '?' matches one bit
syn match ttcnString /'\x*'H/ syn match ttcnString /'[01?]*'B/
syn match ttcnString /'\(\x\x\)*'O/ " In hexstrings '?' matches one nibble (4 bits)
syn match ttcnError /'\x\(\x\x\)*'O/ syn match ttcnString /'\(\x\|?\)*'H/
" In octetstings '?' matches one octet (8 bits)
syn match ttcnString /'\(\(\x\x\)\|?\)*'O/
syn match ttcnError /'\x\(\(\x\x\)\|?\)*'O/
" Comments " Comments
if version < 700 if version < 700