Mercurial > vim
comparison runtime/syntax/dts.vim @ 24636:840665e74421
Update runtime files
Commit: https://github.com/vim/vim/commit/3ec3217f0491e9ba8aa8ea02f7e454cd19a287ef
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 16 12:39:47 2021 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 16 May 2021 12:45:04 +0200 |
parents | 9521463d4fc1 |
children | 1e9e9d89f0ee |
comparison
equal
deleted
inserted
replaced
24635:d3bbbedec49b | 24636:840665e74421 |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: dts/dtsi (device tree files) | 2 " Language: dts/dtsi (device tree files) |
3 " Maintainer: Daniel Mack <vim@zonque.org> | 3 " Maintainer: Daniel Mack <vim@zonque.org> |
4 " Last Change: 2013 Oct 20 | 4 " Last Change: 2021 May 15 |
5 | 5 |
6 if exists("b:current_syntax") | 6 if exists("b:current_syntax") |
7 finish | 7 finish |
8 endif | 8 endif |
9 | 9 |
10 syntax region dtsComment start="/\*" end="\*/" | 10 syntax region dtsComment start="/\*" end="\*/" |
11 syntax match dtsReference "&[[:alpha:][:digit:]_]\+" | 11 syntax match dtsReference "&[[:alpha:][:digit:]_]\+" |
12 syntax region dtsBinaryProperty start="\[" end="\]" | 12 syntax region dtsBinaryProperty start="\[" end="\]" |
13 syntax match dtsStringProperty "\".*\"" | 13 syntax match dtsStringProperty "\".*\"" |
14 syntax match dtsKeyword "/.\{-1,\}/" | 14 syntax match dtsKeyword "/.\{-1,\}/" |
15 syntax match dtsLabel "^[[:space:]]*[[:alpha:][:digit:]_]\+:" | 15 syntax match dtsLabel "^[[:space:]]*[[:alpha:][:digit:]_]\+:" |
16 syntax match dtsNode /[[:alpha:][:digit:]-_]\+\(@[0-9a-fA-F]\+\|\)[[:space:]]*{/he=e-1 | 16 syntax match dtsNode /[[:alpha:][:digit:]-_]\+\(@[0-9a-fA-F]\+\|\)[[:space:]]*{/he=e-1 |
17 syntax region dtsCellProperty start="<" end=">" contains=dtsReference,dtsBinaryProperty,dtsStringProperty,dtsComment | 17 syntax region dtsCellProperty start="<" end=">" contains=dtsReference,dtsBinaryProperty,dtsStringProperty,dtsComment |
18 syntax region dtsCommentInner start="/\*" end="\*/" | 18 syntax region dtsCommentInner start="/\*" end="\*/" |
19 syntax match dtsCommentLine "//.*$" | 19 syntax match dtsCommentLine "//.*$" |
20 | |
21 " Accept %: for # (C99) | |
22 syn region cPreCondit start="^\s*\zs\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError | |
23 syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>" | |
24 if !exists("c_no_if0") | |
25 syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip | |
26 syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold | |
27 syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse | |
28 if !exists("c_no_if0_fold") | |
29 syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold | |
30 else | |
31 syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell | |
32 endif | |
33 syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit | |
34 syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold | |
35 syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit | |
36 if !exists("c_no_if0_fold") | |
37 syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold | |
38 else | |
39 syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 | |
40 endif | |
41 syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell | |
42 syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip | |
43 syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc | |
44 endif | |
45 syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ | |
46 syn match cIncluded display contained "<[^>]*>" | |
47 syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded | |
48 "syn match cLineSkip "\\$" | |
49 syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock | |
50 syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell | |
51 syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell | |
20 | 52 |
21 hi def link dtsCellProperty Number | 53 hi def link dtsCellProperty Number |
22 hi def link dtsBinaryProperty Number | 54 hi def link dtsBinaryProperty Number |
23 hi def link dtsStringProperty String | 55 hi def link dtsStringProperty String |
24 hi def link dtsKeyword Include | 56 hi def link dtsKeyword Include |
25 hi def link dtsLabel Label | 57 hi def link dtsLabel Label |
26 hi def link dtsNode Structure | 58 hi def link dtsNode Structure |
27 hi def link dtsReference Macro | 59 hi def link dtsReference Macro |
28 hi def link dtsComment Comment | 60 hi def link dtsComment Comment |
29 hi def link dtsCommentInner Comment | 61 hi def link dtsCommentInner Comment |
30 hi def link dtsCommentLine Comment | 62 hi def link dtsCommentLine Comment |
63 | |
64 hi def link cInclude Include | |
65 hi def link cPreProc PreProc | |
66 hi def link cDefine Macro | |
67 hi def link cIncluded cString | |
68 hi def link cString String | |
69 | |
70 hi def link cCppInWrapper cCppOutWrapper | |
71 hi def link cCppOutWrapper cPreCondit | |
72 hi def link cPreConditMatch cPreCondit | |
73 hi def link cPreCondit PreCondit | |
74 hi def link cCppOutSkip cCppOutIf2 | |
75 | |
76 hi def link cCppInElse2 cCppOutIf2 | |
77 hi def link cCppOutIf2 cCppOut | |
78 hi def link cCppOut Comment |