1bbebc857SBram Moolenaar" Vim syntax file 2bbebc857SBram Moolenaar" Language: XQuery 32a8a3ecbSBram Moolenaar" Author: René Neumann <[email protected]> 42a8a3ecbSBram Moolenaar" Author: Steve Spigarelli <http://spig.net/> 52a8a3ecbSBram Moolenaar" Original Author: Jean-Marc Vanel <http://jmvanel.free.fr/> 6*251e1912SBram Moolenaar" Last Change: mar jui 12 18:04:05 CEST 2005 7bbebc857SBram Moolenaar" Filenames: *.xq 8bbebc857SBram Moolenaar" URL: http://jmvanel.free.fr/vim/xquery.vim 9bbebc857SBram Moolenaar 10bbebc857SBram Moolenaar" REFERENCES: 11bbebc857SBram Moolenaar" [1] http://www.w3.org/TR/xquery/ 12bbebc857SBram Moolenaar 13bbebc857SBram Moolenaar" Quit when a syntax file was already loaded 14bbebc857SBram Moolenaarif exists("b:current_syntax") 15bbebc857SBram Moolenaar finish 16bbebc857SBram Moolenaarendif 17bbebc857SBram Moolenaar 182a8a3ecbSBram Moolenaar" - is allowed in keywords 192a8a3ecbSBram Moolenaarsetlocal iskeyword+=- 202a8a3ecbSBram Moolenaar 21bbebc857SBram Moolenaarruntime syntax/xml.vim 22bbebc857SBram Moolenaar 23bbebc857SBram Moolenaarsyn case match 24bbebc857SBram Moolenaar 25bbebc857SBram Moolenaar" From XQuery grammar: 262a8a3ecbSBram Moolenaarsyn keyword xqStatement ancestor ancestor-or-self and as ascending at attribute base-uri boundary-space by case cast castable child collation construction declare default descendant descendant-or-self descending div document element else empty encoding eq every except external following following-sibling for function ge greatest gt idiv if import in inherit-namespaces instance intersect is le least let lt mod module namespace ne no of or order ordered ordering parent preceding preceding-sibling preserve return satisfies schema self some stable strip then to treat typeswitch union unordered validate variable version where xmlspace xquery yes 27bbebc857SBram Moolenaar 28bbebc857SBram Moolenaar" TODO contains clashes with vim keyword 292a8a3ecbSBram Moolenaarsyn keyword xqFunction abs adjust-date-to-timezone adjust-date-to-timezone adjust-dateTime-to-timezone adjust-dateTime-to-timezone adjust-time-to-timezone adjust-time-to-timezone avg base-uri base-uri boolean ceiling codepoint-equal codepoints-to-string collection collection compare concat count current-date current-dateTime current-time data dateTime day-from-date day-from-dateTime days-from-duration deep-equal deep-equal default-collation distinct-values distinct-values doc doc-available document-uri empty ends-with ends-with error error error error escape-uri exactly-one exists false floor hours-from-dateTime hours-from-duration hours-from-time id id idref idref implicit-timezone in-scope-prefixes index-of index-of insert-before lang lang last local-name local-name local-name-from-QName lower-case matches matches max max min min minutes-from-dateTime minutes-from-duration minutes-from-time month-from-date month-from-dateTime months-from-duration name name namespace-uri namespace-uri namespace-uri-for-prefix namespace-uri-from-QName nilled node-name normalize-space normalize-space normalize-unicode normalize-unicode not number number one-or-more position prefix-from-QName QName remove replace replace resolve-QName resolve-uri resolve-uri reverse root root round round-half-to-even round-half-to-even seconds-from-dateTime seconds-from-duration seconds-from-time starts-with starts-with static-base-uri string string string-join string-length string-length string-to-codepoints subsequence subsequence substring substring substring-after substring-after substring-before substring-before sum sum timezone-from-date timezone-from-dateTime timezone-from-time tokenize tokenize trace translate true unordered upper-case year-from-date year-from-dateTime years-from-duration zero-or-one 30bbebc857SBram Moolenaar 312a8a3ecbSBram Moolenaarsyn keyword xqOperator add-dayTimeDuration-to-date add-dayTimeDuration-to-dateTime add-dayTimeDuration-to-time add-dayTimeDurations add-yearMonthDuration-to-date add-yearMonthDuration-to-dateTime add-yearMonthDurations base64Binary-equal boolean-equal boolean-greater-than boolean-less-than concatenate date-equal date-greater-than date-less-than dateTime-equal dateTime-greater-than dateTime-less-than dayTimeDuration-equal dayTimeDuration-greater-than dayTimeDuration-less-than divide-dayTimeDuration divide-dayTimeDuration-by-dayTimeDuration divide-yearMonthDuration divide-yearMonthDuration-by-yearMonthDuration except gDay-equal gMonth-equal gMonthDay-equal gYear-equal gYearMonth-equal hexBinary-equal intersect is-same-node multiply-dayTimeDuration multiply-yearMonthDuration node-after node-before NOTATION-equal numeric-add numeric-divide numeric-equal numeric-greater-than numeric-integer-divide numeric-less-than numeric-mod numeric-multiply numeric-subtract numeric-unary-minus numeric-unary-plus QName-equal subtract-dates-yielding-dayTimeDuration subtract-dateTimes-yielding-dayTimeDuration subtract-dayTimeDuration-from-date subtract-dayTimeDuration-from-dateTime subtract-dayTimeDuration-from-time subtract-dayTimeDurations subtract-times subtract-yearMonthDuration-from-date subtract-yearMonthDuration-from-dateTime subtract-yearMonthDurations time-equal time-greater-than time-less-than to union yearMonthDuration-equal yearMonthDuration-greater-than yearMonthDuration-less-than 32bbebc857SBram Moolenaar 332a8a3ecbSBram Moolenaarsyn match xqType "xs:\(\|Datatype\|primitive\|string\|boolean\|float\|double\|decimal\|duration\|dateTime\|time\|date\|gYearMonth\|gYear\|gMonthDay\|gDay\|gMonth\|hexBinary\|base64Binary\|anyURI\|QName\|NOTATION\|\|normalizedString\|token\|language\|IDREFS\|ENTITIES\|NMTOKEN\|NMTOKENS\|Name\|NCName\|ID\|IDREF\|ENTITY\|integer\|nonPositiveInteger\|negativeInteger\|long\|int\|short\|byte\|nonNegativeInteger\|unsignedLong\|unsignedInt\|unsignedShort\|unsignedByte\|positiveInteger\)" 342a8a3ecbSBram Moolenaar 35bbebc857SBram Moolenaar 36bbebc857SBram Moolenaar" From XPath grammar: 372a8a3ecbSBram Moolenaarsyn keyword xqXPath some every in in satisfies if then else to div idiv mod union intersect except instance of treat castable cast eq ne lt le gt ge is child descendant attribute self descendant-or-self following-sibling following namespace parent ancestor preceding-sibling preceding ancestor-or-self void item node document-node text comment processing-instruction attribute schema-attribute schema-element 38bbebc857SBram Moolenaar 39bbebc857SBram Moolenaar" eXist extensions 40bbebc857SBram Moolenaarsyn match xqExist "&=" 41bbebc857SBram Moolenaar 42bbebc857SBram Moolenaar" XQdoc 43bbebc857SBram Moolenaarsyn match XQdoc contained "@\(param\|return\|author\)\>" 44bbebc857SBram Moolenaar 45bbebc857SBram Moolenaar" floating point number, with dot, optional exponent 462a8a3ecbSBram Moolenaarsyn match xqFloat "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" 47bbebc857SBram Moolenaar" floating point number, starting with a dot, optional exponent 482a8a3ecbSBram Moolenaarsyn match xqFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" 49bbebc857SBram Moolenaar" floating point number, without dot, with exponent 502a8a3ecbSBram Moolenaarsyn match xqFloat "\d\+e[-+]\=\d\+[fl]\=\>" 512a8a3ecbSBram Moolenaarsyn match xqNumber "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" 522a8a3ecbSBram Moolenaarsyn match xqNumber "\<\d\+\>" 53bbebc857SBram Moolenaar 54*251e1912SBram Moolenaarsyn region xqString start=+\z(['"]\)+ skip=+\\.+ end=+\z1+ 55bbebc857SBram Moolenaarsyn region xqComment start='(:' excludenl end=':)' contains=XQdoc 56bbebc857SBram Moolenaar 572a8a3ecbSBram Moolenaarsyn match xqVariable "$\<[a-zA-Z:_][-.0-9a-zA-Z0-9:_]*\>" 582a8a3ecbSBram Moolenaarsyn match xqSeparator ",\|;" 592a8a3ecbSBram Moolenaarsyn region xqCode transparent contained start='{' excludenl end='}' contains=xqFunction,xqCode,xmlRegionBis,xqComment,xqStatement,xmlString,xqSeparator,xqNumber,xqVariable,xqString keepend extend 60bbebc857SBram Moolenaar 61bbebc857SBram Moolenaarsyn region xmlRegionBis start=+<\z([^ /!?<>"']\+\)+ skip=+<!--\_.\{-}-->+ end=+</\z1\_\s\{-}>+ end=+/>+ fold contains=xmlTag,xmlEndTag,xmlCdata,xmlRegionBis,xmlComment,xmlEntity,xmlProcessing,xqCode keepend extend 62bbebc857SBram Moolenaar 632a8a3ecbSBram Moolenaarhi def link xqNumber Number 642a8a3ecbSBram Moolenaarhi def link xqFloat Number 652a8a3ecbSBram Moolenaarhi def link xqString String 662a8a3ecbSBram Moolenaarhi def link xqVariable Identifier 672a8a3ecbSBram Moolenaarhi def link xqComment Comment 682a8a3ecbSBram Moolenaarhi def link xqSeparator Operator 692a8a3ecbSBram Moolenaarhi def link xqStatement Statement 702a8a3ecbSBram Moolenaarhi def link xqFunction Function 712a8a3ecbSBram Moolenaarhi def link xqOperator Operator 722a8a3ecbSBram Moolenaarhi def link xqType Type 732a8a3ecbSBram Moolenaarhi def link xqXPath Operator 742a8a3ecbSBram Moolenaarhi def link XQdoc Special 752a8a3ecbSBram Moolenaarhi def link xqExist Operator 76bbebc857SBram Moolenaar 772a8a3ecbSBram Moolenaar" override the xml highlighting 782a8a3ecbSBram Moolenaar"hi link xmlTag Structure 792a8a3ecbSBram Moolenaar"hi link xmlTagName Structure 802a8a3ecbSBram Moolenaar"hi link xmlEndTag Structure 81bbebc857SBram Moolenaar 822a8a3ecbSBram Moolenaarlet b:current_syntax = "xquery" 83