IncludeCPP 3.7.6__py3-none-any.whl → 3.7.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 CHANGED
@@ -2,7 +2,7 @@ from .core.cpp_api import CppApi
2
2
  from .core import cssl_bridge as CSSL
3
3
  import warnings
4
4
 
5
- __version__ = "3.7.6"
5
+ __version__ = "3.7.8"
6
6
  __all__ = ["CppApi", "CSSL"]
7
7
 
8
8
  # Module-level cache for C++ modules
@@ -1193,7 +1193,7 @@ def build(ctx, clean, keep, verbose, no_incremental, incremental, parallel, jobs
1193
1193
  @cli.command()
1194
1194
  @click.argument('module_name')
1195
1195
  def add(module_name):
1196
- """Create a new module template."""
1196
+ """Create a new module template with sample C++ code."""
1197
1197
  plugins_dir = Path("plugins")
1198
1198
  if not plugins_dir.exists():
1199
1199
  click.echo("Error: plugins/ directory not found")
@@ -1204,6 +1204,7 @@ def add(module_name):
1204
1204
  click.echo(f"Module {module_name} already exists")
1205
1205
  return
1206
1206
 
1207
+ # Create .cp config file
1207
1208
  template = f"""SOURCE(include/{module_name}.cpp) {module_name}
1208
1209
 
1209
1210
  PUBLIC(
@@ -1215,7 +1216,41 @@ PUBLIC(
1215
1216
  f.write(template)
1216
1217
 
1217
1218
  click.echo(f"Created {cp_file}")
1218
- click.echo(f"Now create include/{module_name}.cpp with your C++ code")
1219
+
1220
+ # Create include/ directory if it doesn't exist
1221
+ include_dir = Path("include")
1222
+ include_dir.mkdir(exist_ok=True)
1223
+
1224
+ # Create .cpp file with sample code
1225
+ cpp_file = include_dir / f"{module_name}.cpp"
1226
+ if not cpp_file.exists():
1227
+ cpp_template = f"""#include <string>
1228
+ #include <vector>
1229
+
1230
+ namespace includecpp {{
1231
+
1232
+ // Example function - returns a greeting
1233
+ std::string example_function(const std::string& name) {{
1234
+ return "Hello, " + name + "!";
1235
+ }}
1236
+
1237
+ // Add more functions here...
1238
+ // int add(int a, int b) {{ return a + b; }}
1239
+ // std::vector<int> range(int n) {{ ... }}
1240
+
1241
+ }} // namespace includecpp
1242
+ """
1243
+ with open(cpp_file, 'w', encoding='utf-8') as f:
1244
+ f.write(cpp_template)
1245
+
1246
+ click.echo(f"Created {cpp_file}")
1247
+ else:
1248
+ click.echo(f"Note: {cpp_file} already exists, skipped")
1249
+
1250
+ click.echo(f"\nNext steps:")
1251
+ click.echo(f" 1. Edit include/{module_name}.cpp to add your functions")
1252
+ click.echo(f" 2. Update plugins/{module_name}.cp to expose functions")
1253
+ click.echo(f" 3. Run: includecpp rebuild")
1219
1254
 
1220
1255
  @cli.command('list')
1221
1256
  def list_modules():
@@ -111,22 +111,62 @@
111
111
  "name": "meta.class.cssl",
112
112
  "begin": "\\b(class)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\{",
113
113
  "beginCaptures": {
114
- "1": { "name": "keyword.other.class.cssl" },
114
+ "1": { "name": "storage.type.class.cssl" },
115
115
  "2": { "name": "entity.name.class.cssl" }
116
116
  },
117
117
  "end": "\\}",
118
118
  "patterns": [
119
119
  { "include": "#comments" },
120
- { "include": "#function-definition" },
120
+ { "include": "#constructor-definition" },
121
+ { "include": "#class-method-definition" },
122
+ { "include": "#class-member-declaration" },
121
123
  { "include": "#types" },
122
124
  { "include": "#this-access" },
123
125
  { "include": "#strings" },
124
126
  { "include": "#numbers" },
127
+ { "include": "#keywords" },
125
128
  { "include": "#operators" }
126
129
  ]
127
130
  }
128
131
  ]
129
132
  },
133
+ "constructor-definition": {
134
+ "patterns": [
135
+ {
136
+ "comment": "Constructor: ClassName { ... } or void ClassName(...)",
137
+ "name": "meta.constructor.cssl",
138
+ "match": "\\b(void\\s+)?([A-Z][a-zA-Z0-9_]*)\\s*(?=\\{|\\()",
139
+ "captures": {
140
+ "1": { "name": "storage.type.cssl" },
141
+ "2": { "name": "entity.name.function.constructor.cssl" }
142
+ }
143
+ }
144
+ ]
145
+ },
146
+ "class-method-definition": {
147
+ "patterns": [
148
+ {
149
+ "name": "meta.method.cssl",
150
+ "match": "\\b(void|int|string|float|bool|dynamic|define)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(",
151
+ "captures": {
152
+ "1": { "name": "storage.type.cssl" },
153
+ "2": { "name": "entity.name.function.method.cssl" }
154
+ }
155
+ }
156
+ ]
157
+ },
158
+ "class-member-declaration": {
159
+ "patterns": [
160
+ {
161
+ "name": "meta.member.cssl",
162
+ "match": "\\b(int|string|float|bool|dynamic|auto)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*;",
163
+ "captures": {
164
+ "1": { "name": "storage.type.cssl" },
165
+ "2": { "name": "variable.other.member.cssl" }
166
+ }
167
+ }
168
+ ]
169
+ },
130
170
  "function-definition": {
131
171
  "patterns": [
132
172
  {
@@ -182,19 +222,19 @@
182
222
  "match": "\\b(int|string|float|bool|void|json|dynamic|auto|long|double)\\b"
183
223
  },
184
224
  {
185
- "name": "storage.type.container.cssl",
186
- "match": "\\b(array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|instance|tuple|set|queue)\\b"
187
- },
188
- {
189
- "name": "storage.type.generic.cssl",
190
- "match": "\\b(array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|instance|tuple|set|queue)\\s*<",
225
+ "comment": "Generic containers with type parameter: vector<int>, map<string, int>",
226
+ "name": "meta.generic.cssl",
227
+ "match": "(\\b(?:array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|tuple|set|queue))(<)([^>]+)(>)",
191
228
  "captures": {
192
- "1": { "name": "storage.type.container.cssl" }
229
+ "1": { "name": "storage.type.container.cssl" },
230
+ "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
231
+ "3": { "name": "storage.type.parameter.cssl" },
232
+ "4": { "name": "punctuation.definition.typeparameters.end.cssl" }
193
233
  }
194
234
  },
195
235
  {
196
- "name": "storage.type.map-literal.cssl",
197
- "match": "\\bmap\\s*<[^>]+>\\s*\\{"
236
+ "name": "storage.type.container.cssl",
237
+ "match": "\\b(array|vector|stack|list|dictionary|dict|map|datastruct|dataspace|shuffled|iterator|combo|openquote|instance|tuple|set|queue)\\b"
198
238
  },
199
239
  {
200
240
  "name": "storage.type.combo-open.cssl",
@@ -213,19 +253,23 @@
213
253
  "injection-operators": {
214
254
  "patterns": [
215
255
  {
216
- "name": "entity.name.tag.infuse.cssl",
256
+ "comment": "Infuse operators <<== (REPLACE) - orange/gold color",
257
+ "name": "markup.inserted.infuse.cssl",
217
258
  "match": "(\\+<<==|<<==|-<<==)"
218
259
  },
219
260
  {
220
- "name": "entity.name.tag.infuse.out.cssl",
261
+ "comment": "Infuse out operators ==>> - orange/gold color",
262
+ "name": "markup.inserted.infuse.out.cssl",
221
263
  "match": "(==>>\\+|==>>|-==>>)"
222
264
  },
223
265
  {
224
- "name": "keyword.operator.injection.brute.cssl",
266
+ "comment": "Brute injection <== (ADD) - cyan/blue color",
267
+ "name": "support.constant.brute.cssl",
225
268
  "match": "(\\+<==|<==|-<==)"
226
269
  },
227
270
  {
228
- "name": "keyword.operator.injection.brute.out.cssl",
271
+ "comment": "Brute injection out ==> - cyan/blue color",
272
+ "name": "support.constant.brute.out.cssl",
229
273
  "match": "(==>\\+|==>|-==>)"
230
274
  },
231
275
  {
@@ -325,8 +369,26 @@
325
369
  "instance-references": {
326
370
  "patterns": [
327
371
  {
328
- "name": "storage.type.instance.cssl",
329
- "match": "\\binstance<\"[^\"]+\">"
372
+ "comment": "instance<\"name\"> - shared instance reference with string",
373
+ "name": "meta.instance.cssl",
374
+ "match": "(\\binstance)(<)(\"[^\"]+\")(>)",
375
+ "captures": {
376
+ "1": { "name": "storage.type.instance.cssl" },
377
+ "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
378
+ "3": { "name": "string.quoted.double.cssl" },
379
+ "4": { "name": "punctuation.definition.typeparameters.end.cssl" }
380
+ }
381
+ },
382
+ {
383
+ "comment": "instance<Type> - shared instance reference with type",
384
+ "name": "meta.instance.cssl",
385
+ "match": "(\\binstance)(<)([a-zA-Z_][a-zA-Z0-9_]*)(>)",
386
+ "captures": {
387
+ "1": { "name": "storage.type.instance.cssl" },
388
+ "2": { "name": "punctuation.definition.typeparameters.begin.cssl" },
389
+ "3": { "name": "entity.name.type.cssl" },
390
+ "4": { "name": "punctuation.definition.typeparameters.end.cssl" }
391
+ }
330
392
  }
331
393
  ]
332
394
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 3.7.6
3
+ Version: 3.7.8
4
4
  Summary: Professional C++ Python bindings with type-generic templates, pystubs and native threading
5
5
  Home-page: https://github.com/liliassg/IncludeCPP
6
6
  Author: Lilias Hatterscheidt
@@ -1,9 +1,9 @@
1
- includecpp/__init__.py,sha256=B6a0CroJHkuHfRN0gAFLyQZaafrI8Wb8pysFveVSTas,1672
1
+ includecpp/__init__.py,sha256=YhVmnB0rZmk_i3VN5eMs7UEOpIEEZKJguVwYabgeXKU,1672
2
2
  includecpp/__init__.pyi,sha256=c4gZW7_XQXcp6FBcTi5W7zXTmCtbgQhlC4cyeVqtRRM,7253
3
3
  includecpp/__main__.py,sha256=d6QK0PkvUe1ENofpmHRAg3bwNbZr8PiRscfI3-WRfVg,72
4
4
  includecpp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  includecpp/cli/__init__.py,sha256=Yda-4a5QJb_tKu35YQNfc5lu-LewTsM5abqNNkzS47M,113
6
- includecpp/cli/commands.py,sha256=9PAYEMbixk2EvorcwZunSRJbyAdPSzt67NsVM5qdjLQ,346027
6
+ includecpp/cli/commands.py,sha256=a8yncdRZzHOM2LbI8Z54ZwSYimn-Grg6GqBqhFS0OdE,347101
7
7
  includecpp/cli/config_parser.py,sha256=KveeYUg2TA9sC5hKVzYYfgdNm2WfLG5y7_yxgBWn9yM,4886
8
8
  includecpp/core/__init__.py,sha256=L1bT6oikTjdto-6Px7DpjePtM07ymo3Bnov1saZzsGg,390
9
9
  includecpp/core/ai_integration.py,sha256=PW6yFDqdXjfchpfKTKg59AOLhLry9kqJEGf_65BztrY,87603
@@ -40,10 +40,10 @@ includecpp/vscode/cssl/__init__.py,sha256=rQJAx5X05v-mAwqX1Qb-rbZO219iR73MziFNRU
40
40
  includecpp/vscode/cssl/language-configuration.json,sha256=61Q00cKI9may5L8YpxMmvfo6PAc-abdJqApfR85DWuw,904
41
41
  includecpp/vscode/cssl/package.json,sha256=MWWIRLUnGvadWzEyfWdykUZHTsrG18sqpn5US5sXqac,1435
42
42
  includecpp/vscode/cssl/snippets/cssl.snippets.json,sha256=l4SCEPR3CsPxA8HIVLKYY__I979TfKzYWtH1KYIsboo,33062
43
- includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=t_AjAgZl16ugNhuU-OlIb4Q6SCOLsnQ3DPK2R0xotGk,16091
44
- includecpp-3.7.6.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
45
- includecpp-3.7.6.dist-info/METADATA,sha256=4GXuFRMpXcGjvxCEL0TvzbKDdW6bNUQHDJYh9bLQcao,32122
46
- includecpp-3.7.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
- includecpp-3.7.6.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
48
- includecpp-3.7.6.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
49
- includecpp-3.7.6.dist-info/RECORD,,
43
+ includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=BYstBcaSw72evkzJm65XUTzGUBJn5cg7hhNLjOmDtQ0,19434
44
+ includecpp-3.7.8.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
45
+ includecpp-3.7.8.dist-info/METADATA,sha256=MMx48XsNFQN8txtW6Awiiw50Ms-eTdTGKq0oref-QPM,32122
46
+ includecpp-3.7.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
+ includecpp-3.7.8.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
48
+ includecpp-3.7.8.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
49
+ includecpp-3.7.8.dist-info/RECORD,,