Skip to content

Commit 0831fa6

Browse files
committed
Syntax fix for global and namespace operators
1 parent 2ca2a86 commit 0831fa6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

include/razorcs.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ syn match razorcsDelimiter /\%#=1;/ containedin=@razorcsBlocks
2828
syn region razorcsBlock matchgroup=razorcsDelimiter start=/\%#=1{/ end=/\%#=1}/ contains=@razorcs fold
2929

3030
" LHS {{{2
31-
syn keyword razorcsStatement global alias
31+
syn keyword razorcsStatement alias nextgroup=razorcsIdentifier skipwhite skipempty
3232

3333
syn keyword razorcsStatement class struct nextgroup=razorcsTypeName skipwhite skipempty
3434
syn match razorcsTypeName /\%#=1\K\k*\%(<.\{-}>\)\=/ contained contains=razorcsKeywordError,razorcsGenericParameters nextgroup=razorcsTypeBlock,razorcsTypeInheritanceOperator,razorcsTypeConstraint,razorcsTypeConstructorParameters skipwhite skipempty

syntax/razor.vim

+5-2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ syn region razorComment matchgroup=razorCommentStart start=/\%#=1@\*/ matchgroup
125125

126126
syn match razorIdentifier /\%#=1\K\k*/ contained contains=razorType,razorcsKeywordError nextgroup=razorMemberOperator,razorInvocation,razorIndex
127127
syn match razorMemberOperator /\%#=1?\=\./ contained nextgroup=razorIdentifier
128+
syn match razorMemberOperator /\%#=1::/ contained nextgroup=razorIdentifier
128129
syn region razorInvocation matchgroup=razorcsDelimiter start=/\%#=1(/ end=/\%#=1)/ contained contains=@razorcsRHS nextgroup=razorMemberOperator,razorInvocation,razorIndex
129130
syn region razorIndex matchgroup=razorcsDelimiter start=/\%#=1\[/ end=/\%#=1]/ contained contains=@razorcsRHS nextgroup=razorMemberOperator,razorInvocation,razorIndex
130131
syn keyword razorTypeof typeof contained nextgroup=razorInvocation
@@ -174,6 +175,7 @@ syn keyword razorUsingStatic static contained nextgroup=razorUsingIdentifier ski
174175
syn region razorGuardedStatement matchgroup=razorDelimiter start=/\%#=1(/ end=/\%#=1)/ contained contains=@razorcs nextgroup=razorBlock skipwhite skipempty
175176
syn match razorUsingIdentifier /\%#=1\K\k*/ contained contains=razorcsKeywordError nextgroup=razorUsingOperator,razorUsingMemberOperator skipwhite
176177
syn match razorUsingMemberOperator /\%#=1\./ contained nextgroup=razorUsingIdentifier
178+
syn match razorUsingMemberOperator /\%#=1::/ contained nextgroup=razorUsingIdentifier
177179
syn match razorUsingOperator /\%#=1=/ contained nextgroup=razorUsingIdentifier skipwhite skipempty
178180

179181
syn keyword razorTry try contained nextgroup=razorBlock skipwhite skipempty
@@ -189,15 +191,16 @@ syn keyword razorCode code contained nextgroup=razorcsTypeBlock skipwhite skipem
189191
syn keyword razorFunctions functions contained nextgroup=razorcsTypeBlock skipwhite skipempty
190192

191193
syn keyword razorImplements implements contained nextgroup=razorTypeIdentifier skipwhite
192-
syn match razorTypeIdentifier /\%#=1\K\k*\%(\.\K\k*\)*\%(<.\{-}>\)\=/ contained contains=razorcsGeneric,razorcsKeywordError,razorExtraMemberOperator
194+
syn match razorTypeIdentifier /\%#=1\K\k*\%(\%(\.\|::\)\K\k*\)*\%(<.\{-}>\)\=/ contained contains=razorcsGeneric,razorcsKeywordError,razorExtraMemberOperator
193195
syn match razorExtraMemberOperator /\%#=1\./ contained
196+
syn match razorExtraMemberOperator /\%#=1::/ contained
194197

195198
syn keyword razorInherits inherits contained nextgroup=razorTypeIdentifier skipwhite
196199

197200
syn keyword razorModel model contained nextgroup=razorTypeIdentifier skipwhite
198201

199202
syn keyword razorInject inject contained nextgroup=razorInjectIdentifier skipwhite
200-
syn match razorInjectIdentifier /\%#=1\K\k*\%(\.\K\k*\)*\%(<.\{-}>\)\=/ contained contains=razorcsGeneric,razorcsKeywordError,razorExtraMemberOperator nextgroup=razorInjectDeclarator skipwhite
203+
syn match razorInjectIdentifier /\%#=1\K\k*\%(\%(\.\|::\)\K\k*\)*\%(<.\{-}>\)\=/ contained contains=razorcsGeneric,razorcsKeywordError,razorExtraMemberOperator nextgroup=razorInjectDeclarator skipwhite
201204
syn match razorInjectDeclarator /\%#=1\K\k*/ contained contains=razorcsKeywordError
202205

203206
syn keyword razorNamespace namespace contained nextgroup=razorIdentifier skipwhite

0 commit comments

Comments
 (0)