utopia-project 0.37.6 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/context/documentation-guidelines.md +12 -7
- data/lib/utopia/project/import_map.rb +1 -0
- data/lib/utopia/project/version.rb +1 -1
- data/pages/_page.xnode +8 -13
- data/public/_components/@socketry/syntax/Syntax/CodeElement.js +293 -0
- data/public/_components/@socketry/syntax/Syntax/Errors.js +52 -0
- data/public/_components/@socketry/syntax/Syntax/Language/apache.js +49 -0
- data/public/_components/@socketry/syntax/Syntax/Language/applescript.js +157 -0
- data/public/_components/@socketry/syntax/Syntax/Language/assembly.js +42 -0
- data/public/_components/@socketry/syntax/Syntax/Language/bash-script.js +108 -0
- data/public/_components/@socketry/syntax/Syntax/Language/bash.js +32 -0
- data/public/_components/@socketry/syntax/Syntax/Language/basic.js +232 -0
- data/public/_components/@socketry/syntax/Syntax/Language/c++.js +1 -0
- data/public/_components/@socketry/syntax/Syntax/Language/c.js +1 -0
- data/public/_components/@socketry/syntax/Syntax/Language/clang.js +201 -0
- data/public/_components/@socketry/syntax/Syntax/Language/cpp.js +1 -0
- data/public/_components/@socketry/syntax/Syntax/Language/csharp.js +166 -0
- data/public/_components/@socketry/syntax/Syntax/Language/css.js +244 -0
- data/public/_components/@socketry/syntax/Syntax/Language/diff.js +24 -0
- data/public/_components/@socketry/syntax/Syntax/Language/go.js +135 -0
- data/public/_components/@socketry/syntax/Syntax/Language/haskell.js +110 -0
- data/public/_components/@socketry/syntax/Syntax/Language/html.js +69 -0
- data/public/_components/@socketry/syntax/Syntax/Language/io.js +68 -0
- data/public/_components/@socketry/syntax/Syntax/Language/java.js +134 -0
- data/public/_components/@socketry/syntax/Syntax/Language/javascript.js +89 -0
- data/public/_components/@socketry/syntax/Syntax/Language/json.js +36 -0
- data/public/_components/@socketry/syntax/Syntax/Language/lisp.js +38 -0
- data/public/_components/@socketry/syntax/Syntax/Language/lua.js +87 -0
- data/public/_components/@socketry/syntax/Syntax/Language/markdown.js +112 -0
- data/public/_components/@socketry/syntax/Syntax/Language/nginx.js +37 -0
- data/public/_components/@socketry/syntax/Syntax/Language/objective-c.js +1 -0
- data/public/_components/@socketry/syntax/Syntax/Language/ocaml.js +225 -0
- data/public/_components/@socketry/syntax/Syntax/Language/pascal.js +166 -0
- data/public/_components/@socketry/syntax/Syntax/Language/patch.js +2 -0
- data/public/_components/@socketry/syntax/Syntax/Language/perl5.js +317 -0
- data/public/_components/@socketry/syntax/Syntax/Language/php-script.js +112 -0
- data/public/_components/@socketry/syntax/Syntax/Language/php.js +18 -0
- data/public/_components/@socketry/syntax/Syntax/Language/plain.js +20 -0
- data/public/_components/@socketry/syntax/Syntax/Language/protobuf.js +77 -0
- data/public/_components/@socketry/syntax/Syntax/Language/python.js +208 -0
- data/public/_components/@socketry/syntax/Syntax/Language/ruby.js +124 -0
- data/public/_components/@socketry/syntax/Syntax/Language/scala.js +81 -0
- data/public/_components/@socketry/syntax/Syntax/Language/smalltalk.js +30 -0
- data/public/_components/@socketry/syntax/Syntax/Language/sql.js +865 -0
- data/public/_components/@socketry/syntax/Syntax/Language/super-collider.js +70 -0
- data/public/_components/@socketry/syntax/Syntax/Language/swift.js +176 -0
- data/public/_components/@socketry/syntax/Syntax/Language/xml.js +76 -0
- data/public/_components/@socketry/syntax/Syntax/Language/xrb.js +33 -0
- data/public/_components/@socketry/syntax/Syntax/Language/yaml.js +29 -0
- data/public/_components/@socketry/syntax/Syntax/Language.js +276 -0
- data/public/_components/@socketry/syntax/Syntax/Loader.js +78 -0
- data/public/_components/@socketry/syntax/Syntax/Match.js +546 -0
- data/public/_components/@socketry/syntax/Syntax/Rule.js +306 -0
- data/public/_components/@socketry/syntax/Syntax.js +356 -0
- data/public/_components/@socketry/syntax/license.md +21 -0
- data/public/_components/@socketry/syntax/package.json +43 -0
- data/public/_components/@socketry/syntax/readme.md +162 -0
- data/public/_components/@socketry/syntax/themes/base/apache.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/applescript.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/assembly.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/bash.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/basic.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/c.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/clang.css +0 -0
- data/public/_components/@socketry/syntax/themes/base/csharp.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/css.css +22 -0
- data/public/_components/@socketry/syntax/themes/base/diff.css +48 -0
- data/public/_components/@socketry/syntax/themes/base/go.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/haskell.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/html.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/io.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/java.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/javascript.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/json.css +41 -0
- data/public/_components/@socketry/syntax/themes/base/lisp.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/lua.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/markdown.css +16 -0
- data/public/_components/@socketry/syntax/themes/base/nginx.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/ocaml.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/pascal.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/perl5.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/php-script.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/php.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/plain.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/protobuf.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/python.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/ruby.css +23 -0
- data/public/_components/@socketry/syntax/themes/base/scala.css +3 -0
- data/public/_components/@socketry/syntax/themes/base/smalltalk.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/sql.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/super-collider.css +33 -0
- data/public/_components/@socketry/syntax/themes/base/swift.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/syntax.css +63 -0
- data/public/_components/@socketry/syntax/themes/base/xml.css +1 -0
- data/public/_components/@socketry/syntax/themes/base/xrb.css +29 -0
- data/public/_components/@socketry/syntax/themes/base/yaml.css +1 -0
- data/public/_components/@socketry/syntax/themes/theming.md +233 -0
- data/public/_static/sidebar.js +55 -22
- data/public/_static/site.css +0 -4
- data.tar.gz.sig +0 -0
- metadata +94 -1
- metadata.gz.sig +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {Language} from '../Language.js';
|
|
2
|
+
import {Rule} from '../Rule.js';
|
|
3
|
+
|
|
4
|
+
const language = new Language('assembly');
|
|
5
|
+
|
|
6
|
+
language.push(Rule.cStyleComment);
|
|
7
|
+
language.push(Rule.cppStyleComment);
|
|
8
|
+
|
|
9
|
+
language.push({pattern: /\.[a-zA-Z_][a-zA-Z0-9_]*/m, type: 'directive'});
|
|
10
|
+
|
|
11
|
+
language.push({pattern: /^[a-zA-Z_][a-zA-Z0-9_]*:/m, type: 'label'});
|
|
12
|
+
|
|
13
|
+
language.push({
|
|
14
|
+
pattern: /^\s*([a-zA-Z]+)/m,
|
|
15
|
+
matches: Rule.extractMatches({type: 'function'})
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
language.push({pattern: /(-[0-9]+)|(\b[0-9]+)|(\$[0-9]+)/, type: 'constant'});
|
|
19
|
+
language.push({
|
|
20
|
+
pattern: /(\-|\b|\$)(0x[0-9a-f]+|[0-9]+|[a-z0-9_]+)/i,
|
|
21
|
+
type: 'constant'
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
language.push({pattern: /%\w+/, type: 'register'});
|
|
25
|
+
|
|
26
|
+
// Strings
|
|
27
|
+
language.push(Rule.singleQuotedString);
|
|
28
|
+
language.push(Rule.doubleQuotedString);
|
|
29
|
+
language.push(Rule.stringEscape);
|
|
30
|
+
|
|
31
|
+
// Numbers
|
|
32
|
+
language.push(Rule.decimalNumber);
|
|
33
|
+
language.push(Rule.hexNumber);
|
|
34
|
+
|
|
35
|
+
// Comments
|
|
36
|
+
language.push(Rule.perlStyleComment);
|
|
37
|
+
language.push(Rule.webLink);
|
|
38
|
+
|
|
39
|
+
export default function register(syntax) {
|
|
40
|
+
syntax.register('assembly', language);
|
|
41
|
+
syntax.alias('assembly', ['asm']);
|
|
42
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {Language} from '../Language.js';
|
|
2
|
+
import {Rule} from '../Rule.js';
|
|
3
|
+
const bashScript = new Language('bash-script');
|
|
4
|
+
|
|
5
|
+
var operators = ['&&', '|', ';', '{', '}'];
|
|
6
|
+
bashScript.push(operators, {type: 'operator'});
|
|
7
|
+
|
|
8
|
+
bashScript.push({
|
|
9
|
+
pattern:
|
|
10
|
+
/(?:^|\||;|&&)\s*((?:"([^"]|\\")+"|'([^']|\\')+'|\\\n|.|[ \t])+?)(?=$|\||;|&&)/im,
|
|
11
|
+
matches: Rule.extractMatches({language: 'bash-statement'})
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const bashStatement = new Language('bash-statement');
|
|
15
|
+
|
|
16
|
+
var keywords = [
|
|
17
|
+
'break',
|
|
18
|
+
'case',
|
|
19
|
+
'continue',
|
|
20
|
+
'do',
|
|
21
|
+
'done',
|
|
22
|
+
'elif',
|
|
23
|
+
'else',
|
|
24
|
+
'eq',
|
|
25
|
+
'fi',
|
|
26
|
+
'for',
|
|
27
|
+
'function',
|
|
28
|
+
'ge',
|
|
29
|
+
'gt',
|
|
30
|
+
'if',
|
|
31
|
+
'in',
|
|
32
|
+
'le',
|
|
33
|
+
'lt',
|
|
34
|
+
'ne',
|
|
35
|
+
'return',
|
|
36
|
+
'then',
|
|
37
|
+
'until',
|
|
38
|
+
'while'
|
|
39
|
+
];
|
|
40
|
+
bashStatement.push(keywords, {type: 'keyword'});
|
|
41
|
+
|
|
42
|
+
var statementOperators = [
|
|
43
|
+
'>',
|
|
44
|
+
'<',
|
|
45
|
+
'=',
|
|
46
|
+
'`',
|
|
47
|
+
'--',
|
|
48
|
+
'{',
|
|
49
|
+
'}',
|
|
50
|
+
'(',
|
|
51
|
+
')',
|
|
52
|
+
'[',
|
|
53
|
+
']'
|
|
54
|
+
];
|
|
55
|
+
bashStatement.push(statementOperators, {type: 'operator'});
|
|
56
|
+
|
|
57
|
+
bashStatement.push({
|
|
58
|
+
pattern: /\(\((.*?)\)\)/im,
|
|
59
|
+
type: 'expression',
|
|
60
|
+
allow: ['variable', 'string', 'operator', 'constant']
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
bashStatement.push({
|
|
64
|
+
pattern: /`([\s\S]+?)`/im,
|
|
65
|
+
matches: Rule.extractMatches({language: 'bash-script', debug: true})
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
bashStatement.push(Rule.perlStyleComment);
|
|
69
|
+
|
|
70
|
+
// Probably need to write a real parser here rather than using regular expressions, it is too fragile
|
|
71
|
+
// and misses lots of edge cases (e.g. nested brackets, delimiters).
|
|
72
|
+
bashStatement.push({
|
|
73
|
+
pattern:
|
|
74
|
+
/^\s*((?:\S+?=\$?(?:\[[^\]]+\]|\(\(.*?\)\)|"(?:[^"]|\\")+"|'(?:[^']|\\')+'|\S+)\s*)*)((?:(\\ |\S)+)?)/im,
|
|
75
|
+
matches: Rule.extractMatches(
|
|
76
|
+
{
|
|
77
|
+
type: 'env',
|
|
78
|
+
allow: ['variable', 'string', 'operator', 'constant', 'expression']
|
|
79
|
+
},
|
|
80
|
+
{type: 'function', allow: ['variable', 'string']}
|
|
81
|
+
)
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
bashStatement.push({
|
|
85
|
+
pattern: /(\S+?)=/im,
|
|
86
|
+
matches: Rule.extractMatches({type: 'variable'}),
|
|
87
|
+
only: ['env']
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
bashStatement.push({
|
|
91
|
+
pattern: /\$\w+/,
|
|
92
|
+
type: 'variable'
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
bashStatement.push({pattern: /\s\-+[\w-]+/, type: 'option'});
|
|
96
|
+
|
|
97
|
+
bashStatement.push(Rule.singleQuotedString);
|
|
98
|
+
bashStatement.push(Rule.doubleQuotedString);
|
|
99
|
+
|
|
100
|
+
bashStatement.push(Rule.decimalNumber);
|
|
101
|
+
bashStatement.push(Rule.hexNumber);
|
|
102
|
+
|
|
103
|
+
bashStatement.push(Rule.webLink);
|
|
104
|
+
|
|
105
|
+
export default function register(syntax) {
|
|
106
|
+
syntax.register('bash-script', bashScript);
|
|
107
|
+
syntax.register('bash-statement', bashStatement);
|
|
108
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {Language} from '../Language.js';
|
|
2
|
+
import {Rule} from '../Rule.js';
|
|
3
|
+
|
|
4
|
+
const language = new Language('bash');
|
|
5
|
+
|
|
6
|
+
language.push({
|
|
7
|
+
pattern: /^([\w@:~ ]*?[\$|\#])\s+(.*?)$/m,
|
|
8
|
+
matches: Rule.extractMatches({type: 'prompt'}, {language: 'bash-script'})
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
language.push({
|
|
12
|
+
pattern: /^\-\- .*$/m,
|
|
13
|
+
type: 'comment',
|
|
14
|
+
allow: ['href']
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// Strings
|
|
18
|
+
language.push(Rule.singleQuotedString);
|
|
19
|
+
language.push(Rule.doubleQuotedString);
|
|
20
|
+
language.push(Rule.stringEscape);
|
|
21
|
+
|
|
22
|
+
// URLs
|
|
23
|
+
language.push(Rule.webLink);
|
|
24
|
+
|
|
25
|
+
language.push({
|
|
26
|
+
type: 'stderr',
|
|
27
|
+
allow: ['string', 'comment', 'constant', 'href']
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default function register(syntax) {
|
|
31
|
+
syntax.register('bash', language);
|
|
32
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import {Language} from '../Language.js';
|
|
2
|
+
import {Rule} from '../Rule.js';
|
|
3
|
+
const vbStyleComment = {
|
|
4
|
+
pattern: /' .*$/m,
|
|
5
|
+
type: 'comment',
|
|
6
|
+
allow: ['href']
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const language = new Language('basic');
|
|
10
|
+
|
|
11
|
+
var keywords = [
|
|
12
|
+
'AddHandler',
|
|
13
|
+
'AddressOf',
|
|
14
|
+
'Alias',
|
|
15
|
+
'And',
|
|
16
|
+
'AndAlso',
|
|
17
|
+
'Ansi',
|
|
18
|
+
'As',
|
|
19
|
+
'Assembly',
|
|
20
|
+
'Auto',
|
|
21
|
+
'ByRef',
|
|
22
|
+
'ByVal',
|
|
23
|
+
'Call',
|
|
24
|
+
'Case',
|
|
25
|
+
'Catch',
|
|
26
|
+
'Declare',
|
|
27
|
+
'Default',
|
|
28
|
+
'Delegate',
|
|
29
|
+
'Dim',
|
|
30
|
+
'DirectCast',
|
|
31
|
+
'Do',
|
|
32
|
+
'Each',
|
|
33
|
+
'Else',
|
|
34
|
+
'ElseIf',
|
|
35
|
+
'End',
|
|
36
|
+
'Enum',
|
|
37
|
+
'Erase',
|
|
38
|
+
'Error',
|
|
39
|
+
'Event',
|
|
40
|
+
'Exit',
|
|
41
|
+
'Finally',
|
|
42
|
+
'For',
|
|
43
|
+
'Function',
|
|
44
|
+
'Get',
|
|
45
|
+
'GetType',
|
|
46
|
+
'GoSub',
|
|
47
|
+
'GoTo',
|
|
48
|
+
'Handles',
|
|
49
|
+
'If',
|
|
50
|
+
'Implements',
|
|
51
|
+
'Imports',
|
|
52
|
+
'In',
|
|
53
|
+
'Inherits',
|
|
54
|
+
'Interface',
|
|
55
|
+
'Is',
|
|
56
|
+
'Let',
|
|
57
|
+
'Lib',
|
|
58
|
+
'Like',
|
|
59
|
+
'Loop',
|
|
60
|
+
'Mod',
|
|
61
|
+
'Module',
|
|
62
|
+
'MustOverride',
|
|
63
|
+
'Namespace',
|
|
64
|
+
'New',
|
|
65
|
+
'Next',
|
|
66
|
+
'Not',
|
|
67
|
+
'On',
|
|
68
|
+
'Option',
|
|
69
|
+
'Optional',
|
|
70
|
+
'Or',
|
|
71
|
+
'OrElse',
|
|
72
|
+
'Overloads',
|
|
73
|
+
'Overridable',
|
|
74
|
+
'Overrides',
|
|
75
|
+
'ParamArray',
|
|
76
|
+
'Preserve',
|
|
77
|
+
'Property',
|
|
78
|
+
'RaiseEvent',
|
|
79
|
+
'ReadOnly',
|
|
80
|
+
'ReDim',
|
|
81
|
+
'REM',
|
|
82
|
+
'RemoveHandler',
|
|
83
|
+
'Resume',
|
|
84
|
+
'Return',
|
|
85
|
+
'Select',
|
|
86
|
+
'Set',
|
|
87
|
+
'Static',
|
|
88
|
+
'Step',
|
|
89
|
+
'Stop',
|
|
90
|
+
'Structure',
|
|
91
|
+
'Sub',
|
|
92
|
+
'SyncLock',
|
|
93
|
+
'Then',
|
|
94
|
+
'Throw',
|
|
95
|
+
'To',
|
|
96
|
+
'Try',
|
|
97
|
+
'TypeOf',
|
|
98
|
+
'Unicode',
|
|
99
|
+
'Until',
|
|
100
|
+
'When',
|
|
101
|
+
'While',
|
|
102
|
+
'With',
|
|
103
|
+
'WithEvents',
|
|
104
|
+
'WriteOnly',
|
|
105
|
+
'Xor',
|
|
106
|
+
'ExternalSource',
|
|
107
|
+
'Region',
|
|
108
|
+
'Print',
|
|
109
|
+
'Class'
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
var types = [
|
|
113
|
+
'CBool',
|
|
114
|
+
'CByte',
|
|
115
|
+
'CChar',
|
|
116
|
+
'CDate',
|
|
117
|
+
'CDec',
|
|
118
|
+
'CDbl',
|
|
119
|
+
'Char',
|
|
120
|
+
'CInt',
|
|
121
|
+
'CLng',
|
|
122
|
+
'CObj',
|
|
123
|
+
'Const',
|
|
124
|
+
'CShort',
|
|
125
|
+
'CSng',
|
|
126
|
+
'CStr',
|
|
127
|
+
'CType',
|
|
128
|
+
'Date',
|
|
129
|
+
'Decimal',
|
|
130
|
+
'Variant',
|
|
131
|
+
'String',
|
|
132
|
+
'Short',
|
|
133
|
+
'Long',
|
|
134
|
+
'Single',
|
|
135
|
+
'Double',
|
|
136
|
+
'Object',
|
|
137
|
+
'Integer',
|
|
138
|
+
'Boolean',
|
|
139
|
+
'Byte',
|
|
140
|
+
'Char'
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
var operators = [
|
|
144
|
+
'+',
|
|
145
|
+
'-',
|
|
146
|
+
'*',
|
|
147
|
+
'/',
|
|
148
|
+
'+=',
|
|
149
|
+
'-=',
|
|
150
|
+
'*=',
|
|
151
|
+
'/=',
|
|
152
|
+
'=',
|
|
153
|
+
':=',
|
|
154
|
+
'==',
|
|
155
|
+
'!=',
|
|
156
|
+
'!',
|
|
157
|
+
'%',
|
|
158
|
+
'?',
|
|
159
|
+
'>',
|
|
160
|
+
'<',
|
|
161
|
+
'>=',
|
|
162
|
+
'<=',
|
|
163
|
+
'&&',
|
|
164
|
+
'||',
|
|
165
|
+
'&',
|
|
166
|
+
'|',
|
|
167
|
+
'^',
|
|
168
|
+
'.',
|
|
169
|
+
'~',
|
|
170
|
+
'..',
|
|
171
|
+
'>>',
|
|
172
|
+
'<<',
|
|
173
|
+
'>>>',
|
|
174
|
+
'<<<',
|
|
175
|
+
'>>=',
|
|
176
|
+
'<<=',
|
|
177
|
+
'>>>=',
|
|
178
|
+
'<<<=',
|
|
179
|
+
'%=',
|
|
180
|
+
'^=',
|
|
181
|
+
'&=',
|
|
182
|
+
'\\',
|
|
183
|
+
'\\=',
|
|
184
|
+
'@'
|
|
185
|
+
];
|
|
186
|
+
|
|
187
|
+
var values = [
|
|
188
|
+
'Me',
|
|
189
|
+
'MyClass',
|
|
190
|
+
'MyBase',
|
|
191
|
+
'super',
|
|
192
|
+
'True',
|
|
193
|
+
'False',
|
|
194
|
+
'Nothing',
|
|
195
|
+
/[A-Z][A-Z0-9_]+/
|
|
196
|
+
];
|
|
197
|
+
|
|
198
|
+
var access = [
|
|
199
|
+
'Public',
|
|
200
|
+
'Protected',
|
|
201
|
+
'Private',
|
|
202
|
+
'Shared',
|
|
203
|
+
'Friend',
|
|
204
|
+
'Shadows',
|
|
205
|
+
'MustInherit',
|
|
206
|
+
'NotInheritable',
|
|
207
|
+
'NotOverridable'
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
language.push(types, {type: 'type'});
|
|
211
|
+
language.push(keywords, {type: 'keyword', options: 'gi'});
|
|
212
|
+
language.push(operators, {type: 'operator'});
|
|
213
|
+
language.push(access, {type: 'access'});
|
|
214
|
+
language.push(values, {type: 'constant'});
|
|
215
|
+
|
|
216
|
+
language.push(Rule.decimalNumber);
|
|
217
|
+
|
|
218
|
+
// ClassNames (CamelCase)
|
|
219
|
+
language.push(Rule.camelCaseType);
|
|
220
|
+
|
|
221
|
+
language.push(vbStyleComment);
|
|
222
|
+
|
|
223
|
+
language.push(Rule.webLink);
|
|
224
|
+
|
|
225
|
+
// Strings
|
|
226
|
+
language.push(Rule.doubleQuotedString);
|
|
227
|
+
language.push(Rule.stringEscape);
|
|
228
|
+
|
|
229
|
+
export default function register(syntax) {
|
|
230
|
+
syntax.register('basic', language);
|
|
231
|
+
syntax.alias('basic', ['vb']);
|
|
232
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './clang.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './clang.js';
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import {Language} from '../Language.js';
|
|
2
|
+
import {Rule} from '../Rule.js';
|
|
3
|
+
|
|
4
|
+
const language = new Language('clang');
|
|
5
|
+
|
|
6
|
+
var keywords = [
|
|
7
|
+
'@interface',
|
|
8
|
+
'@implementation',
|
|
9
|
+
'@protocol',
|
|
10
|
+
'@end',
|
|
11
|
+
'@try',
|
|
12
|
+
'@throw',
|
|
13
|
+
'@catch',
|
|
14
|
+
'@finally',
|
|
15
|
+
'@class',
|
|
16
|
+
'@selector',
|
|
17
|
+
'@encode',
|
|
18
|
+
'@synchronized',
|
|
19
|
+
'@property',
|
|
20
|
+
'@synthesize',
|
|
21
|
+
'@dynamic',
|
|
22
|
+
'struct',
|
|
23
|
+
'break',
|
|
24
|
+
'continue',
|
|
25
|
+
'else',
|
|
26
|
+
'for',
|
|
27
|
+
'switch',
|
|
28
|
+
'case',
|
|
29
|
+
'default',
|
|
30
|
+
'enum',
|
|
31
|
+
'goto',
|
|
32
|
+
'register',
|
|
33
|
+
'sizeof',
|
|
34
|
+
'typedef',
|
|
35
|
+
'volatile',
|
|
36
|
+
'do',
|
|
37
|
+
'extern',
|
|
38
|
+
'if',
|
|
39
|
+
'return',
|
|
40
|
+
'static',
|
|
41
|
+
'union',
|
|
42
|
+
'while',
|
|
43
|
+
'asm',
|
|
44
|
+
'dynamic_cast',
|
|
45
|
+
'namespace',
|
|
46
|
+
'reinterpret_cast',
|
|
47
|
+
'try',
|
|
48
|
+
'explicit',
|
|
49
|
+
'static_cast',
|
|
50
|
+
'typeid',
|
|
51
|
+
'catch',
|
|
52
|
+
'operator',
|
|
53
|
+
'template',
|
|
54
|
+
'class',
|
|
55
|
+
'const_cast',
|
|
56
|
+
'inline',
|
|
57
|
+
'throw',
|
|
58
|
+
'virtual',
|
|
59
|
+
'IBOutlet'
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
var access = [
|
|
63
|
+
'@private',
|
|
64
|
+
'@protected',
|
|
65
|
+
'@public',
|
|
66
|
+
'@required',
|
|
67
|
+
'@optional',
|
|
68
|
+
'private',
|
|
69
|
+
'protected',
|
|
70
|
+
'public',
|
|
71
|
+
'friend',
|
|
72
|
+
'using'
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
var typeModifiers = [
|
|
76
|
+
'mutable',
|
|
77
|
+
'auto',
|
|
78
|
+
'const',
|
|
79
|
+
'register',
|
|
80
|
+
'typename',
|
|
81
|
+
'abstract'
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
var types = [
|
|
85
|
+
'double',
|
|
86
|
+
'float',
|
|
87
|
+
'int',
|
|
88
|
+
'short',
|
|
89
|
+
'char',
|
|
90
|
+
'long',
|
|
91
|
+
'signed',
|
|
92
|
+
'unsigned',
|
|
93
|
+
'bool',
|
|
94
|
+
'void',
|
|
95
|
+
'id'
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
var operators = [
|
|
99
|
+
'+',
|
|
100
|
+
'*',
|
|
101
|
+
'/',
|
|
102
|
+
'-',
|
|
103
|
+
'&',
|
|
104
|
+
'|',
|
|
105
|
+
'~',
|
|
106
|
+
'!',
|
|
107
|
+
'%',
|
|
108
|
+
'<',
|
|
109
|
+
'=',
|
|
110
|
+
'>',
|
|
111
|
+
'[',
|
|
112
|
+
']',
|
|
113
|
+
'new',
|
|
114
|
+
'delete',
|
|
115
|
+
'in'
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
var values = ['this', 'true', 'false', 'NULL', 'YES', 'NO', 'nil'];
|
|
119
|
+
|
|
120
|
+
language.push(values, {type: 'constant'});
|
|
121
|
+
language.push(typeModifiers, {type: 'keyword'});
|
|
122
|
+
language.push(types, {type: 'type'});
|
|
123
|
+
language.push(keywords, {type: 'keyword'});
|
|
124
|
+
language.push(operators, {type: 'operator'});
|
|
125
|
+
language.push(access, {type: 'access'});
|
|
126
|
+
|
|
127
|
+
// Objective-C properties
|
|
128
|
+
language.push({
|
|
129
|
+
pattern: /@property\((.*)\)[^;]+;/im,
|
|
130
|
+
type: 'objective-c-property',
|
|
131
|
+
allow: '*'
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
var propertyAttributes = [
|
|
135
|
+
'getter',
|
|
136
|
+
'setter',
|
|
137
|
+
'readwrite',
|
|
138
|
+
'readonly',
|
|
139
|
+
'assign',
|
|
140
|
+
'retain',
|
|
141
|
+
'copy',
|
|
142
|
+
'nonatomic'
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
language.push(propertyAttributes, {
|
|
146
|
+
type: 'keyword',
|
|
147
|
+
only: ['objective-c-property']
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// Objective-C strings
|
|
151
|
+
language.push({
|
|
152
|
+
pattern: /@(?=")/,
|
|
153
|
+
type: 'string'
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// Objective-C classes, C++ classes, C types, etc.
|
|
157
|
+
language.push(Rule.camelCaseType);
|
|
158
|
+
language.push(Rule.cStyleType);
|
|
159
|
+
language.push({
|
|
160
|
+
pattern: /(?:class|struct|enum|namespace)\s+([^{;\s]+)/im,
|
|
161
|
+
matches: Rule.extractMatches({type: 'type'})
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
language.push({
|
|
165
|
+
pattern: /#.*$/im,
|
|
166
|
+
type: 'preprocessor',
|
|
167
|
+
allow: ['string']
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
language.push(Rule.cStyleComment);
|
|
171
|
+
language.push(Rule.cppStyleComment);
|
|
172
|
+
language.push(Rule.webLink);
|
|
173
|
+
|
|
174
|
+
// Objective-C style functions
|
|
175
|
+
language.push({pattern: /\w+:(?=.*(\]|;|\{))(?!:)/, type: 'function'});
|
|
176
|
+
|
|
177
|
+
language.push({
|
|
178
|
+
pattern: /[^:\[]\s+(\w+)(?=\])/,
|
|
179
|
+
matches: Rule.extractMatches({type: 'function'})
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
language.push({
|
|
183
|
+
pattern: /-\s*(\([^\)]+?\))?\s*(\w+)\s*\{/,
|
|
184
|
+
matches: Rule.extractMatches({index: 2, type: 'function'})
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Strings
|
|
188
|
+
language.push(Rule.singleQuotedString);
|
|
189
|
+
language.push(Rule.doubleQuotedString);
|
|
190
|
+
language.push(Rule.stringEscape);
|
|
191
|
+
|
|
192
|
+
// Numbers
|
|
193
|
+
language.push(Rule.decimalNumber);
|
|
194
|
+
language.push(Rule.hexNumber);
|
|
195
|
+
|
|
196
|
+
language.push(Rule.cStyleFunction);
|
|
197
|
+
|
|
198
|
+
export default function register(syntax) {
|
|
199
|
+
syntax.register('clang', language);
|
|
200
|
+
syntax.alias('clang', ['cpp', 'c++', 'c', 'objective-c']);
|
|
201
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './clang.js';
|