IncludeCPP 4.2.2__py3-none-any.whl → 4.3.0__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/CHANGELOG.md +82 -115
- includecpp/DOCUMENTATION.md +208 -355
- includecpp/__init__.py +1 -1
- includecpp/cli/commands.py +2 -2
- includecpp/core/cssl/CSSL_DOCUMENTATION.md +1505 -1467
- includecpp/core/cssl/cssl_builtins.py +129 -19
- includecpp/core/cssl/cssl_parser.py +539 -29
- includecpp/core/cssl/cssl_runtime.py +467 -33
- includecpp/core/cssl/cssl_types.py +189 -0
- includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json +38 -2
- includecpp-4.3.0.dist-info/METADATA +277 -0
- {includecpp-4.2.2.dist-info → includecpp-4.3.0.dist-info}/RECORD +16 -16
- includecpp-4.2.2.dist-info/METADATA +0 -1008
- {includecpp-4.2.2.dist-info → includecpp-4.3.0.dist-info}/WHEEL +0 -0
- {includecpp-4.2.2.dist-info → includecpp-4.3.0.dist-info}/entry_points.txt +0 -0
- {includecpp-4.2.2.dist-info → includecpp-4.3.0.dist-info}/licenses/LICENSE +0 -0
- {includecpp-4.2.2.dist-info → includecpp-4.3.0.dist-info}/top_level.txt +0 -0
|
@@ -1443,6 +1443,195 @@ def create_map(key_type: str = 'dynamic', value_type: str = 'dynamic') -> Map:
|
|
|
1443
1443
|
return Map(key_type, value_type)
|
|
1444
1444
|
|
|
1445
1445
|
|
|
1446
|
+
class ByteArrayed:
|
|
1447
|
+
"""Function-to-byte mapping with pattern matching (v4.2.5).
|
|
1448
|
+
|
|
1449
|
+
Maps function references to byte positions and executes pattern matching
|
|
1450
|
+
based on function return values.
|
|
1451
|
+
|
|
1452
|
+
Usage:
|
|
1453
|
+
bytearrayed MyBytes {
|
|
1454
|
+
&func1; // Position 0x0
|
|
1455
|
+
&func2; // Position 0x1
|
|
1456
|
+
case {0, 1} { // Match when func1=0, func2=1
|
|
1457
|
+
printl("Match!");
|
|
1458
|
+
}
|
|
1459
|
+
default {
|
|
1460
|
+
printl("No match");
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
MyBytes(); // Execute pattern matching
|
|
1465
|
+
x = MyBytes["0x0"]; // Get value at position 0
|
|
1466
|
+
x = MyBytes[0]; // Get value at position 0
|
|
1467
|
+
"""
|
|
1468
|
+
|
|
1469
|
+
def __init__(self, name: str, func_refs: List[Dict], cases: List[Dict],
|
|
1470
|
+
default_block: Any = None, runtime: Any = None):
|
|
1471
|
+
self.name = name
|
|
1472
|
+
self.func_refs = func_refs # [{position, hex_pos, func_ref}, ...]
|
|
1473
|
+
self.cases = cases # [{pattern, body}, ...]
|
|
1474
|
+
self.default_block = default_block
|
|
1475
|
+
self._runtime = runtime
|
|
1476
|
+
self._cached_values: Dict[int, Any] = {} # Cached return values
|
|
1477
|
+
|
|
1478
|
+
def __call__(self, *args, **kwargs) -> Any:
|
|
1479
|
+
"""Execute pattern matching - probe functions and match cases.
|
|
1480
|
+
|
|
1481
|
+
Functions are executed "invisibly" (side-effect free where possible)
|
|
1482
|
+
to get their current return values, then patterns are matched.
|
|
1483
|
+
"""
|
|
1484
|
+
# Get current return values from all referenced functions
|
|
1485
|
+
values = self._probe_functions()
|
|
1486
|
+
|
|
1487
|
+
# Try to match each case pattern
|
|
1488
|
+
for case in self.cases:
|
|
1489
|
+
pattern = case['pattern']
|
|
1490
|
+
body = case['body']
|
|
1491
|
+
if self._match_pattern(pattern, values):
|
|
1492
|
+
return self._execute_body(body)
|
|
1493
|
+
|
|
1494
|
+
# No case matched - execute default if present
|
|
1495
|
+
if self.default_block:
|
|
1496
|
+
return self._execute_body(self.default_block)
|
|
1497
|
+
|
|
1498
|
+
return None
|
|
1499
|
+
|
|
1500
|
+
def _probe_functions(self) -> List[Any]:
|
|
1501
|
+
"""Execute referenced functions invisibly to get their return values."""
|
|
1502
|
+
values = []
|
|
1503
|
+
for ref in self.func_refs:
|
|
1504
|
+
func_name = ref['func_ref']
|
|
1505
|
+
position = ref['position']
|
|
1506
|
+
|
|
1507
|
+
# Look up the function in runtime scope
|
|
1508
|
+
func = None
|
|
1509
|
+
if self._runtime:
|
|
1510
|
+
func = self._runtime.scope.get(func_name)
|
|
1511
|
+
if func is None:
|
|
1512
|
+
func = self._runtime.global_scope.get(func_name)
|
|
1513
|
+
if func is None:
|
|
1514
|
+
func = self._runtime.builtins.get_function(func_name)
|
|
1515
|
+
|
|
1516
|
+
# Execute the function to get its return value
|
|
1517
|
+
if func is not None:
|
|
1518
|
+
try:
|
|
1519
|
+
if callable(func):
|
|
1520
|
+
result = func()
|
|
1521
|
+
elif hasattr(func, 'type') and func.type == 'function':
|
|
1522
|
+
# CSSL function node
|
|
1523
|
+
result = self._runtime._call_function(func, [])
|
|
1524
|
+
else:
|
|
1525
|
+
result = func
|
|
1526
|
+
except Exception:
|
|
1527
|
+
result = None
|
|
1528
|
+
else:
|
|
1529
|
+
result = None
|
|
1530
|
+
|
|
1531
|
+
values.append(result)
|
|
1532
|
+
self._cached_values[position] = result
|
|
1533
|
+
|
|
1534
|
+
return values
|
|
1535
|
+
|
|
1536
|
+
def _match_pattern(self, pattern: List[Dict], values: List[Any]) -> bool:
|
|
1537
|
+
"""Check if pattern matches the current values."""
|
|
1538
|
+
for i, p in enumerate(pattern):
|
|
1539
|
+
if i >= len(values):
|
|
1540
|
+
return False
|
|
1541
|
+
|
|
1542
|
+
p_type = p.get('type')
|
|
1543
|
+
value = values[i]
|
|
1544
|
+
|
|
1545
|
+
if p_type == 'wildcard':
|
|
1546
|
+
# _ matches anything
|
|
1547
|
+
continue
|
|
1548
|
+
elif p_type == 'value':
|
|
1549
|
+
# Exact value match
|
|
1550
|
+
if value != p.get('value'):
|
|
1551
|
+
return False
|
|
1552
|
+
elif p_type == 'indexed':
|
|
1553
|
+
# Match at specific index
|
|
1554
|
+
idx = p.get('index')
|
|
1555
|
+
if isinstance(idx, str) and idx.startswith('0x'):
|
|
1556
|
+
idx = int(idx, 16)
|
|
1557
|
+
if idx < len(values):
|
|
1558
|
+
if values[idx] != self._runtime._evaluate(p.get('value')) if hasattr(p.get('value'), 'type') else p.get('value'):
|
|
1559
|
+
return False
|
|
1560
|
+
elif p_type == 'type_match':
|
|
1561
|
+
# Match by type
|
|
1562
|
+
type_name = p.get('type_name')
|
|
1563
|
+
if not self._check_type(value, type_name):
|
|
1564
|
+
return False
|
|
1565
|
+
elif p_type == 'variable':
|
|
1566
|
+
# Match against variable value
|
|
1567
|
+
var_name = p.get('name')
|
|
1568
|
+
var_value = self._runtime.scope.get(var_name)
|
|
1569
|
+
if var_value is None:
|
|
1570
|
+
var_value = self._runtime.global_scope.get(var_name)
|
|
1571
|
+
if value != var_value:
|
|
1572
|
+
return False
|
|
1573
|
+
|
|
1574
|
+
return True
|
|
1575
|
+
|
|
1576
|
+
def _check_type(self, value: Any, type_name: str) -> bool:
|
|
1577
|
+
"""Check if value matches the specified type."""
|
|
1578
|
+
type_checks = {
|
|
1579
|
+
'int': lambda v: isinstance(v, int) and not isinstance(v, bool),
|
|
1580
|
+
'float': lambda v: isinstance(v, float),
|
|
1581
|
+
'string': lambda v: isinstance(v, str),
|
|
1582
|
+
'bool': lambda v: isinstance(v, bool),
|
|
1583
|
+
'list': lambda v: isinstance(v, list),
|
|
1584
|
+
'dict': lambda v: isinstance(v, dict),
|
|
1585
|
+
'dynamic': lambda v: True,
|
|
1586
|
+
}
|
|
1587
|
+
if type_name in type_checks:
|
|
1588
|
+
return type_checks[type_name](value)
|
|
1589
|
+
# Check for generic types like vector<string>
|
|
1590
|
+
if '<' in type_name:
|
|
1591
|
+
base = type_name.split('<')[0]
|
|
1592
|
+
return isinstance(value, (list, tuple, set))
|
|
1593
|
+
return True
|
|
1594
|
+
|
|
1595
|
+
def _execute_body(self, body: List) -> Any:
|
|
1596
|
+
"""Execute a case body block."""
|
|
1597
|
+
if not self._runtime:
|
|
1598
|
+
return None
|
|
1599
|
+
result = None
|
|
1600
|
+
for node in body:
|
|
1601
|
+
result = self._runtime._execute_node(node)
|
|
1602
|
+
return result
|
|
1603
|
+
|
|
1604
|
+
def __getitem__(self, key: Union[int, str]) -> Any:
|
|
1605
|
+
"""Access byte value by index or hex position.
|
|
1606
|
+
|
|
1607
|
+
MyBytes[0] - Get value at position 0
|
|
1608
|
+
MyBytes["0x0"] - Get value at position 0
|
|
1609
|
+
"""
|
|
1610
|
+
if isinstance(key, str):
|
|
1611
|
+
if key.startswith('0x') or key.startswith('0X'):
|
|
1612
|
+
key = int(key, 16)
|
|
1613
|
+
elif key.isdigit():
|
|
1614
|
+
key = int(key)
|
|
1615
|
+
else:
|
|
1616
|
+
raise KeyError(f"Invalid bytearrayed key: {key}")
|
|
1617
|
+
|
|
1618
|
+
if key in self._cached_values:
|
|
1619
|
+
return self._cached_values[key]
|
|
1620
|
+
|
|
1621
|
+
# Probe functions to get values if not cached
|
|
1622
|
+
if not self._cached_values:
|
|
1623
|
+
self._probe_functions()
|
|
1624
|
+
|
|
1625
|
+
return self._cached_values.get(key)
|
|
1626
|
+
|
|
1627
|
+
def __len__(self) -> int:
|
|
1628
|
+
"""Return number of byte positions."""
|
|
1629
|
+
return len(self.func_refs)
|
|
1630
|
+
|
|
1631
|
+
def __repr__(self) -> str:
|
|
1632
|
+
return f"ByteArrayed({self.name}, positions={len(self.func_refs)})"
|
|
1633
|
+
|
|
1634
|
+
|
|
1446
1635
|
class CSSLClass:
|
|
1447
1636
|
"""Represents a CSSL class definition.
|
|
1448
1637
|
|
|
@@ -435,11 +435,11 @@
|
|
|
435
435
|
"patterns": [
|
|
436
436
|
{
|
|
437
437
|
"name": "keyword.control.cssl",
|
|
438
|
-
"match": "\\b(if|else|elif|while|for|foreach|in|range|switch|case|default|break|continue|return|try|catch|finally|throw)\\b"
|
|
438
|
+
"match": "\\b(if|else|elif|while|for|foreach|in|range|switch|case|default|break|continue|return|try|catch|finally|throw|except|always)\\b"
|
|
439
439
|
},
|
|
440
440
|
{
|
|
441
441
|
"name": "storage.type.class.cssl",
|
|
442
|
-
"match": "\\b(class|struct|structure|enum|interface)\\b"
|
|
442
|
+
"match": "\\b(class|struct|structure|enum|interface|bytearrayed)\\b"
|
|
443
443
|
},
|
|
444
444
|
{
|
|
445
445
|
"name": "storage.modifier.extends.cssl",
|
|
@@ -568,6 +568,42 @@
|
|
|
568
568
|
},
|
|
569
569
|
"function-modifiers": {
|
|
570
570
|
"patterns": [
|
|
571
|
+
{
|
|
572
|
+
"comment": "embedded keyword - italic, darker purple/magenta",
|
|
573
|
+
"name": "keyword.control.embedded.cssl",
|
|
574
|
+
"match": "\\b(embedded)\\s+(?=(class|[a-zA-Z_]))",
|
|
575
|
+
"captures": {
|
|
576
|
+
"1": { "name": "keyword.control.embedded.cssl" }
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"comment": "embedded function/class name - same color as switch",
|
|
581
|
+
"name": "meta.embedded.definition.cssl",
|
|
582
|
+
"match": "\\b(embedded)\\s+(class\\s+)?([a-zA-Z_][a-zA-Z0-9_]*)",
|
|
583
|
+
"captures": {
|
|
584
|
+
"1": { "name": "keyword.control.embedded.cssl" },
|
|
585
|
+
"2": { "name": "storage.type.class.cssl" },
|
|
586
|
+
"3": { "name": "keyword.control.cssl" }
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"comment": "open ParamName - ParamName in orange",
|
|
591
|
+
"name": "meta.open.parameter.cssl",
|
|
592
|
+
"match": "\\b(open)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
|
|
593
|
+
"captures": {
|
|
594
|
+
"1": { "name": "storage.modifier.cssl" },
|
|
595
|
+
"2": { "name": "constant.character.escape.infuse.cssl" }
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"comment": "switch(variable) - variable in orange",
|
|
600
|
+
"name": "meta.switch.expression.cssl",
|
|
601
|
+
"match": "\\b(switch)\\s*\\(\\s*([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\)",
|
|
602
|
+
"captures": {
|
|
603
|
+
"1": { "name": "keyword.control.cssl" },
|
|
604
|
+
"2": { "name": "constant.character.escape.infuse.cssl" }
|
|
605
|
+
}
|
|
606
|
+
},
|
|
571
607
|
{
|
|
572
608
|
"name": "storage.modifier.cssl",
|
|
573
609
|
"match": "\\b(undefined|open|closed|private|virtual|meta|super|sqlbased|protected|limited|const|static|final|abstract|readonly)\\b"
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: IncludeCPP
|
|
3
|
+
Version: 4.3.0
|
|
4
|
+
Summary: Professional C++ Python bindings with type-generic templates, pystubs and native threading
|
|
5
|
+
Home-page: https://github.com/liliassg/IncludeCPP
|
|
6
|
+
Author: Lilias Hatterscheidt
|
|
7
|
+
Author-email: Lilias Hatterscheidt <hatterscheidt.lilias@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Repository, https://github.com/liliassg/IncludeCPP
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/liliassg/IncludeCPP/issues
|
|
11
|
+
Keywords: c++,python,bindings,pybind11,template,performance,threading
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: C++
|
|
21
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
22
|
+
Classifier: Operating System :: OS Independent
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: pybind11>=2.11.0
|
|
27
|
+
Requires-Dist: click>=8.0.0
|
|
28
|
+
Requires-Dist: typing-extensions>=4.0.0
|
|
29
|
+
Requires-Dist: requests>=2.28.0
|
|
30
|
+
Requires-Dist: colorama>=0.4.0
|
|
31
|
+
Dynamic: author
|
|
32
|
+
Dynamic: home-page
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
|
|
36
|
+
# IncludeCPP
|
|
37
|
+
|
|
38
|
+
Use C++ code in Python. Write your C++ functions and classes, IncludeCPP generates the Python bindings automatically.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install IncludeCPP
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
### 1. Create a Project
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
mkdir myproject && cd myproject
|
|
50
|
+
includecpp init
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This creates:
|
|
54
|
+
- `cpp.proj` - your project settings
|
|
55
|
+
- `include/` - put your C++ files here
|
|
56
|
+
- `plugins/` - binding files go here (auto-generated)
|
|
57
|
+
|
|
58
|
+
### 2. Write Some C++
|
|
59
|
+
|
|
60
|
+
Create `include/math.cpp`:
|
|
61
|
+
|
|
62
|
+
```cpp
|
|
63
|
+
namespace includecpp {
|
|
64
|
+
|
|
65
|
+
int add(int a, int b) {
|
|
66
|
+
return a + b;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
int multiply(int a, int b) {
|
|
70
|
+
return a * b;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Your code must be inside `namespace includecpp`. Everything outside is ignored.
|
|
77
|
+
|
|
78
|
+
### 3. Generate Bindings
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
includecpp plugin math include/math.cpp
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
This scans your C++ and creates `plugins/math.cp` with the binding instructions.
|
|
85
|
+
|
|
86
|
+
### 4. Build
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
includecpp rebuild
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Compiles your C++ into a Python module.
|
|
93
|
+
|
|
94
|
+
### 5. Use in Python
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from includecpp import math
|
|
98
|
+
|
|
99
|
+
print(math.add(2, 3)) # 5
|
|
100
|
+
print(math.multiply(4, 5)) # 20
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Done. Your C++ code works in Python.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Classes
|
|
108
|
+
|
|
109
|
+
C++ classes work the same way:
|
|
110
|
+
|
|
111
|
+
```cpp
|
|
112
|
+
// include/calculator.cpp
|
|
113
|
+
#include <vector>
|
|
114
|
+
|
|
115
|
+
namespace includecpp {
|
|
116
|
+
|
|
117
|
+
class Calculator {
|
|
118
|
+
public:
|
|
119
|
+
Calculator() : result(0) {}
|
|
120
|
+
|
|
121
|
+
void add(int x) { result += x; }
|
|
122
|
+
void subtract(int x) { result -= x; }
|
|
123
|
+
int getResult() { return result; }
|
|
124
|
+
void reset() { result = 0; }
|
|
125
|
+
|
|
126
|
+
private:
|
|
127
|
+
int result;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Generate and build:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
includecpp plugin calculator include/calculator.cpp
|
|
137
|
+
includecpp rebuild
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Use in Python:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from includecpp import calculator
|
|
144
|
+
|
|
145
|
+
calc = calculator.Calculator()
|
|
146
|
+
calc.add(10)
|
|
147
|
+
calc.add(5)
|
|
148
|
+
calc.subtract(3)
|
|
149
|
+
print(calc.getResult()) # 12
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Development Workflow
|
|
155
|
+
|
|
156
|
+
When you're actively working on your C++:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Regenerate bindings AND rebuild in one command
|
|
160
|
+
includecpp auto math
|
|
161
|
+
|
|
162
|
+
# Fast rebuild (skips unchanged files, ~0.4s when nothing changed)
|
|
163
|
+
includecpp rebuild --fast
|
|
164
|
+
|
|
165
|
+
# Rebuild everything from scratch
|
|
166
|
+
includecpp rebuild --clean
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## CLI Commands
|
|
172
|
+
|
|
173
|
+
| Command | What it does |
|
|
174
|
+
|---------|-------------|
|
|
175
|
+
| `init` | Create project structure |
|
|
176
|
+
| `plugin <name> <file.cpp>` | Generate bindings from C++ |
|
|
177
|
+
| `auto <name>` | Regenerate bindings + rebuild |
|
|
178
|
+
| `rebuild` | Compile all modules |
|
|
179
|
+
| `rebuild --fast` | Fast incremental build |
|
|
180
|
+
| `rebuild --clean` | Full clean rebuild |
|
|
181
|
+
| `get <name>` | Show module's API |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Project Configuration
|
|
186
|
+
|
|
187
|
+
The `cpp.proj` file controls your build:
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"project": "MyProject",
|
|
192
|
+
"include": "/include",
|
|
193
|
+
"plugins": "/plugins",
|
|
194
|
+
"compiler": {
|
|
195
|
+
"standard": "c++17",
|
|
196
|
+
"optimization": "O3"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Plugin Files (.cp)
|
|
204
|
+
|
|
205
|
+
The `.cp` files tell IncludeCPP what to expose. They're auto-generated, but you can edit them:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
SOURCE(calculator.cpp) calculator
|
|
209
|
+
|
|
210
|
+
PUBLIC(
|
|
211
|
+
calculator CLASS(Calculator) {
|
|
212
|
+
CONSTRUCTOR()
|
|
213
|
+
METHOD(add)
|
|
214
|
+
METHOD(subtract)
|
|
215
|
+
METHOD(getResult)
|
|
216
|
+
METHOD(reset)
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Common directives:
|
|
222
|
+
- `CLASS(Name)` - expose a class
|
|
223
|
+
- `METHOD(name)` - expose a method
|
|
224
|
+
- `FUNC(name)` - expose a function
|
|
225
|
+
- `FIELD(name)` - expose a member variable
|
|
226
|
+
- `CONSTRUCTOR()` or `CONSTRUCTOR(int, string)` - expose constructor
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Requirements
|
|
231
|
+
|
|
232
|
+
- Python 3.9+
|
|
233
|
+
- C++ compiler (g++, clang++, or MSVC)
|
|
234
|
+
- CMake
|
|
235
|
+
|
|
236
|
+
pybind11 is installed automatically.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## More Help
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
includecpp --doc # Full documentation
|
|
244
|
+
includecpp --changelog # Version history
|
|
245
|
+
includecpp <command> --help
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Experimental Features
|
|
251
|
+
|
|
252
|
+
IncludeCPP also includes experimental features that are still in development:
|
|
253
|
+
|
|
254
|
+
- **CSSL** - A scripting language for runtime code manipulation
|
|
255
|
+
- **AI Commands** - OpenAI-powered code analysis (`includecpp ai`)
|
|
256
|
+
- **CPPY** - Python to C++ conversion (`includecpp cppy`)
|
|
257
|
+
|
|
258
|
+
These are hidden by default. To enable them:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
includecpp settings
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Check "Enable Experimental Features" and save.
|
|
265
|
+
|
|
266
|
+
Warning: Experimental features may have bugs or breaking changes between versions.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Issues
|
|
271
|
+
|
|
272
|
+
Report bugs at: https://github.com/liliassg/IncludeCPP/issues
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
includecpp bug # Quick bug report
|
|
276
|
+
includecpp update # Update to latest version
|
|
277
|
+
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
includecpp/CHANGELOG.md,sha256=
|
|
2
|
-
includecpp/DOCUMENTATION.md,sha256=
|
|
3
|
-
includecpp/__init__.py,sha256=
|
|
1
|
+
includecpp/CHANGELOG.md,sha256=fLSeIacvnmG-Ea8XUnvtvMdgAWfcQW0uybkldXaxsoc,3621
|
|
2
|
+
includecpp/DOCUMENTATION.md,sha256=MgCUZtslObxTqTLnxjME34NcGo4Z1h_C3n6gcDs82r0,7961
|
|
3
|
+
includecpp/__init__.py,sha256=CIHeXGlukGABoueKCmFPIhOjubjZvOs6OG2vYJkAjPo,1672
|
|
4
4
|
includecpp/__init__.pyi,sha256=gfpArSojafkBCUoACntpnPBVgKLPZHecsyJtlVhE1A0,7267
|
|
5
5
|
includecpp/__main__.py,sha256=d6QK0PkvUe1ENofpmHRAg3bwNbZr8PiRscfI3-WRfVg,72
|
|
6
6
|
includecpp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
includecpp/cli/__init__.py,sha256=Yda-4a5QJb_tKu35YQNfc5lu-LewTsM5abqNNkzS47M,113
|
|
8
|
-
includecpp/cli/commands.py,sha256=
|
|
8
|
+
includecpp/cli/commands.py,sha256=vwmWCKPOI7WFC_hSBdBL3ELr7GB1lQDymoGjdRfB_uQ,372181
|
|
9
9
|
includecpp/cli/config_parser.py,sha256=KveeYUg2TA9sC5hKVzYYfgdNm2WfLG5y7_yxgBWn9yM,4886
|
|
10
10
|
includecpp/core/__init__.py,sha256=L1bT6oikTjdto-6Px7DpjePtM07ymo3Bnov1saZzsGg,390
|
|
11
11
|
includecpp/core/ai_integration.py,sha256=Q44Y1SD_4yXETO4AwtoR51QnX0T4Tc14_Ux9VozQJhQ,89146
|
|
@@ -22,18 +22,18 @@ includecpp/core/exceptions.py,sha256=szeF4qdzi_q8hBBZi7mJxkliyQ0crplkLYe0ymlBGtk
|
|
|
22
22
|
includecpp/core/path_discovery.py,sha256=jI0oSq6Hsd4LKXmU4dOiGSrXcEO_KWMXfQ5_ylBmXvU,2561
|
|
23
23
|
includecpp/core/project_ui.py,sha256=la2EQZKmUkJGuJxnbs09hH1ZhBh9bfndo6okzZsk2dQ,141134
|
|
24
24
|
includecpp/core/settings_ui.py,sha256=B2SlwgdplF2KiBk5UYf2l8Jjifjd0F-FmBP0DPsVCEQ,11798
|
|
25
|
-
includecpp/core/cssl/CSSL_DOCUMENTATION.md,sha256=
|
|
25
|
+
includecpp/core/cssl/CSSL_DOCUMENTATION.md,sha256=Ax7x6h_ZFg4rhghtSNG9dahySh-bJc2upEqP4E-mfck,43486
|
|
26
26
|
includecpp/core/cssl/CSSL_DOCUMENTATION_NEW.md,sha256=I_bVeKWlbcgHYkl2o9L2vk3r5sDvG44bGh__RJIYduw,28222
|
|
27
27
|
includecpp/core/cssl/__init__.py,sha256=scDXRBNK2L6A8qmlpNyaqQj6BFcSfPInBlucdeNfMF0,1975
|
|
28
|
-
includecpp/core/cssl/cssl_builtins.py,sha256=
|
|
28
|
+
includecpp/core/cssl/cssl_builtins.py,sha256=1JZpOdLOJawc-ZlKwAA9Ff4BwlrCweLfG9bfMbjF6H8,114033
|
|
29
29
|
includecpp/core/cssl/cssl_builtins.pyi,sha256=-yr9JbxHKFv9Vc1iufChcqCQvNQLL3-Ow_Hgg0YwQnc,135180
|
|
30
30
|
includecpp/core/cssl/cssl_events.py,sha256=nupIcXW_Vjdud7zCU6hdwkQRQ0MujlPM7Tk2u7eDAiY,21013
|
|
31
31
|
includecpp/core/cssl/cssl_languages.py,sha256=qftMcBiNT1pbIn5OniTZDx8rFtGYU4yx4Iw1QYKAC1U,62342
|
|
32
32
|
includecpp/core/cssl/cssl_modules.py,sha256=cUg0-zdymMnWWTsA_BUrW5dx4R04dHpKcUhm-Wfiwwo,103006
|
|
33
|
-
includecpp/core/cssl/cssl_parser.py,sha256=
|
|
34
|
-
includecpp/core/cssl/cssl_runtime.py,sha256=
|
|
33
|
+
includecpp/core/cssl/cssl_parser.py,sha256=sureKmhbA1mxn21LJ_A-tRK49vrM8SvfF_X-4kEsmTg,193366
|
|
34
|
+
includecpp/core/cssl/cssl_runtime.py,sha256=GmeR7hlZpAgikoeSVz7BH8w5CmmXCWfBRLl8VNrZSyk,257539
|
|
35
35
|
includecpp/core/cssl/cssl_syntax.py,sha256=AcFvqCB9WKitNA32izCWf5jeFWNc6ncc-xLw0J5UjBg,20933
|
|
36
|
-
includecpp/core/cssl/cssl_types.py,sha256=
|
|
36
|
+
includecpp/core/cssl/cssl_types.py,sha256=wLS2gj9sibklRqnqaZYQC_AsSsopJtBj8WTEmSDLo1g,67149
|
|
37
37
|
includecpp/generator/__init__.py,sha256=Rsy41bwimaEloD3gDRR_znPfIJzIsCFuWZgCTJBLJlc,62
|
|
38
38
|
includecpp/generator/parser.cpp,sha256=KT_rrZFJi8KF6emstIW5lKOMaD5gOTC9IcrGEIuIuYw,83251
|
|
39
39
|
includecpp/generator/parser.h,sha256=z8qHnsiY8cXAwq5JW9O-V-hCSjDQacYLgi91ViqzHSw,11405
|
|
@@ -48,10 +48,10 @@ includecpp/vscode/cssl/package.json,sha256=u5iHl79-GfeJiQ7vPe8DP5hXlOpGP41d1A54b
|
|
|
48
48
|
includecpp/vscode/cssl/images/cssl.png,sha256=BxAGsnfS0ZzzCvqV6Zb1OAJAZpDUoXlR86MsvUGlSZw,510
|
|
49
49
|
includecpp/vscode/cssl/images/cssl_pl.png,sha256=z4WMk7g6YCTbUUbSFk343BO6yi_OmNEVYkRenWGydwM,799
|
|
50
50
|
includecpp/vscode/cssl/snippets/cssl.snippets.json,sha256=uV3nHJyQ5f7Pr3FzfbQT2VZOEY3AlGs4wrmqe884jm4,37372
|
|
51
|
-
includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=
|
|
52
|
-
includecpp-4.
|
|
53
|
-
includecpp-4.
|
|
54
|
-
includecpp-4.
|
|
55
|
-
includecpp-4.
|
|
56
|
-
includecpp-4.
|
|
57
|
-
includecpp-4.
|
|
51
|
+
includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json,sha256=IMDF2IqTh-jXx6x5lVfShDmJb5cRVIuJ70P30ahwkME,44674
|
|
52
|
+
includecpp-4.3.0.dist-info/licenses/LICENSE,sha256=fWCsGGsiWZir0UzDd20Hh-3wtRyk1zqUntvtVuAWhvc,1093
|
|
53
|
+
includecpp-4.3.0.dist-info/METADATA,sha256=9C2fO6sSgyjMy3AKk_lEU4zt4MiCEqJ9gL5cQzsUhdA,5887
|
|
54
|
+
includecpp-4.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
55
|
+
includecpp-4.3.0.dist-info/entry_points.txt,sha256=6A5Mif9gi0139Bf03W5plAb3wnAgbNaEVe1HJoGE-2o,59
|
|
56
|
+
includecpp-4.3.0.dist-info/top_level.txt,sha256=RFUaR1KG-M6mCYwP6w4ydP5Cgc8yNbP78jxGAvyjMa8,11
|
|
57
|
+
includecpp-4.3.0.dist-info/RECORD,,
|