source: Dev/branches/rest-dojo-ui/client/dojox/highlight/languages/xquery.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 2.1 KB
Line 
1define(["dojox/main", "../_base"], function(dojox){
2
3        // Very simple XQuery language file.  Would be nice
4        // to eventually handle more of the enclosed expressions
5        // and direct XML element construction
6
7        var XQUERY_COMMENT = {
8                className: 'comment',
9                begin: '\\(\\:', end: '\\:\\)'
10        };
11
12        var XQUERY_KEYWORDS = {
13                // From section A2.2 of the XQuery 1.0 specification
14                'ancestor': 1, 'ancestor-or-self': 1, 'and' : 1,
15                'as': 1, 'ascending': 1, 'at': 1, 'attribute': 1,
16                'base-uri': 1, 'boundary-space': 1, 'by': 1, 'case': 1,
17                'cast': 1, 'castable': 1, 'child': 1, 'collation': 1,
18                'comment': 1, 'construction': 1, 'copy-namespaces': 1,
19                'declare': 1, 'default': 1, 'descendant': 1, 'descendant-or-self': 1,
20                'descending': 1, 'div': 1, 'document': 1, 'document-node': 1,
21                'element': 1, 'else': 1, 'empty': 1, 'empty-sequence': 1,
22                'encoding': 1, 'eq': 1, 'every': 1, 'except': 1, 'external': 1,
23                'following': 1, 'following-sibling': 1, 'for': 1, 'function': 1,
24                'ge': 1, 'greatest': 1, 'gt': 1, 'idiv': 1, 'if': 1, 'import': 1,
25                'in': 1, 'inherit': 1, 'instance': 1, 'intersect': 1, 'is': 1,
26                'item': 1, 'lax': 1, 'le': 1, 'least': 1, 'let': 1, 'lt': 1,
27                'mod': 1, 'module': 1, 'namespace': 1, 'ne': 1, 'node': 1,
28                'no-inherit': 1, 'no-preserve': 1, 'of': 1, 'option': 1, 'or': 1,
29                'order': 1, 'ordered': 1, 'ordering': 1, 'parent': 1,
30                'preceding': 1, 'preceding-sibling': 1, 'preserve': 1,
31                'processing-instruction': 1, 'return': 1, 'satisfies': 1,
32                'schema': 1, 'schema-attribute': 1, 'schema-element': 1,
33                'self': 1, 'some': 1, 'stable': 1, 'strict': 1, 'strip': 1,
34                'text': 1, 'then': 1, 'to': 1, 'treat': 1, 'typeswitch': 1,
35                'union': 1, 'unordered': 1, 'validate': 1, 'variable': 1,
36                'version': 1, 'where': 1, 'xquery': 1
37        };
38
39        var dh = dojox.highlight, dhc = dh.constants;
40        dh.languages.xquery = {
41                case_insensitive: true,
42                        defaultMode: {
43                                lexems: [dhc.IDENT_RE],
44                                contains: ['string', 'number', 'comment'],
45                                keywords: {
46                                        'keyword': XQUERY_KEYWORDS
47                                }
48                },
49                modes: [
50                                XQUERY_COMMENT
51                ],
52                XQUERY_COMMENT: XQUERY_COMMENT
53        };
54
55        return dh.languages.xquery;
56});
Note: See TracBrowser for help on using the repository browser.