annotate runtime/syntax/xquery.vim @ 10114:aa2219afd1c2 v7.4.2328

commit https://github.com/vim/vim/commit/f9e687e0681a250e1549ab27b6c7ef2c500395e3 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 4 21:33:09 2016 +0200 patch 7.4.2328 Problem: Crash when BufWinLeave autocmd goes to another tab page. (Hirohito Higashi) Solution: Make close_buffer() go back to the right window.
author Christian Brabandt <cb@256bit.org>
date Sun, 04 Sep 2016 21:45:06 +0200
parents fd09a9c8468e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
1 " Vim syntax file
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
2 " Language: XQuery
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
3 " Author: René Neumann <necoro@necoro.eu>
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
4 " Author: Steve Spigarelli <http://spig.net/>
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
5 " Original Author: Jean-Marc Vanel <http://jmvanel.free.fr/>
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2681
diff changeset
6 " Last Change: mar jui 12 18:04:05 CEST 2005
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
7 " Filenames: *.xq
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
8 " URL: http://jmvanel.free.fr/vim/xquery.vim
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
9
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
10 " REFERENCES:
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
11 " [1] http://www.w3.org/TR/xquery/
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
12
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
13 " Quit when a syntax file was already loaded
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
14 if exists("b:current_syntax")
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
15 finish
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
16 endif
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
17
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
18 " - is allowed in keywords
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
19 setlocal iskeyword+=-
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
20
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
21 runtime syntax/xml.vim
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
22
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
23 syn case match
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
24
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
25 " From XQuery grammar:
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
26 syn 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
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
27
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
28 " TODO contains clashes with vim keyword
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
29 syn 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
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
30
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
31 syn 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
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
32
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
33 syn 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\)"
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
34
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
35
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
36 " From XPath grammar:
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
37 syn 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
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
38
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
39 " eXist extensions
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
40 syn match xqExist "&="
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
41
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
42 " XQdoc
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
43 syn match XQdoc contained "@\(param\|return\|author\)\>"
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
44
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
45 " floating point number, with dot, optional exponent
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
46 syn match xqFloat "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
47 " floating point number, starting with a dot, optional exponent
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
48 syn match xqFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
49 " floating point number, without dot, with exponent
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
50 syn match xqFloat "\d\+e[-+]\=\d\+[fl]\=\>"
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
51 syn match xqNumber "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
52 syn match xqNumber "\<\d\+\>"
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
53
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2681
diff changeset
54 syn region xqString start=+\z(['"]\)+ skip=+\\.+ end=+\z1+
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
55 syn region xqComment start='(:' excludenl end=':)' contains=XQdoc
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
56
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
57 syn match xqVariable "$\<[a-zA-Z:_][-.0-9a-zA-Z0-9:_]*\>"
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
58 syn match xqSeparator ",\|;"
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
59 syn region xqCode transparent contained start='{' excludenl end='}' contains=xqFunction,xqCode,xmlRegionBis,xqComment,xqStatement,xmlString,xqSeparator,xqNumber,xqVariable,xqString keepend extend
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
60
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
61 syn region xmlRegionBis start=+<\z([^ /!?<>"']\+\)+ skip=+<!--\_.\{-}-->+ end=+</\z1\_\s\{-}>+ end=+/>+ fold contains=xmlTag,xmlEndTag,xmlCdata,xmlRegionBis,xmlComment,xmlEntity,xmlProcessing,xqCode keepend extend
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
62
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
63 hi def link xqNumber Number
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
64 hi def link xqFloat Number
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
65 hi def link xqString String
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
66 hi def link xqVariable Identifier
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
67 hi def link xqComment Comment
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
68 hi def link xqSeparator Operator
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
69 hi def link xqStatement Statement
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
70 hi def link xqFunction Function
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
71 hi def link xqOperator Operator
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
72 hi def link xqType Type
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
73 hi def link xqXPath Operator
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
74 hi def link XQdoc Special
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
75 hi def link xqExist Operator
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
76
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
77 " override the xml highlighting
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
78 "hi link xmlTag Structure
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
79 "hi link xmlTagName Structure
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
80 "hi link xmlEndTag Structure
418
84825cc6f049 updated for version 7.0109
vimboss
parents:
diff changeset
81
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
82 let b:current_syntax = "xquery"