IncludeCPP 3.4.5__tar.gz → 3.4.19__tar.gz

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.
Files changed (53) hide show
  1. {includecpp-3.4.5 → includecpp-3.4.19}/IncludeCPP.egg-info/PKG-INFO +1 -1
  2. {includecpp-3.4.5 → includecpp-3.4.19}/PKG-INFO +1 -1
  3. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/__init__.py +1 -1
  4. includecpp-3.4.19/includecpp/__init__.pyi +255 -0
  5. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/cli/commands.py +125 -3
  6. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cssl/__init__.py +8 -6
  7. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cssl/cssl_builtins.py +243 -5
  8. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cssl/cssl_parser.py +462 -14
  9. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cssl/cssl_runtime.py +861 -54
  10. includecpp-3.4.19/includecpp/core/cssl/cssl_types.py +953 -0
  11. includecpp-3.4.19/includecpp/core/cssl_bridge.py +781 -0
  12. includecpp-3.4.19/includecpp/core/cssl_bridge.pyi +311 -0
  13. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/generator/parser.cpp +1 -1
  14. {includecpp-3.4.5 → includecpp-3.4.19}/pyproject.toml +1 -1
  15. includecpp-3.4.5/includecpp/__init__.pyi +0 -124
  16. includecpp-3.4.5/includecpp/core/cssl/cssl_types.py +0 -390
  17. includecpp-3.4.5/includecpp/core/cssl_bridge.py +0 -204
  18. includecpp-3.4.5/includecpp/core/cssl_bridge.pyi +0 -149
  19. {includecpp-3.4.5 → includecpp-3.4.19}/IncludeCPP.egg-info/SOURCES.txt +0 -0
  20. {includecpp-3.4.5 → includecpp-3.4.19}/IncludeCPP.egg-info/dependency_links.txt +0 -0
  21. {includecpp-3.4.5 → includecpp-3.4.19}/IncludeCPP.egg-info/entry_points.txt +0 -0
  22. {includecpp-3.4.5 → includecpp-3.4.19}/IncludeCPP.egg-info/requires.txt +0 -0
  23. {includecpp-3.4.5 → includecpp-3.4.19}/IncludeCPP.egg-info/top_level.txt +0 -0
  24. {includecpp-3.4.5 → includecpp-3.4.19}/LICENSE +0 -0
  25. {includecpp-3.4.5 → includecpp-3.4.19}/MANIFEST.in +0 -0
  26. {includecpp-3.4.5 → includecpp-3.4.19}/README.md +0 -0
  27. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/__main__.py +0 -0
  28. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/cli/__init__.py +0 -0
  29. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/cli/config_parser.py +0 -0
  30. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/__init__.py +0 -0
  31. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/ai_integration.py +0 -0
  32. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/build_manager.py +0 -0
  33. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cpp_api.py +0 -0
  34. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cpp_api.pyi +0 -0
  35. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cppy_converter.py +0 -0
  36. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cssl/cssl_events.py +0 -0
  37. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cssl/cssl_modules.py +0 -0
  38. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/cssl/cssl_syntax.py +0 -0
  39. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/error_catalog.py +0 -0
  40. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/error_formatter.py +0 -0
  41. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/exceptions.py +0 -0
  42. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/path_discovery.py +0 -0
  43. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/project_ui.py +0 -0
  44. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/core/settings_ui.py +0 -0
  45. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/generator/__init__.py +0 -0
  46. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/generator/parser.h +0 -0
  47. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/generator/type_resolver.cpp +0 -0
  48. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/generator/type_resolver.h +0 -0
  49. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/py.typed +0 -0
  50. {includecpp-3.4.5 → includecpp-3.4.19}/includecpp/templates/cpp.proj.template +0 -0
  51. {includecpp-3.4.5 → includecpp-3.4.19}/requirements.txt +0 -0
  52. {includecpp-3.4.5 → includecpp-3.4.19}/setup.cfg +0 -0
  53. {includecpp-3.4.5 → includecpp-3.4.19}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 3.4.5
3
+ Version: 3.4.19
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IncludeCPP
3
- Version: 3.4.5
3
+ Version: 3.4.19
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
@@ -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.4.5"
5
+ __version__ = "3.4.19"
6
6
  __all__ = ["CppApi", "CSSL"]
7
7
 
