source: Dev/branches/rest-dojo-ui/client/dojox/highlight/languages/java.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: 1.7 KB
Line 
1define(["dojox/main", "../_base"], function(dojox){
2
3        var dh = dojox.highlight, dhc = dh.constants;
4        var javakeywords = {
5                                'false': 1, 'int': 1, 'float': 1, 'while': 1, 'private': 1,
6                                'char': 1, 'catch': 1, 'abstract': 1, 'assert': 1,
7                                'const': 1, 'byte': 1, 'for': 1, 'final': 1,
8                                'finally': 1, 'implements': 1, 'import': 1, 'extends': 1,
9                                'long': 1, 'throw': 1, 'instanceof': 2, 'static': 1,
10                                'protected': 1, 'boolean': 1, 'interface': 2, 'native': 1,
11                                'if': 1, 'public': 1, 'new': 1, 'do': 1, 'return': 1,
12                                'goto': 1, 'package': 2, 'void': 2, 'short': 1, 'else': 1,
13                                'break': 1, 'new': 1, 'strictfp': 1, 'super': 1, 'true': 1,
14                                'class': 1, 'synchronized': 1, 'case': 1, 'this': 1, 'short': 1,
15                                'throws': 1, 'transient': 1, 'double': 1, 'volatile': 1,
16                                'try': 1, 'this': 1, 'switch': 1, 'continue': 1
17                        }
18        dh.languages.java = {
19                // summary: Java highlight definitions
20                defaultMode: {
21                        lexems: [dhc.UNDERSCORE_IDENT_RE],
22                        illegal: '</',
23                        contains: ['comment', 'string', 'number', 'function','block'],
24                        keywords: javakeywords
25                },
26                modes: [
27                        dhc.C_LINE_COMMENT_MODE,
28                        dhc.C_BLOCK_COMMENT_MODE,
29                        dhc.C_NUMBER_MODE,
30                        dhc.QUOTE_STRING_MODE,
31                        dhc.BACKSLASH_ESCAPE,
32                        {
33                                className: 'string',
34                                begin: '\'',
35                                end: '[^\\\\]\'',
36                                illegal: '[^\\\\][^\']'
37                        },
38                        {
39                                className: 'function',
40                                begin: '\\(',
41                                end: '\\)',
42                                contains: ['comment', 'number', 'string', 'function', 'block'],
43                                keywords: javakeywords
44                        },
45                        {
46                                lexems: [dhc.UNDERSCORE_IDENT_RE],
47                                className: 'block',
48                                begin: '\\{',
49                                end: '\\}',
50                                contains: ['comment', 'string', 'number', 'function','block'],
51                                keywords: javakeywords
52                        }
53                ]
54        };
55
56        return dh.languages.java;
57});
Note: See TracBrowser for help on using the repository browser.