Skip to content

Commit 2492532

Browse files
committed
highlight operators in size & constraint properties
1 parent 82cf804 commit 2492532

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

syntax/rec.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,35 @@ if exists("b:current_syntax")
77
finish
88
endif
99

10-
syntax keyword recKeyword %allowed %auto %confidential %constraint %doc %key
11-
syntax keyword recKeyword %mandatory %prohibit %rec %size %sort %unique
10+
syntax keyword recKeyword %allowed %auto %confidential %doc %key
11+
syntax keyword recKeyword %mandatory %prohibit %rec %sort %unique
1212
syntax keyword recKeyword %unique
1313

1414
syntax match recComment "\v^#.*$"
1515
syntax match recField "\v^[a-zA-Z0-9_]*\:"
16+
syntax match recComparisonOperator "\v\>?\<?\!?\=?" contained
1617

1718
syntax keyword recType int bool range real size line regexp date contained containedin=recTypeAssociation,recTypeDeclaration
1819
syntax keyword recType enum field email uuid rec contained containedin=recTypeAssociation,recTypeDeclaration
1920
syntax region recTypeComment start="\v\(" end="\v\)" contained containedin=recTypeAssociation,recTypeDeclaration
2021
syntax match recTypeAssociation "\v^[%]type\: .*"hs=s,he=s+5 contains=recType
2122
syntax match recTypeDeclaration "\v^[%]typedef\: .*"hs=s,he=s+8 contains=recType
2223
syntax keyword recTypeLimit MIN MAX contained containedin=recTypeAssociation,recTypeDeclaration
24+
syntax match recConstraintDeclaration "\v^[%]constraint\: .*"hs=s,he=s+11 contains=recComparisonOperator
25+
syntax match recSizeDeclaration "\v^[%]size\: .*"hs=s,he=s+5 contains=recComparisonOperator
2326

2427
syntax match recNumber "\v\-?\d+"
2528
syntax match recNumber "\v\-?\d+\.\d+"
2629
syntax match recNumber "\v\-?0[0-7]+"
2730
syntax match recNumber "\v\-?0[xX][0-9a-fA-F]+"
2831

2932
highlight default link recComment Comment
33+
highlight default link recComparisonOperator Operator
34+
highlight default link recConstraintDeclaration Keyword
3035
highlight default link recField Identifier
3136
highlight default link recKeyword Keyword
3237
highlight default link recNumber Number
38+
highlight default link recSizeDeclaration Keyword
3339
highlight default link recType Type
3440
highlight default link recTypeAssociation Keyword
3541
highlight default link recTypeComment Comment

0 commit comments

Comments
 (0)