8
8
  # Module-level cache for C++ modules
@@ -0,0 +1,255 @@
1
+ """Type stubs for includecpp package - VSCode IntelliSense support."""
2
+
3
+ from typing import Any, Dict, Optional, List, Literal, overload, Callable
4
+ from pathlib import Path
5
+ from types import ModuleType
6
+ import threading
7
+
8
+ # Import generated module wrappers for VSCode autocomplete
9
+ # These are created by 'includecpp rebuild' and provide module-specific type hints
10
+ try:
11
+ from .core.cpp_api_extensions import *
12
+ except ImportError:
13
+ pass # Generated during rebuild
14
+
15
+
16
+ # ========== CSSL Module - CSO Service Script Language ==========
17
+ class _CSSLModule:
18
+ """CSSL callable module created via CSSL.module()"""
19
+ def __call__(self, *args: Any) -> Any:
20
+ """Execute the module code with arguments."""
21
+ ...
22
+
23
+ class _CSSLFunctionModule:
24
+ """CSSL function module created via CSSL.makemodule()"""
25
+ def __getattr__(self, name: str) -> Callable[..., Any]:
26
+ """Get a function from the module."""
27
+ ...
28
+
29
+ class _CsslLang:
30
+ """CSSL Language interface."""
31
+
32
+ def exec(self, path_or_code: str, *args: Any) -> Any:
33
+ """Execute CSSL code or file.
34
+
35
+ Args:
36
+ path_or_code: Path to .cssl file or CSSL code string
37
+ *args: Arguments accessible via parameter.get(index)
38
+
39
+ Returns:
40
+ Execution result
41
+ """
42
+ ...
43
+
44
+ def T_exec(
45
+ self,
46
+ path_or_code: str,
47
+ *args: Any,
48
+ callback: Optional[Callable[[Any], None]] = None
49
+ ) -> threading.Thread:
50
+ """Execute CSSL code asynchronously in a thread."""
51
+ ...
52
+
53
+ def wait_all(self, timeout: Optional[float] = None) -> None:
54
+ """Wait for all async executions to complete."""
55
+ ...
56
+
57
+ def get_output(self) -> List[str]:
58
+ """Get output buffer from last execution."""
59
+ ...
60
+
61
+ def clear_output(self) -> None:
62
+ """Clear output buffer."""
63
+ ...
64
+
65
+ def set_global(self, name: str, value: Any) -> None:
66
+ """Set a global variable in CSSL runtime."""
67
+ ...
68
+
69
+ def get_global(self, name: str) -> Any:
70
+ """Get a global variable from CSSL runtime."""
71
+ ...
72
+
73
+ def module(self, code: str) -> _CSSLModule:
74
+ """Create a callable CSSL module from code."""
75
+ ...
76
+
77
+ def makemodule(self, code: str) -> _CSSLFunctionModule:
78
+ """Create a CSSL module with accessible functions."""
79
+ ...
80
+
81
+
82
+ class _CSSLBridge:
83
+ """CSSL Bridge module - access to CSSL language from Python."""
84
+
85
+ CsslLang: type[_CsslLang]
86
+
87
+ def exec(self, path_or_code: str, *args: Any) -> Any:
88
+ """Execute CSSL code or file."""
89
+ ...
90
+
91
+ def _exec(self, code: str, *args: Any) -> Any:
92
+ """Execute CSSL code (alias for exec)."""
93
+ ...
94
+
95
+ def T_exec(
96
+ self,
97
+ path_or_code: str,
98
+ *args: Any,
99
+ callback: Optional[Callable[[Any], None]] = None
100
+ ) -> threading.Thread:
101
+ """Execute CSSL code asynchronously."""
102
+ ...
103
+
104
+ def _T_exec(
105
+ self,
106
+ code: str,
107
+ *args: Any,
108
+ callback: Optional[Callable[[Any], None]] = None
109
+ ) -> threading.Thread:
110
+ """Execute CSSL code asynchronously (alias)."""
111
+ ...
112
+
113
+ def set_global(self, name: str, value: Any) -> None:
114
+ """Set a global variable."""
115
+ ...
116
+
117
+ def get_global(self, name: str) -> Any:
118
+ """Get a global variable."""
119
+ ...
120
+
121
+ def get_output(self) -> List[str]:
122
+ """Get output buffer."""
123
+ ...
124
+
125
+ def clear_output(self) -> None:
126
+ """Clear output buffer."""
127
+ ...
128
+
129
+ def module(self, code: str) -> _CSSLModule:
130
+ """Create a callable CSSL module."""
131
+ ...
132
+
133
+ def makemodule(self, code: str) -> _CSSLFunctionModule:
134
+ """Create a CSSL function module."""
135
+ ...
136
+
137
+ def get_cssl(self) -> _CsslLang:
138
+ """Get default CSSL instance."""
139
+ ...
140
+
141
+
142
+ # CSSL module instance - CSO Service Script Language
143
+ CSSL: _CSSLBridge
144
+
145
+ __version__: str
146
+
147
+ # Dynamic module access via: from includecpp import <module_name>
148
+ # Auto-generated module declarations
149
+ # These allow: from includecpp import <module_name>
150
+ # (Run 'includecpp rebuild' to generate declarations for your modules)
151
+
152
+ def __dir__() -> List[str]:
153
+ """List available modules including dynamically loaded C++ modules."""
154
+ ...
155
+
156
+ class ModuleWrapper:
157
+ """Wrapper for C++ modules with getInfo() and dynamic attributes."""
158
+
159
+ def getInfo(self) -> Dict[str, Any]:
160
+ """Get module metadata including classes, functions, and structs."""
161
+ ...
162
+
163
+ def __getattr__(self, name: str) -> Any: ...
164
+ def __dir__(self) -> List[str]: ...
165
+
166
+ class CppApi:
167
+ """Main API class for including C++ modules with type hints."""
168
+
169
+ # Inbuilt module constants
170
+ FileSystem: str
171
+ Crypto: str
172
+ JSON: str
173
+ StringUtils: str
174
+ Networking: str
175
+ DataStructures: str
176
+ Threading: str
177
+ StandardMenus: str
178
+
179
+ def __init__(
180
+ self,
181
+ verbose: bool = False,
182
+ auto_update: bool = False,
183
+ config_path: Optional[Path] = None
184
+ ) -> None: ...
185
+
186
+ @property
187
+ def Inbuilds(self) -> List[str]:
188
+ """List of available inbuilt modules."""
189
+ ...
190
+
191
+ def exists(self, module_name: str) -> bool:
192
+ """Check if a module exists."""
193
+ ...
194
+
195
+ # The include() method returns ModuleWrapper with dynamic attributes
196
+ # VSCode will show getInfo() and other attributes set at runtime
197
+ def include(
198
+ self,
199
+ module_name: str,
200
+ auto_update: Optional[bool] = None
201
+ ) -> ModuleWrapper:
202
+ """Include a C++ module.
203
+
204
+ Returns a ModuleWrapper instance with:
205
+ - getInfo() method for module metadata
206
+ - Dynamic attributes for classes, functions, and structs
207
+
208
+ Example:
209
+ crypto = api.include("crypto")
210
+ crypto.getInfo() # Get module info
211
+ crypto.Crypto() # Access Crypto class
212
+ crypto.md5(...) # Call md5 function
213
+
214
+ Args:
215
+ module_name: Name of the module to include
216
+ auto_update: Whether to auto-rebuild if outdated (default: False)
217
+
218
+ Returns:
219
+ ModuleWrapper with module-specific attributes
220
+ """
221
+ ...
222
+
223
+ def need_update(self, module_name: str) -> bool:
224
+ """Check if module needs rebuild based on source file changes.
225
+
226
+ Args:
227
+ module_name: Name of module to check
228
+
229
+ Returns:
230
+ True if source files are newer than build
231
+ """
232
+ ...
233
+
234
+ def update(self, module_name: str, verbose: Optional[bool] = None) -> None:
235
+ """Rebuild a single module.
236
+
237
+ Args:
238
+ module_name: Name of module to rebuild
239
+ verbose: Enable verbose output (default: use instance setting)
240
+ """
241
+ ...
242
+
243
+ def rebuild(
244
+ self,
245
+ verbose: bool = False,
246
+ clean: bool = False
247
+ ) -> None:
248
+ """Rebuild C++ modules."""
249
+ ...
250
+
251
+ def list_modules(self) -> List[str]:
252
+ """List all available modules."""
253
+ ...
254
+
255
+ __all__: List[str] # Includes: CppApi, CSSL, __version__
@@ -7455,9 +7455,8 @@ def cssl_exec(path, code):
7455
7455
  try:
