if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yard') == -1 " Ruby syntax extensions for highlighting YARD documentation. " " Author: Joel Holdbrooks " URI: https://github.com/noprompt/vim-yardoc " Version: 0.0.1 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Tags """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syn match yardGenericTag "@\h\+" contained syn match yardAbstract "@abstract" contained syn match yardApi "@api" contained syn match yardAttr "@attr" contained syn match yardAttrReader "@attr_reader" contained syn match yardAttrWriter "@attr_writer" contained syn match yardAuthor "@author" contained syn match yardDeprecated "@deprecated" contained syn match yardExample "@example" contained syn match yardNote "@note" contained syn match yardOption "@option" contained syn match yardOverload "@overload" contained syn match yardParam "@param" contained syn match yardPrivate "@private" contained syn match yardRaise "@raise" contained syn match yardReturn "@return" contained syn match yardSee "@see" contained syn match yardSince "@since" contained syn match yardTodo "@todo" contained syn match yardVersion "@version" contained syn match yardYield "@yield" contained syn match yardYieldParam "@yieldparam" contained syn match yardYieldReturn "@yieldreturn" contained syn cluster yardTags contains=yardGenericTag,yardAbstract,yardApi,yardAttr,yardAttrReader,yardAttrWriter,yardAuthor,yardDeprecated,yardExample,yardNote,yardOption,yardOverload,yardParam,yardPrivate,yardRaise,yardReturn,yardSee,yardSince,yardTodo,yardVersion,yardYield,yardYieldParam,yardYieldReturn """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Directives """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syn match yardGenericDirective "@!\h\+" contained syn match yardAttribute "@!attribute" contained syn match yardEndGroup "@!endgroup" contained syn match yardGroup "@!group" contained syn match yardMacro "@!macro" contained syn match yardMethod "@!method" contained syn match yardParse "@!parse" contained syn match yardScope "@!scope" contained syn match yardVisibility "@!visibility" contained syn cluster yardDirectives contains=yardGenericDirective,yardAttribute,yardEndGroup,yardGroup,yardMacro,yardMethod,yardParse,yardScope,yardVisibility """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Types, Lists, and Hashes """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syn match yardDuckType "#\h\+" contained syn match yardType "[A-Z]\h\+" contained syn match yardLiteral "\(true\|false\|nil\|self\|void\)" contained syn match yardComma "," nextgroup=@yardTypes contained syn match yardArrow "=>" nextgroup=@yardTypes contained syn region yardParametricType start="[A-Z]\+\h\+<" end=">" contains=yardType,yardOrderDependentList,yardComma skipwhite contained syn region yardOrderDependentList start="(" end=")" contains=@yardTypes,yardComma skipwhite contained syn region yardTypeList start="\[" end="]" contains=@yardTypes,yardOrderDependentList,@yardHashes skipwhite contained syn region yardHashAngle start="Hash<" end=">" contains=yardDuckType,yardType,yardLiteral,yardArrow,yardComma skipwhite contained syn region yardHashCurly start="Hash{" end="}" contains=@yardTypes,yardArrow,yardComma skipwhite contained syn cluster yardTypes contains=yardDuckType,yardType,yardLiteral,yardParametricType syn cluster yardHashes contains=yardArrow,yardHashAngle,yardHashCurly syn cluster yardLists contains=yardComma,yardTypeList,yardOrderDependentList """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Yard """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" syn match yardComment "#\s*@!\{,1}\h\+.*" contains=@yardTags,@yardDirectives,yardTypeList syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell,yardComment syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@