IncludeCPP 3.7.1__py3-none-any.whl → 3.7.25__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/__init__.pyi +2 -2
- includecpp/cli/commands.py +278 -75
- includecpp/core/cssl/CSSL_DOCUMENTATION.md +27 -8
- includecpp/core/cssl/__init__.py +7 -2
- includecpp/core/cssl/cssl_builtins.py +201 -9
- includecpp/core/cssl/cssl_builtins.pyi +3682 -401
- includecpp/core/cssl/cssl_parser.py +291 -40
- includecpp/core/cssl/cssl_runtime.py +629 -40
- includecpp/core/cssl/cssl_syntax.py +7 -7
- includecpp/core/cssl/cssl_types.py +75 -2
- includecpp/core/cssl_bridge.py +540 -53
- includecpp/vscode/cssl/extension.js +133 -0
- includecpp/vscode/cssl/images/cssl.png +0 -0
- includecpp/vscode/cssl/images/cssl_pl.png +0 -0
- includecpp/vscode/cssl/language-configuration.json +1 -4
- includecpp/vscode/cssl/package.json +117 -11
- includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json +213 -29
- {includecpp-3.7.1.dist-info → includecpp-3.7.25.dist-info}/METADATA +2 -2
- {includecpp-3.7.1.dist-info → includecpp-3.7.25.dist-info}/RECORD +24 -21
- {includecpp-3.7.1.dist-info → includecpp-3.7.25.dist-info}/WHEEL +0 -0
- {includecpp-3.7.1.dist-info → includecpp-3.7.25.dist-info}/entry_points.txt +0 -0
- {includecpp-3.7.1.dist-info → includecpp-3.7.25.dist-info}/licenses/LICENSE +0 -0
- {includecpp-3.7.1.dist-info → includecpp-3.7.25.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// CSSL Language Extension for VS Code
|
|
2
|
+
// Provides run functionality for .cssl files
|
|
3
|
+
|
|
4
|
+
const vscode = require('vscode');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const { spawn } = require('child_process');
|
|
7
|
+
|
|
8
|
+
let outputChannel;
|
|
9
|
+
|
|
10
|
+
function activate(context) {
|
|
11
|
+
// Create output channel for CSSL
|
|
12
|
+
outputChannel = vscode.window.createOutputChannel('CSSL');
|
|
13
|
+
|
|
14
|
+
// Register the run command
|
|
15
|
+
const runCommand = vscode.commands.registerCommand('cssl.runFile', async () => {
|
|
16
|
+
const editor = vscode.window.activeTextEditor;
|
|
17
|
+
|
|
18
|
+
if (!editor) {
|
|
19
|
+
vscode.window.showErrorMessage('No active editor found');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const document = editor.document;
|
|
24
|
+
const filePath = document.fileName;
|
|
25
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
26
|
+
|
|
27
|
+
// Only allow .cssl files (not .cssl-mod or .cssl-pl)
|
|
28
|
+
if (ext !== '.cssl') {
|
|
29
|
+
vscode.window.showWarningMessage('Only .cssl files can be executed. Modules (.cssl-mod) and Payloads (.cssl-pl) cannot be run directly.');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Save the file before running
|
|
34
|
+
if (document.isDirty) {
|
|
35
|
+
await document.save();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Get configuration
|
|
39
|
+
const config = vscode.workspace.getConfiguration('cssl');
|
|
40
|
+
const pythonPath = config.get('pythonPath', 'python');
|
|
41
|
+
const showOutput = config.get('showOutput', true);
|
|
42
|
+
|
|
43
|
+
// Show output channel
|
|
44
|
+
if (showOutput) {
|
|
45
|
+
outputChannel.show(true);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
outputChannel.clear();
|
|
49
|
+
outputChannel.appendLine(`[CSSL] Running: ${path.basename(filePath)}`);
|
|
50
|
+
outputChannel.appendLine(`[CSSL] Path: ${filePath}`);
|
|
51
|
+
outputChannel.appendLine('─'.repeat(50));
|
|
52
|
+
|
|
53
|
+
// Run the CSSL file using includecpp cssl run
|
|
54
|
+
const args = ['-m', 'includecpp', 'cssl', 'run', filePath];
|
|
55
|
+
|
|
56
|
+
const process = spawn(pythonPath, args, {
|
|
57
|
+
cwd: path.dirname(filePath),
|
|
58
|
+
env: { ...process.env }
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
let hasError = false;
|
|
62
|
+
|
|
63
|
+
process.stdout.on('data', (data) => {
|
|
64
|
+
outputChannel.append(data.toString());
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
process.stderr.on('data', (data) => {
|
|
68
|
+
hasError = true;
|
|
69
|
+
outputChannel.append(data.toString());
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
process.on('close', (code) => {
|
|
73
|
+
outputChannel.appendLine('');
|
|
74
|
+
outputChannel.appendLine('─'.repeat(50));
|
|
75
|
+
if (code === 0) {
|
|
76
|
+
outputChannel.appendLine(`[CSSL] Finished successfully`);
|
|
77
|
+
} else {
|
|
78
|
+
outputChannel.appendLine(`[CSSL] Exited with code: ${code}`);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
process.on('error', (err) => {
|
|
83
|
+
outputChannel.appendLine(`[CSSL] Error: ${err.message}`);
|
|
84
|
+
vscode.window.showErrorMessage(`Failed to run CSSL: ${err.message}. Make sure IncludeCPP is installed (pip install includecpp).`);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
context.subscriptions.push(runCommand);
|
|
89
|
+
context.subscriptions.push(outputChannel);
|
|
90
|
+
|
|
91
|
+
// Register task provider for CSSL
|
|
92
|
+
const taskProvider = vscode.tasks.registerTaskProvider('cssl', {
|
|
93
|
+
provideTasks: () => {
|
|
94
|
+
return [];
|
|
95
|
+
},
|
|
96
|
+
resolveTask: (task) => {
|
|
97
|
+
if (task.definition.type === 'cssl') {
|
|
98
|
+
const config = vscode.workspace.getConfiguration('cssl');
|
|
99
|
+
const pythonPath = config.get('pythonPath', 'python');
|
|
100
|
+
const file = task.definition.file;
|
|
101
|
+
|
|
102
|
+
const execution = new vscode.ShellExecution(
|
|
103
|
+
`${pythonPath} -m includecpp cssl run "${file}"`
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
return new vscode.Task(
|
|
107
|
+
task.definition,
|
|
108
|
+
vscode.TaskScope.Workspace,
|
|
109
|
+
'Run CSSL',
|
|
110
|
+
'cssl',
|
|
111
|
+
execution,
|
|
112
|
+
[]
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
context.subscriptions.push(taskProvider);
|
|
120
|
+
|
|
121
|
+
console.log('CSSL extension activated');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function deactivate() {
|
|
125
|
+
if (outputChannel) {
|
|
126
|
+
outputChannel.dispose();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
module.exports = {
|
|
131
|
+
activate,
|
|
132
|
+
deactivate
|
|
133
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -6,14 +6,12 @@
|
|
|
6
6
|
"brackets": [
|
|
7
7
|
["{", "}"],
|
|
8
8
|
["[", "]"],
|
|
9
|
-
["(", ")"]
|
|
10
|
-
["<", ">"]
|
|
9
|
+
["(", ")"]
|
|
11
10
|
],
|
|
12
11
|
"autoClosingPairs": [
|
|
13
12
|
{ "open": "{", "close": "}" },
|
|
14
13
|
{ "open": "[", "close": "]" },
|
|
15
14
|
{ "open": "(", "close": ")" },
|
|
16
|
-
{ "open": "<", "close": ">" },
|
|
17
15
|
{ "open": "\"", "close": "\"", "notIn": ["string"] },
|
|
18
16
|
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }
|
|
19
17
|
],
|
|
@@ -21,7 +19,6 @@
|
|
|
21
19
|
["{", "}"],
|
|
22
20
|
["[", "]"],
|
|
23
21
|
["(", ")"],
|
|
24
|
-
["<", ">"],
|
|
25
22
|
["\"", "\""],
|
|
26
23
|
["'", "'"]
|
|
27
24
|
],
|
|
@@ -1,35 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cssl",
|
|
3
|
-
"displayName": "CSSL
|
|
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.3.0",
|
|
6
6
|
"publisher": "IncludeCPP",
|
|
7
|
-
"icon": "images/cssl
|
|
7
|
+
"icon": "images/cssl.png",
|
|
8
8
|
"engines": {
|
|
9
9
|
"vscode": "^1.60.0"
|
|
10
10
|
},
|
|
11
11
|
"categories": [
|
|
12
12
|
"Programming Languages",
|
|
13
|
-
"Snippets"
|
|
13
|
+
"Snippets",
|
|
14
|
+
"Debuggers"
|
|
14
15
|
],
|
|
15
16
|
"keywords": [
|
|
16
17
|
"cssl",
|
|
17
|
-
"cso",
|
|
18
18
|
"script",
|
|
19
19
|
"includecpp",
|
|
20
20
|
"c++",
|
|
21
|
-
"python"
|
|
21
|
+
"python",
|
|
22
|
+
"run"
|
|
22
23
|
],
|
|
24
|
+
"activationEvents": [
|
|
25
|
+
"onLanguage:cssl"
|
|
26
|
+
],
|
|
27
|
+
"main": "./extension.js",
|
|
23
28
|
"contributes": {
|
|
24
29
|
"languages": [
|
|
25
30
|
{
|
|
26
31
|
"id": "cssl",
|
|
27
|
-
"aliases": ["CSSL", "cssl"
|
|
28
|
-
"extensions": [".cssl"
|
|
32
|
+
"aliases": ["CSSL", "cssl"],
|
|
33
|
+
"extensions": [".cssl"],
|
|
34
|
+
"configuration": "./language-configuration.json",
|
|
35
|
+
"icon": {
|
|
36
|
+
"light": "./images/cssl.png",
|
|
37
|
+
"dark": "./images/cssl.png"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "cssl-mod",
|
|
42
|
+
"aliases": ["CSSL Module", "cssl-mod"],
|
|
43
|
+
"extensions": [".cssl-mod"],
|
|
44
|
+
"configuration": "./language-configuration.json",
|
|
45
|
+
"icon": {
|
|
46
|
+
"light": "./images/cssl_pl.png",
|
|
47
|
+
"dark": "./images/cssl_pl.png"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "cssl-pl",
|
|
52
|
+
"aliases": ["CSSL Payload", "cssl-pl"],
|
|
53
|
+
"extensions": [".cssl-pl"],
|
|
29
54
|
"configuration": "./language-configuration.json",
|
|
30
55
|
"icon": {
|
|
31
|
-
"light": "./images/
|
|
32
|
-
"dark": "./images/
|
|
56
|
+
"light": "./images/cssl_pl.png",
|
|
57
|
+
"dark": "./images/cssl_pl.png"
|
|
33
58
|
}
|
|
34
59
|
}
|
|
35
60
|
],
|
|
@@ -38,13 +63,94 @@
|
|
|
38
63
|
"language": "cssl",
|
|
39
64
|
"scopeName": "source.cssl",
|
|
40
65
|
"path": "./syntaxes/cssl.tmLanguage.json"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"language": "cssl-mod",
|
|
69
|
+
"scopeName": "source.cssl",
|
|
70
|
+
"path": "./syntaxes/cssl.tmLanguage.json"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"language": "cssl-pl",
|
|
74
|
+
"scopeName": "source.cssl",
|
|
75
|
+
"path": "./syntaxes/cssl.tmLanguage.json"
|
|
41
76
|
}
|
|
42
77
|
],
|
|
43
78
|
"snippets": [
|
|
44
79
|
{
|
|
45
80
|
"language": "cssl",
|
|
46
81
|
"path": "./snippets/cssl.snippets.json"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"language": "cssl-mod",
|
|
85
|
+
"path": "./snippets/cssl.snippets.json"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"language": "cssl-pl",
|
|
89
|
+
"path": "./snippets/cssl.snippets.json"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"commands": [
|
|
93
|
+
{
|
|
94
|
+
"command": "cssl.runFile",
|
|
95
|
+
"title": "Run CSSL File",
|
|
96
|
+
"icon": "$(play)",
|
|
97
|
+
"enablement": "resourceExtname == .cssl"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"menus": {
|
|
101
|
+
"editor/title/run": [
|
|
102
|
+
{
|
|
103
|
+
"command": "cssl.runFile",
|
|
104
|
+
"when": "resourceExtname == .cssl",
|
|
105
|
+
"group": "navigation"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"editor/context": [
|
|
109
|
+
{
|
|
110
|
+
"command": "cssl.runFile",
|
|
111
|
+
"when": "resourceExtname == .cssl",
|
|
112
|
+
"group": "1_run"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"keybindings": [
|
|
117
|
+
{
|
|
118
|
+
"command": "cssl.runFile",
|
|
119
|
+
"key": "f5",
|
|
120
|
+
"when": "resourceExtname == .cssl && !inDebugMode"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"command": "cssl.runFile",
|
|
124
|
+
"key": "ctrl+f5",
|
|
125
|
+
"when": "resourceExtname == .cssl"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"taskDefinitions": [
|
|
129
|
+
{
|
|
130
|
+
"type": "cssl",
|
|
131
|
+
"required": ["file"],
|
|
132
|
+
"properties": {
|
|
133
|
+
"file": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"description": "The CSSL file to run"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"configuration": {
|
|
141
|
+
"title": "CSSL",
|
|
142
|
+
"properties": {
|
|
143
|
+
"cssl.pythonPath": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"default": "python",
|
|
146
|
+
"description": "Path to Python executable"
|
|
147
|
+
},
|
|
148
|
+
"cssl.showOutput": {
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"default": true,
|
|
151
|
+
"description": "Show output panel when running CSSL files"
|
|
152
|
+
}
|
|
47
153
|
}
|
|
48
|
-
|
|
154
|
+
}
|
|
49
155
|
}
|
|
50
156
|
}
|