7456
7456
  result = cssl_lang.exec(source)
7457
7457
 
7458
- # Print output buffer
7459
- for line in cssl_lang.get_output():
7460
- click.echo(line)
7458
+ # Output is already printed to stdout during execution via runtime.output()
7459
+ # No need to print buffer again - this was causing double output
7461
7460
 
7462
7461
  if result is not None:
7463
7462
  click.echo(f"Result: {result}")
@@ -7508,6 +7507,129 @@ def cssl_makemodule(path, output):
7508
7507
  click.echo(f" Type: {module_data['type']}")
7509
7508
 
7510
7509
 
7510
+ @cssl.command(name='doc')
7511
+ def cssl_doc():
7512
+ """Show CSSL documentation."""
7513
+ from pathlib import Path as PathLib
7514
+ import os
7515
+
7516
+ # Find the documentation file relative to this package
7517
+ package_dir = PathLib(__file__).parent.parent.parent
7518
+ doc_path = package_dir / 'CSSL_DOCUMENTATION.md'
7519
+
7520
+ if not doc_path.exists():
7521
+ # Try alternative locations
7522
+ alt_paths = [
7523
+ PathLib(__file__).parent.parent / 'CSSL_DOCUMENTATION.md',
7524
+ PathLib(os.getcwd()) / 'CSSL_DOCUMENTATION.md',
7525
+ ]
7526
+ for alt in alt_paths:
7527
+ if alt.exists():
7528
+ doc_path = alt
7529
+ break
7530
+
7531
+ if doc_path.exists():
7532
+ content = doc_path.read_text(encoding='utf-8')
7533
+ # Use pager for long content
7534
+ click.echo_via_pager(content)
7535
+ else:
7536
+ click.secho("Documentation file not found.", fg='yellow')
7537
+ click.echo("Looking for: CSSL_DOCUMENTATION.md")
7538
+ click.echo()
7539
+ click.echo("Quick Reference:")
7540
+ click.echo(" - Variables: string x = \"hello\"; int n = 42;")
7541
+ click.echo(" - Functions: void foo() { } or define bar() { }")
7542
+ click.echo(" - Loops: for (i in range(0, 10)) { } or for (int i = 0; i < 10; i++) { }")
7543
+ click.echo(" - Conditions: if (x) { } elif (y) { } else { }")
7544
+ click.echo(" - Containers: stack<T>, vector<T>, array<T>")
7545
+ click.echo(" - Globals: global x = value; @x")
7546
+ click.echo(" - Payloads: payload(\"file.cssl-pl\");")
7547
+ click.echo()
7548
+ click.echo("For full docs, see: https://github.com/liliassg/IncludeCPP")
7549
+
7550
+
7551
+ @cssl.command(name='create')
7552
+ @click.argument('name')
7553
+ @click.option('--dir', '-d', type=click.Path(), default='.', help='Output directory')
7554
+ def cssl_create(name, dir):
7555
+ """Create a new CSSL project with .cssl and .cssl-pl files."""
7556
+ from pathlib import Path as PathLib
7557
+
7558
+ out_dir = PathLib(dir)
7559
+ out_dir.mkdir(parents=True, exist_ok=True)
7560
+
7561
+ cssl_file = out_dir / f"{name}.cssl"
7562
+ payload_file = out_dir / f"{name}.cssl-pl"
7563
+
7564
+ # Create .cssl file
7565
+ cssl_content = f'''// {name}.cssl - CSSL Application
7566
+ // Created with: includecpp cssl create {name}
7567
+
7568
+ // Load payload (globals, injections, config)
7569
+ payload("{name}.cssl-pl");
7570
+
7571
+ // Main application code
7572
+ void main() {{
7573
+ printl("Hello from {name}!");
7574
+ printl("Version: " + @version);
7575
+ }}
7576
+
7577
+ main();
7578
+ '''
7579
+
7580
+ # Create .cssl-pl payload file
7581
+ payload_content = f'''// {name}.cssl-pl - CSSL Payload
7582
+ // Loaded via: payload("{name}.cssl-pl");
7583
+
7584
+ // ============================================================================
7585
+ // Configuration & Variables
7586
+ // ============================================================================
7587
+ global version = "1.0.0";
7588
+ global appName = "{name}";
7589
+ global debug = false;
7590
+
7591
+ // ============================================================================
7592
+ // Builtin Injections
7593
+ // ============================================================================
7594
+ // Inject cleanup code into exit()
7595
+ exit() <<== {{
7596
+ if (@debug) {{
7597
+ printl("[DEBUG] {name} shutting down...");
7598
+ }}
7599
+ }}
7600
+
7601
+ // ============================================================================
7602
+ // Helper Functions (globally callable via @functionName)
7603
+ // ============================================================================
7604
+ void log(string message) {{
7605
+ if (@debug) {{
7606
+ printl("[LOG] " + message);
7607
+ }}
7608
+ }}
7609
+
7610
+ void error(string message) {{
7611
+ printl("[ERROR] " + message);
7612
+ }}
7613
+ '''
7614
+
7615
+ # Write files
7616
+ cssl_file.write_text(cssl_content, encoding='utf-8')
7617
+ payload_file.write_text(payload_content, encoding='utf-8')
7618
+
7619
+ click.secho(f"Created CSSL project: {name}", fg='green', bold=True)
7620
+ click.echo()
7621
+ click.echo("Files created:")
7622
+ click.echo(f" {cssl_file} - Main application")
7623
+ click.echo(f" {payload_file} - Payload (globals, injections)")
7624
+ click.echo()
7625
+ click.echo("Run with:")
7626
+ click.secho(f" includecpp cssl exec {cssl_file}", fg='cyan')
7627
+ click.echo()
7628
+ click.echo("Or from Python:")
7629
+ click.echo(" from includecpp import CSSL")
7630
+ click.echo(f" CSSL.exec('{cssl_file}')")
7631
+
7632
+
7511
7633
  # Register hidden cssl command group
