annotate runtime/syntax/dts.vim @ 29193:1e9e9d89f0ee

Update runtime files Commit: https://github.com/vim/vim/commit/d592deb336523a5448779ee3d4bba80334cff1f7 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 17 15:42:40 2022 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Fri, 17 Jun 2022 16:45:04 +0200
parents 840665e74421
children 2a17771529af
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: dts/dtsi (device tree files)
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Daniel Mack <vim@zonque.org>
29193
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24636
diff changeset
4 " Last Change: 2022 Jun 14
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 if exists("b:current_syntax")
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 finish
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 endif
29193
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24636
diff changeset
9 let b:current_syntax = 'dts'
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 syntax region dtsComment start="/\*" end="\*/"
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 syntax match dtsReference "&[[:alpha:][:digit:]_]\+"
24636
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
13 syntax region dtsBinaryProperty start="\[" end="\]"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 syntax match dtsStringProperty "\".*\""
5425
9521463d4fc1 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4264
diff changeset
15 syntax match dtsKeyword "/.\{-1,\}/"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 syntax match dtsLabel "^[[:space:]]*[[:alpha:][:digit:]_]\+:"
4264
2d1383658bb4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4229
diff changeset
17 syntax match dtsNode /[[:alpha:][:digit:]-_]\+\(@[0-9a-fA-F]\+\|\)[[:space:]]*{/he=e-1
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 syntax region dtsCellProperty start="<" end=">" contains=dtsReference,dtsBinaryProperty,dtsStringProperty,dtsComment
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 syntax region dtsCommentInner start="/\*" end="\*/"
5425
9521463d4fc1 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4264
diff changeset
20 syntax match dtsCommentLine "//.*$"
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21
24636
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
22 " Accept %: for # (C99)
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
23 syn region cPreCondit start="^\s*\zs\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
24 syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
25 if !exists("c_no_if0")
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
26 syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
27 syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
28 syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
29 if !exists("c_no_if0_fold")
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
30 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
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
31 else
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
32 syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
33 endif
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
34 syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
35 syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
36 syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
37 if !exists("c_no_if0_fold")
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
38 syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
39 else
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
40 syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
41 endif
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
42 syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
43 syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
44 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
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
45 endif
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
46 syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
47 syn match cIncluded display contained "<[^>]*>"
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
48 syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
49 "syn match cLineSkip "\\$"
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
50 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
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
51 syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
52 syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
53
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 hi def link dtsCellProperty Number
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 hi def link dtsBinaryProperty Number
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 hi def link dtsStringProperty String
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 hi def link dtsKeyword Include
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 hi def link dtsLabel Label
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3854
diff changeset
59 hi def link dtsNode Structure
3854
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 hi def link dtsReference Macro
aa51675adf7e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 hi def link dtsComment Comment
24636
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
62 hi def link dtsCommentInner Comment
5425
9521463d4fc1 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4264
diff changeset
63 hi def link dtsCommentLine Comment
24636
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
64
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
65 hi def link cInclude Include
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
66 hi def link cPreProc PreProc
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
67 hi def link cDefine Macro
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
68 hi def link cIncluded cString
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
69 hi def link cString String
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
70
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
71 hi def link cCppInWrapper cCppOutWrapper
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
72 hi def link cCppOutWrapper cPreCondit
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
73 hi def link cPreConditMatch cPreCondit
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
74 hi def link cPreCondit PreCondit
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
75 hi def link cCppOutSkip cCppOutIf2
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
76
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
77 hi def link cCppInElse2 cCppOutIf2
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
78 hi def link cCppOutIf2 cCppOut
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 5425
diff changeset
79 hi def link cCppOut Comment