IncludeCPP 3.7.25__py3-none-any.whl → 3.8.8__py3-none-any.whl
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.
- includecpp/__init__.py +1 -1
- includecpp/cli/commands.py +26 -6
- includecpp/core/cssl/CSSL_DOCUMENTATION.md +312 -1
- includecpp/core/cssl/cssl_builtins.py +343 -0
- includecpp/core/cssl/cssl_parser.py +422 -9
- includecpp/core/cssl/cssl_runtime.py +496 -17
- includecpp/core/cssl/cssl_types.py +58 -9
- includecpp/vscode/cssl/extension.js +5 -5
- includecpp/vscode/cssl/package.json +1 -1
- includecpp/vscode/cssl/snippets/cssl.snippets.json +126 -0
- includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json +232 -2
- {includecpp-3.7.25.dist-info → includecpp-3.8.8.dist-info}/METADATA +55 -224
- {includecpp-3.7.25.dist-info → includecpp-3.8.8.dist-info}/RECORD +17 -17
- {includecpp-3.7.25.dist-info → includecpp-3.8.8.dist-info}/WHEEL +0 -0
- {includecpp-3.7.25.dist-info → includecpp-3.8.8.dist-info}/entry_points.txt +0 -0
- {includecpp-3.7.25.dist-info → includecpp-3.8.8.dist-info}/licenses/LICENSE +0 -0
- {includecpp-3.7.25.dist-info → includecpp-3.8.8.dist-info}/top_level.txt +0 -0
|
@@ -1448,17 +1448,62 @@ class CSSLClass:
|
|
|
1448
1448
|
|
|
1449
1449
|
Stores class name, member variables, methods, and constructor.
|
|
1450
1450
|
Used by the runtime to instantiate CSSLInstance objects.
|
|
1451
|
+
Supports inheritance via the 'parent' attribute.
|
|
1451
1452
|
"""
|
|
1452
1453
|
|
|
1453
1454
|
def __init__(self, name: str, members: Dict[str, Any] = None,
|
|
1454
|
-
methods: Dict[str, Any] = None, constructor: Any = None
|
|
1455
|
+
methods: Dict[str, Any] = None, constructor: Any = None,
|
|
1456
|
+
parent: Any = None):
|
|
1455
1457
|
self.name = name
|
|
1456
1458
|
self.members = members or {} # Default member values/types
|
|
1457
1459
|
self.methods = methods or {} # Method AST nodes
|
|
1458
1460
|
self.constructor = constructor # Constructor AST node
|
|
1461
|
+
self.parent = parent # Parent class (CSSLClass or CSSLizedPythonObject)
|
|
1462
|
+
|
|
1463
|
+
def get_all_members(self) -> Dict[str, Any]:
|
|
1464
|
+
"""Get all members including inherited ones."""
|
|
1465
|
+
all_members = {}
|
|
1466
|
+
# First add parent members (can be overridden)
|
|
1467
|
+
if self.parent:
|
|
1468
|
+
if hasattr(self.parent, 'get_all_members'):
|
|
1469
|
+
all_members.update(self.parent.get_all_members())
|
|
1470
|
+
elif hasattr(self.parent, 'members'):
|
|
1471
|
+
all_members.update(self.parent.members)
|
|
1472
|
+
elif hasattr(self.parent, '_python_obj'):
|
|
1473
|
+
# CSSLizedPythonObject - get attributes from Python object
|
|
1474
|
+
py_obj = self.parent._python_obj
|
|
1475
|
+
if hasattr(py_obj, '__dict__'):
|
|
1476
|
+
for key, val in py_obj.__dict__.items():
|
|
1477
|
+
if not key.startswith('_'):
|
|
1478
|
+
all_members[key] = {'type': 'dynamic', 'default': val}
|
|
1479
|
+
# Then add own members (override parent)
|
|
1480
|
+
all_members.update(self.members)
|
|
1481
|
+
return all_members
|
|
1482
|
+
|
|
1483
|
+
def get_all_methods(self) -> Dict[str, Any]:
|
|
1484
|
+
"""Get all methods including inherited ones."""
|
|
1485
|
+
all_methods = {}
|
|
1486
|
+
# First add parent methods (can be overridden)
|
|
1487
|
+
if self.parent:
|
|
1488
|
+
if hasattr(self.parent, 'get_all_methods'):
|
|
1489
|
+
all_methods.update(self.parent.get_all_methods())
|
|
1490
|
+
elif hasattr(self.parent, 'methods'):
|
|
1491
|
+
all_methods.update(self.parent.methods)
|
|
1492
|
+
elif hasattr(self.parent, '_python_obj'):
|
|
1493
|
+
# CSSLizedPythonObject - get methods from Python object
|
|
1494
|
+
py_obj = self.parent._python_obj
|
|
1495
|
+
for name in dir(py_obj):
|
|
1496
|
+
if not name.startswith('_'):
|
|
1497
|
+
attr = getattr(py_obj, name, None)
|
|
1498
|
+
if callable(attr):
|
|
1499
|
+
all_methods[name] = ('python_method', attr)
|
|
1500
|
+
# Then add own methods (override parent)
|
|
1501
|
+
all_methods.update(self.methods)
|
|
1502
|
+
return all_methods
|
|
1459
1503
|
|
|
1460
1504
|
def __repr__(self):
|
|
1461
|
-
|
|
1505
|
+
parent_info = f" extends {self.parent.name}" if self.parent and hasattr(self.parent, 'name') else ""
|
|
1506
|
+
return f"<CSSLClass '{self.name}'{parent_info} with {len(self.methods)} methods>"
|
|
1462
1507
|
|
|
1463
1508
|
|
|
1464
1509
|
class CSSLInstance:
|
|
@@ -1471,8 +1516,9 @@ class CSSLInstance:
|
|
|
1471
1516
|
def __init__(self, class_def: CSSLClass):
|
|
1472
1517
|
self._class = class_def
|
|
1473
1518
|
self._members: Dict[str, Any] = {}
|
|
1474
|
-
# Initialize members with defaults from class definition
|
|
1475
|
-
|
|
1519
|
+
# Initialize members with defaults from class definition (including inherited)
|
|
1520
|
+
all_members = class_def.get_all_members() if hasattr(class_def, 'get_all_members') else class_def.members
|
|
1521
|
+
for name, default in all_members.items():
|
|
1476
1522
|
if isinstance(default, dict):
|
|
1477
1523
|
# Type declaration with optional default
|
|
1478
1524
|
member_type = default.get('type')
|
|
@@ -1541,14 +1587,17 @@ class CSSLInstance:
|
|
|
1541
1587
|
return name in self._members
|
|
1542
1588
|
|
|
1543
1589
|
def get_method(self, name: str) -> Any:
|
|
1544
|
-
"""Get method AST node by name"""
|
|
1545
|
-
|
|
1546
|
-
|
|
1590
|
+
"""Get method AST node by name (including inherited methods)"""
|
|
1591
|
+
# Use get_all_methods to include inherited methods
|
|
1592
|
+
all_methods = self._class.get_all_methods() if hasattr(self._class, 'get_all_methods') else self._class.methods
|
|
1593
|
+
if name in all_methods:
|
|
1594
|
+
return all_methods[name]
|
|
1547
1595
|
raise AttributeError(f"'{self._class.name}' has no method '{name}'")
|
|
1548
1596
|
|
|
1549
1597
|
def has_method(self, name: str) -> bool:
|
|
1550
|
-
"""Check if method exists"""
|
|
1551
|
-
|
|
1598
|
+
"""Check if method exists (including inherited methods)"""
|
|
1599
|
+
all_methods = self._class.get_all_methods() if hasattr(self._class, 'get_all_methods') else self._class.methods
|
|
1600
|
+
return name in all_methods
|
|
1552
1601
|
|
|
1553
1602
|
def __getattr__(self, name: str) -> Any:
|
|
1554
1603
|
"""Allow direct attribute access for members"""
|
|
@@ -53,23 +53,23 @@ function activate(context) {
|
|
|
53
53
|
// Run the CSSL file using includecpp cssl run
|
|
54
54
|
const args = ['-m', 'includecpp', 'cssl', 'run', filePath];
|
|
55
55
|
|
|
56
|
-
const
|
|
56
|
+
const childProcess = spawn(pythonPath, args, {
|
|
57
57
|
cwd: path.dirname(filePath),
|
|
58
58
|
env: { ...process.env }
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
let hasError = false;
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
childProcess.stdout.on('data', (data) => {
|
|
64
64
|
outputChannel.append(data.toString());
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
childProcess.stderr.on('data', (data) => {
|
|
68
68
|
hasError = true;
|
|
69
69
|
outputChannel.append(data.toString());
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
childProcess.on('close', (code) => {
|
|
73
73
|
outputChannel.appendLine('');
|
|
74
74
|
outputChannel.appendLine('─'.repeat(50));
|
|
75
75
|
if (code === 0) {
|
|
@@ -79,7 +79,7 @@ function activate(context) {
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
childProcess.on('error', (err) => {
|
|
83
83
|
outputChannel.appendLine(`[CSSL] Error: ${err.message}`);
|
|
84
84
|
vscode.window.showErrorMessage(`Failed to run CSSL: ${err.message}. Make sure IncludeCPP is installed (pip install includecpp).`);
|
|
85
85
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "cssl",
|
|
3
3
|
"displayName": "CSSL Language",
|
|
4
4
|
"description": "Professional syntax highlighting, snippets, and language support for CSSL scripts (.cssl, .cssl-pl, .cssl-mod)",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.6.0",
|
|
6
6
|
"publisher": "IncludeCPP",
|
|
7
7
|
"icon": "images/cssl.png",
|
|
8
8
|
"engines": {
|
|
@@ -1076,5 +1076,131 @@
|
|
|
1076
1076
|
"}"
|
|
1077
1077
|
],
|
|
1078
1078
|
"description": "Open parameter function"
|
|
1079
|
+
},
|
|
1080
|
+
"Undefined Function": {
|
|
1081
|
+
"prefix": ["undefined", "undef"],
|
|
1082
|
+
"body": [
|
|
1083
|
+
"undefined ${1:void} ${2:FuncName}(${3:params}) {",
|
|
1084
|
+
"\t$0",
|
|
1085
|
+
"}"
|
|
1086
|
+
],
|
|
1087
|
+
"description": "Function with undefined modifier - suppresses all errors during execution"
|
|
1088
|
+
},
|
|
1089
|
+
"Private Function": {
|
|
1090
|
+
"prefix": "private",
|
|
1091
|
+
"body": [
|
|
1092
|
+
"private ${1:void} ${2:FuncName}(${3:params}) {",
|
|
1093
|
+
"\t$0",
|
|
1094
|
+
"}"
|
|
1095
|
+
],
|
|
1096
|
+
"description": "Private function - disables all external injections"
|
|
1097
|
+
},
|
|
1098
|
+
"Closed Function": {
|
|
1099
|
+
"prefix": "closed",
|
|
1100
|
+
"body": [
|
|
1101
|
+
"closed ${1:void} ${2:FuncName}(${3:params}) {",
|
|
1102
|
+
"\t$0",
|
|
1103
|
+
"}"
|
|
1104
|
+
],
|
|
1105
|
+
"description": "Closed function - protects from external injection modifications"
|
|
1106
|
+
},
|
|
1107
|
+
"Virtual Function": {
|
|
1108
|
+
"prefix": "virtual",
|
|
1109
|
+
"body": [
|
|
1110
|
+
"virtual ${1:void} ${2:FuncName}(${3:params}) {",
|
|
1111
|
+
"\t$0",
|
|
1112
|
+
"}"
|
|
1113
|
+
],
|
|
1114
|
+
"description": "Virtual function - can be overridden in child classes"
|
|
1115
|
+
},
|
|
1116
|
+
"Meta Function": {
|
|
1117
|
+
"prefix": "meta",
|
|
1118
|
+
"body": [
|
|
1119
|
+
"meta ${1:void} ${2:FuncName}(${3:params}) {",
|
|
1120
|
+
"\t$0",
|
|
1121
|
+
"}"
|
|
1122
|
+
],
|
|
1123
|
+
"description": "Meta function - metaprogramming function for code generation"
|
|
1124
|
+
},
|
|
1125
|
+
"Super Function": {
|
|
1126
|
+
"prefix": "super",
|
|
1127
|
+
"body": [
|
|
1128
|
+
"super ${1:void} ${2:FuncName}(${3:params}) {",
|
|
1129
|
+
"\t$0",
|
|
1130
|
+
"}"
|
|
1131
|
+
],
|
|
1132
|
+
"description": "Super function - enhanced privileges for system-level operations"
|
|
1133
|
+
},
|
|
1134
|
+
"SQLBased Function": {
|
|
1135
|
+
"prefix": "sqlbased",
|
|
1136
|
+
"body": [
|
|
1137
|
+
"sqlbased ${1:void} ${2:FuncName}(${3:params}) {",
|
|
1138
|
+
"\t$0",
|
|
1139
|
+
"}"
|
|
1140
|
+
],
|
|
1141
|
+
"description": "SQL-based function - optimized for database operations"
|
|
1142
|
+
},
|
|
1143
|
+
"API Function with Modifiers": {
|
|
1144
|
+
"prefix": ["apifunc", "globalapi"],
|
|
1145
|
+
"body": [
|
|
1146
|
+
"private super virtual meta ${1:GlobalApi}() {",
|
|
1147
|
+
"\tinstance<\"${2:apiName}\"> api;",
|
|
1148
|
+
"\tclass ${3:Api} {",
|
|
1149
|
+
"\t\tdefine ${4:getMethod}() {",
|
|
1150
|
+
"\t\t\t$0",
|
|
1151
|
+
"\t\t}",
|
|
1152
|
+
"\t}",
|
|
1153
|
+
"\t%api +<== new ${3}();",
|
|
1154
|
+
"\treturn %api;",
|
|
1155
|
+
"}"
|
|
1156
|
+
],
|
|
1157
|
+
"description": "Global API function with full modifiers and instance pattern"
|
|
1158
|
+
},
|
|
1159
|
+
"Combined Modifiers Function": {
|
|
1160
|
+
"prefix": "modfunc",
|
|
1161
|
+
"body": [
|
|
1162
|
+
"${1|undefined,private,closed,virtual,meta,super,sqlbased|} ${2|undefined,private,closed,virtual,meta,super,sqlbased,void,int,string|} ${3:FuncName}(${4:params}) {",
|
|
1163
|
+
"\t$0",
|
|
1164
|
+
"}"
|
|
1165
|
+
],
|
|
1166
|
+
"description": "Function with selectable modifier combinations"
|
|
1167
|
+
},
|
|
1168
|
+
"Python Pythonize": {
|
|
1169
|
+
"prefix": ["python::pythonize", "pythonize"],
|
|
1170
|
+
"body": "python::pythonize(${1:instance})$0",
|
|
1171
|
+
"description": "Convert CSSL class instance to Python-usable object"
|
|
1172
|
+
},
|
|
1173
|
+
"Return Pythonized Class": {
|
|
1174
|
+
"prefix": "returnpython",
|
|
1175
|
+
"body": [
|
|
1176
|
+
"${1:instance} = new ${2:ClassName}(${3:args});",
|
|
1177
|
+
"pyobj = python::pythonize(${1});",
|
|
1178
|
+
"parameter.return(pyobj);"
|
|
1179
|
+
],
|
|
1180
|
+
"description": "Create class instance and return as Python object"
|
|
1181
|
+
},
|
|
1182
|
+
"Class with Python Export": {
|
|
1183
|
+
"prefix": "pyclass",
|
|
1184
|
+
"body": [
|
|
1185
|
+
"class ${1:ClassName} {",
|
|
1186
|
+
"\t${2:string} ${3:name};",
|
|
1187
|
+
"",
|
|
1188
|
+
"\t${1}(${4:params}) {",
|
|
1189
|
+
"\t\tthis->${3} = ${5:value};",
|
|
1190
|
+
"\t}",
|
|
1191
|
+
"",
|
|
1192
|
+
"\t${6:string} get${3/(.*)/${1:/capitalize}/}() {",
|
|
1193
|
+
"\t\treturn this->${3};",
|
|
1194
|
+
"\t}",
|
|
1195
|
+
"",
|
|
1196
|
+
"\tvoid set${3/(.*)/${1:/capitalize}/}(${2} newValue) {",
|
|
1197
|
+
"\t\tthis->${3} = newValue;",
|
|
1198
|
+
"\t}",
|
|
1199
|
+
"}",
|
|
1200
|
+
"",
|
|
1201
|
+
"${7:obj} = new ${1}(${8:args});",
|
|
1202
|
+
"parameter.return(python::pythonize(${7}));$0"
|
|
1203
|
+
],
|
|
1204
|
+
"description": "Create a class and export as Python object"
|
|
1079
1205
|
}
|
|
1080
1206
|
}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
{ "include": "#strings" },
|
|
9
9
|
{ "include": "#numbers" },
|
|
10
10
|
{ "include": "#class-definition" },
|
|
11
|
+
{ "include": "#function-definitions" },
|
|
12
|
+
{ "include": "#constructor-definition" },
|
|
13
|
+
{ "include": "#super-call" },
|
|
11
14
|
{ "include": "#sql-types" },
|
|
12
15
|
{ "include": "#keywords" },
|
|
13
16
|
{ "include": "#types" },
|
|
@@ -28,9 +31,63 @@
|
|
|
28
31
|
{ "include": "#builtins" },
|
|
29
32
|
{ "include": "#operators" },
|
|
30
33
|
{ "include": "#constants" },
|
|
34
|
+
{ "include": "#non-null-declarations" },
|
|
31
35
|
{ "include": "#variables" }
|
|
32
36
|
],
|
|
33
37
|
"repository": {
|
|
38
|
+
"non-null-declarations": {
|
|
39
|
+
"patterns": [
|
|
40
|
+
{
|
|
41
|
+
"comment": "Non-null class: class *ClassName - turquoise",
|
|
42
|
+
"name": "meta.class.non-null.cssl",
|
|
43
|
+
"match": "\\b(class)\\s+(\\*)([a-zA-Z_][a-zA-Z0-9_]*)",
|
|
44
|
+
"captures": {
|
|
45
|
+
"1": { "name": "storage.type.class.cssl" },
|
|
46
|
+
"2": { "name": "keyword.operator.non-null.cssl" },
|
|
47
|
+
"3": { "name": "support.class.non-null.cssl" }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"comment": "Non-null function: define *FuncName - light pink",
|
|
52
|
+
"name": "meta.function.non-null.cssl",
|
|
53
|
+
"match": "\\b(define)\\s+(\\*)([a-zA-Z_][a-zA-Z0-9_]*)",
|
|
54
|
+
"captures": {
|
|
55
|
+
"1": { "name": "storage.type.function.cssl" },
|
|
56
|
+
"2": { "name": "keyword.operator.non-null.cssl" },
|
|
57
|
+
"3": { "name": "entity.name.function.non-null.cssl" }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"comment": "Non-null typed variable: type<T> *varName - light pink",
|
|
62
|
+
"name": "meta.declaration.non-null.cssl",
|
|
63
|
+
"match": "\\b(int|string|float|bool|dynamic|vector|stack|array|list|dict|json|datastruct|iterator)\\s*(<[^>]+>)?\\s+(\\*)([a-zA-Z_][a-zA-Z0-9_]*)",
|
|
64
|
+
"captures": {
|
|
65
|
+
"1": { "name": "storage.type.cssl" },
|
|
66
|
+
"2": { "name": "storage.type.generic.cssl" },
|
|
67
|
+
"3": { "name": "keyword.operator.non-null.cssl" },
|
|
68
|
+
"4": { "name": "variable.other.non-null.cssl" }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"comment": "Non-null open parameter: open *Params - light pink",
|
|
73
|
+
"name": "meta.parameter.non-null.cssl",
|
|
74
|
+
"match": "\\b(open)\\s+(\\*)([a-zA-Z_][a-zA-Z0-9_]*)",
|
|
75
|
+
"captures": {
|
|
76
|
+
"1": { "name": "storage.modifier.open.cssl" },
|
|
77
|
+
"2": { "name": "keyword.operator.non-null.cssl" },
|
|
78
|
+
"3": { "name": "variable.parameter.non-null.cssl" }
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"comment": "Return type -> * (non-null return)",
|
|
83
|
+
"name": "meta.return-type.non-null.cssl",
|
|
84
|
+
"match": "->\\s*\\*",
|
|
85
|
+
"captures": {
|
|
86
|
+
"0": { "name": "keyword.operator.non-null.return.cssl" }
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
34
91
|
"super-functions": {
|
|
35
92
|
"patterns": [
|
|
36
93
|
{
|
|
@@ -110,12 +167,74 @@
|
|
|
110
167
|
},
|
|
111
168
|
"class-definition": {
|
|
112
169
|
"patterns": [
|
|
170
|
+
{
|
|
171
|
+
"comment": "Class with extends AND overwrites: class X : extends Y : overwrites Z { }",
|
|
172
|
+
"name": "meta.class.extends-overwrites.cssl",
|
|
173
|
+
"begin": "\\b(class)\\s+(\\*?)([a-zA-Z_][a-zA-Z0-9_]*)\\s*:\\s*(extends)\\s+(\\$?[a-zA-Z_][a-zA-Z0-9_]*)\\s*:\\s*(overwrites)\\s+(\\$?[a-zA-Z_][a-zA-Z0-9_]*)(\\(\\))?\\s*\\{",
|
|
174
|
+
"beginCaptures": {
|
|
175
|
+
"1": { "name": "storage.type.class.cssl" },
|
|
176
|
+
"2": { "name": "keyword.operator.non-null.cssl" },
|
|
177
|
+
"3": { "name": "support.class.cssl" },
|
|
178
|
+
"4": { "name": "storage.modifier.extends.cssl" },
|
|
179
|
+
"5": { "name": "support.class.inherited.cssl" },
|
|
180
|
+
"6": { "name": "storage.modifier.overwrites.cssl" },
|
|
181
|
+
"7": { "name": "support.class.overwritten.cssl" }
|
|
182
|
+
},
|
|
183
|
+
"end": "\\}",
|
|
184
|
+
"patterns": [
|
|
185
|
+
{ "include": "#comments" },
|
|
186
|
+
{ "include": "#constructor-definition" },
|
|
187
|
+
{ "include": "#class-method-definition" },
|
|
188
|
+
{ "include": "#class-member-declaration" },
|
|
189
|
+
{ "include": "#types" },
|
|
190
|
+
{ "include": "#this-access" },
|
|
191
|
+
{ "include": "#captured-references" },
|
|
192
|
+
{ "include": "#global-references" },
|
|
193
|
+
{ "include": "#shared-references" },
|
|
194
|
+
{ "include": "#strings" },
|
|
195
|
+
{ "include": "#numbers" },
|
|
196
|
+
{ "include": "#keywords" },
|
|
197
|
+
{ "include": "#function-calls" },
|
|
198
|
+
{ "include": "#builtins" },
|
|
199
|
+
{ "include": "#operators" }
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"comment": "Class with inheritance: class Child : extends Parent { }",
|
|
204
|
+
"name": "meta.class.extends.cssl",
|
|
205
|
+
"begin": "\\b(class)\\s+(\\*?)([a-zA-Z_][a-zA-Z0-9_]*)\\s*:\\s*(extends)\\s+(\\$?[a-zA-Z_][a-zA-Z0-9_]*)\\s*\\{",
|
|
206
|
+
"beginCaptures": {
|
|
207
|
+
"1": { "name": "storage.type.class.cssl" },
|
|
208
|
+
"2": { "name": "keyword.operator.non-null.cssl" },
|
|
209
|
+
"3": { "name": "support.class.cssl" },
|
|
210
|
+
"4": { "name": "storage.modifier.extends.cssl" },
|
|
211
|
+
"5": { "name": "support.class.inherited.cssl" }
|
|
212
|
+
},
|
|
213
|
+
"end": "\\}",
|
|
214
|
+
"patterns": [
|
|
215
|
+
{ "include": "#comments" },
|
|
216
|
+
{ "include": "#constructor-definition" },
|
|
217
|
+
{ "include": "#class-method-definition" },
|
|
218
|
+
{ "include": "#class-member-declaration" },
|
|
219
|
+
{ "include": "#types" },
|
|
220
|
+
{ "include": "#this-access" },
|
|
221
|
+
{ "include": "#captured-references" },
|
|
222
|
+
{ "include": "#global-references" },
|
|
223
|
+
{ "include": "#shared-references" },
|
|
224
|
+
{ "include": "#strings" },
|
|
225
|
+
{ "include": "#numbers" },
|
|
226
|
+
{ "include": "#keywords" },
|
|
227
|
+
{ "include": "#function-calls" },
|
|
228
|
+
{ "include": "#builtins" },
|
|
229
|
+
{ "include": "#operators" }
|
|
230
|
+
]
|
|
231
|
+
},
|
|
113
232
|
{
|
|
114
233
|
"name": "meta.class.cssl",
|
|
115
234
|
"begin": "\\b(class)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\{",
|
|
116
235
|
"beginCaptures": {
|
|
117
236
|
"1": { "name": "storage.type.class.cssl" },
|
|
118
|
-
"2": { "name": "
|
|
237
|
+
"2": { "name": "support.class.cssl" }
|
|
119
238
|
},
|
|
120
239
|
"end": "\\}",
|
|
121
240
|
"patterns": [
|
|
@@ -140,6 +259,28 @@
|
|
|
140
259
|
},
|
|
141
260
|
"constructor-definition": {
|
|
142
261
|
"patterns": [
|
|
262
|
+
{
|
|
263
|
+
"comment": "New-style constructor with constr keyword and extends: constr Name() :: extends Parent::Name { }",
|
|
264
|
+
"name": "meta.constructor.constr.extends.cssl",
|
|
265
|
+
"match": "\\b(constr)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\([^)]*\\)\\s*(::)?\\s*(extends)\\s+(\\$?[a-zA-Z_][a-zA-Z0-9_]*)(::[a-zA-Z_][a-zA-Z0-9_]*)?",
|
|
266
|
+
"captures": {
|
|
267
|
+
"1": { "name": "storage.type.constructor.cssl" },
|
|
268
|
+
"2": { "name": "entity.name.function.constructor.cssl" },
|
|
269
|
+
"3": { "name": "punctuation.accessor.double-colon.cssl" },
|
|
270
|
+
"4": { "name": "storage.modifier.extends.cssl" },
|
|
271
|
+
"5": { "name": "entity.other.inherited-class.cssl" },
|
|
272
|
+
"6": { "name": "entity.name.function.inherited.cssl" }
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"comment": "New-style constructor with constr keyword: constr ConstructorName() { }",
|
|
277
|
+
"name": "meta.constructor.constr.cssl",
|
|
278
|
+
"match": "\\b(constr)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(",
|
|
279
|
+
"captures": {
|
|
280
|
+
"1": { "name": "storage.type.constructor.cssl" },
|
|
281
|
+
"2": { "name": "entity.name.function.constructor.cssl" }
|
|
282
|
+
}
|
|
283
|
+
},
|
|
143
284
|
{
|
|
144
285
|
"comment": "Constructor: ClassName { ... } or void ClassName(...)",
|
|
145
286
|
"name": "meta.constructor.cssl",
|
|
@@ -151,6 +292,28 @@
|
|
|
151
292
|
}
|
|
152
293
|
]
|
|
153
294
|
},
|
|
295
|
+
"super-call": {
|
|
296
|
+
"patterns": [
|
|
297
|
+
{
|
|
298
|
+
"comment": "super::method() - call parent method",
|
|
299
|
+
"name": "meta.super-call.method.cssl",
|
|
300
|
+
"match": "\\b(super)(::)([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(",
|
|
301
|
+
"captures": {
|
|
302
|
+
"1": { "name": "keyword.other.super.cssl" },
|
|
303
|
+
"2": { "name": "punctuation.accessor.double-colon.cssl" },
|
|
304
|
+
"3": { "name": "entity.name.function.parent.cssl" }
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"comment": "super() - call parent constructor",
|
|
309
|
+
"name": "meta.super-call.constructor.cssl",
|
|
310
|
+
"match": "\\b(super)\\s*\\(",
|
|
311
|
+
"captures": {
|
|
312
|
+
"1": { "name": "keyword.other.super.cssl" }
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
},
|
|
154
317
|
"class-method-definition": {
|
|
155
318
|
"patterns": [
|
|
156
319
|
{
|
|
@@ -209,6 +372,19 @@
|
|
|
209
372
|
"name": "storage.type.class.cssl",
|
|
210
373
|
"match": "\\b(class|struct|structure|enum|interface)\\b"
|
|
211
374
|
},
|
|
375
|
+
{
|
|
376
|
+
"name": "storage.modifier.extends.cssl",
|
|
377
|
+
"match": "\\b(extends|overwrites)\\b"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"comment": "new ClassName() - class instantiation with turquoise class name",
|
|
381
|
+
"name": "meta.new-expression.cssl",
|
|
382
|
+
"match": "\\b(new)\\s+([A-Z][a-zA-Z0-9_]*)\\s*\\(",
|
|
383
|
+
"captures": {
|
|
384
|
+
"1": { "name": "keyword.operator.new.cssl" },
|
|
385
|
+
"2": { "name": "support.class.cssl" }
|
|
386
|
+
}
|
|
387
|
+
},
|
|
212
388
|
{
|
|
213
389
|
"name": "keyword.operator.new.cssl",
|
|
214
390
|
"match": "\\bnew\\b"
|
|
@@ -219,7 +395,11 @@
|
|
|
219
395
|
},
|
|
220
396
|
{
|
|
221
397
|
"name": "storage.type.function.cssl",
|
|
222
|
-
"match": "\\b(define|void|shuffled)\\b"
|
|
398
|
+
"match": "\\b(define|void|shuffled|constr)\\b"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"name": "keyword.other.super.cssl",
|
|
402
|
+
"match": "\\bsuper\\b"
|
|
223
403
|
},
|
|
224
404
|
{
|
|
225
405
|
"name": "keyword.other.cssl",
|
|
@@ -319,6 +499,14 @@
|
|
|
319
499
|
{
|
|
320
500
|
"name": "support.function.namespace.combo.cssl",
|
|
321
501
|
"match": "\\bcombo::(filterdb|blocked|like)\\b"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"name": "support.function.namespace.python.cssl",
|
|
505
|
+
"match": "\\bpython::(pythonize|wrap|export|csslize|import)\\b"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"name": "support.function.namespace.filter.cssl",
|
|
509
|
+
"match": "\\bfilter::(register|unregister|list|exists)\\b"
|
|
322
510
|
}
|
|
323
511
|
]
|
|
324
512
|
},
|
|
@@ -453,6 +641,48 @@
|
|
|
453
641
|
}
|
|
454
642
|
]
|
|
455
643
|
},
|
|
644
|
+
"function-definitions": {
|
|
645
|
+
"patterns": [
|
|
646
|
+
{
|
|
647
|
+
"comment": "Function with extends AND overwrites: define func : extends X : overwrites Y() { }",
|
|
648
|
+
"name": "meta.function.extends-overwrites.cssl",
|
|
649
|
+
"match": "\\b(define)\\s+(\\*?)([a-zA-Z_][a-zA-Z0-9_]*)\\s*:\\s*(extends)\\s+(\\$?[a-zA-Z_][a-zA-Z0-9_]*)(\\(\\))?\\s*:\\s*(overwrites)\\s+(\\$?[a-zA-Z_][a-zA-Z0-9_]*)(\\(\\))?",
|
|
650
|
+
"captures": {
|
|
651
|
+
"1": { "name": "storage.type.function.cssl" },
|
|
652
|
+
"2": { "name": "keyword.operator.non-null.cssl" },
|
|
653
|
+
"3": { "name": "entity.name.function.cssl" },
|
|
654
|
+
"4": { "name": "storage.modifier.extends.cssl" },
|
|
655
|
+
"5": { "name": "entity.other.inherited-function.cssl" },
|
|
656
|
+
"7": { "name": "storage.modifier.overwrites.cssl" },
|
|
657
|
+
"8": { "name": "entity.other.overwritten-function.cssl" }
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"comment": "Function with extends: define func : extends otherFunc() { }",
|
|
662
|
+
"name": "meta.function.extends.cssl",
|
|
663
|
+
"match": "\\b(define)\\s+(\\*?)([a-zA-Z_][a-zA-Z0-9_]*)\\s*:\\s*(extends)\\s+(\\$?[a-zA-Z_][a-zA-Z0-9_]*)(\\(\\))?",
|
|
664
|
+
"captures": {
|
|
665
|
+
"1": { "name": "storage.type.function.cssl" },
|
|
666
|
+
"2": { "name": "keyword.operator.non-null.cssl" },
|
|
667
|
+
"3": { "name": "entity.name.function.cssl" },
|
|
668
|
+
"4": { "name": "storage.modifier.extends.cssl" },
|
|
669
|
+
"5": { "name": "entity.other.inherited-function.cssl" }
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"comment": "Function with overwrites: define func : overwrites target() { }",
|
|
674
|
+
"name": "meta.function.overwrites.cssl",
|
|
675
|
+
"match": "\\b(define)\\s+(\\*?)([a-zA-Z_][a-zA-Z0-9_]*)\\s*:\\s*(overwrites)\\s+(\\$?[a-zA-Z_][a-zA-Z0-9_]*)(\\(\\))?",
|
|
676
|
+
"captures": {
|
|
677
|
+
"1": { "name": "storage.type.function.cssl" },
|
|
678
|
+
"2": { "name": "keyword.operator.non-null.cssl" },
|
|
679
|
+
"3": { "name": "entity.name.function.cssl" },
|
|
680
|
+
"4": { "name": "storage.modifier.overwrites.cssl" },
|
|
681
|
+
"5": { "name": "entity.other.overwritten-function.cssl" }
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
]
|
|
685
|
+
},
|
|
456
686
|
"function-calls": {
|
|
457
687
|
"patterns": [
|
|
458
688
|
{
|