7512
7634
  cli.add_command(cssl)
7513
7635
 
@@ -14,27 +14,29 @@ Features:
14
14
  from .cssl_parser import (
15
15
  parse_cssl, parse_cssl_program, tokenize_cssl,
16
16
  CSSLSyntaxError, CSSLLexer, CSSLParser, ASTNode,
17
- KEYWORDS, TYPE_GENERICS, INJECTION_HELPERS
17
+ KEYWORDS, TYPE_GENERICS, TYPE_PARAM_FUNCTIONS, INJECTION_HELPERS
18
18
  )
19
19
  from .cssl_runtime import CSSLRuntime, CSSLRuntimeError, CSSLServiceRunner, run_cssl, run_cssl_file
20
20
  from .cssl_types import (
21
21
  DataStruct, Shuffled, Iterator, Combo, DataSpace, OpenQuote,
22
- OpenFind,
22
+ OpenFind, Parameter, Stack, Vector, Array,
23
23
  create_datastruct, create_shuffled, create_iterator,
24
- create_combo, create_dataspace, create_openquote
24
+ create_combo, create_dataspace, create_openquote, create_parameter,
25
+ create_stack, create_vector, create_array
25
26
  )
26
27
 
27
28
  __all__ = [
28
29
  # Parser
29
30
  'parse_cssl', 'parse_cssl_program', 'tokenize_cssl',
30
31
  'CSSLSyntaxError', 'CSSLLexer', 'CSSLParser', 'ASTNode',
31
- 'KEYWORDS', 'TYPE_GENERICS', 'INJECTION_HELPERS',
32
+ 'KEYWORDS', 'TYPE_GENERICS', 'TYPE_PARAM_FUNCTIONS', 'INJECTION_HELPERS',
32
33
  # Runtime
33
34
  'CSSLRuntime', 'CSSLRuntimeError', 'CSSLServiceRunner',
34
35
  'run_cssl', 'run_cssl_file',
35
36
  # Data Types
36
37
  'DataStruct', 'Shuffled', 'Iterator', 'Combo', 'DataSpace', 'OpenQuote',
37
- 'OpenFind',
38
+ 'OpenFind', 'Parameter', 'Stack', 'Vector', 'Array',
38
39
  'create_datastruct', 'create_shuffled', 'create_iterator',
39
- 'create_combo', 'create_dataspace', 'create_openquote'
40
+ 'create_combo', 'create_dataspace', 'create_openquote', 'create_parameter',
41
+ 'create_stack', 'create_vector', 'create_array'
40
42
  ]