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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
CSSL Syntax Highlighting
|
|
3
3
|
|
|
4
|
-
Provides syntax highlighting for CSSL
|
|
4
|
+
Provides syntax highlighting for CSSL code.
|
|
5
5
|
Can be used with:
|
|
6
6
|
- PyQt5/6 QSyntaxHighlighter
|
|
7
7
|
- VSCode/TextMate grammar export
|
|
@@ -216,8 +216,8 @@ class CSSLSyntaxRules:
|
|
|
216
216
|
class ColorScheme:
|
|
217
217
|
"""Color scheme for syntax highlighting"""
|
|
218
218
|
|
|
219
|
-
#
|
|
220
|
-
|
|
219
|
+
# CSSL Theme (Orange accent, dark background)
|
|
220
|
+
CSSL_THEME = {
|
|
221
221
|
TokenCategory.KEYWORD: '#508cff', # Blue
|
|
222
222
|
TokenCategory.BUILTIN: '#ff8c00', # Orange
|
|
223
223
|
TokenCategory.OPERATOR: '#c8c8d2', # Light gray
|
|
@@ -261,13 +261,13 @@ def highlight_cssl(source: str, scheme: Dict[TokenCategory, str] = None) -> List
|
|
|
261
261
|
|
|
262
262
|
Args:
|
|
263
263
|
source: CSSL source code
|
|
264
|
-
scheme: Color scheme dict (defaults to
|
|
264
|
+
scheme: Color scheme dict (defaults to CSSL_THEME)
|
|
265
265
|
|
|
266
266
|
Returns:
|
|
267
267
|
List of (start, end, color, category) tuples
|
|
268
268
|
"""
|
|
269
269
|
if scheme is None:
|
|
270
|
-
scheme = ColorScheme.
|
|
270
|
+
scheme = ColorScheme.CSSL_THEME
|
|
271
271
|
|
|
272
272
|
highlights = []
|
|
273
273
|
rules = CSSLSyntaxRules.get_rules()
|
|
@@ -337,7 +337,7 @@ def highlight_cssl_ansi(source: str) -> str:
|
|
|
337
337
|
}
|
|
338
338
|
RESET = '\033[0m'
|
|
339
339
|
|
|
340
|
-
highlights = highlight_cssl(source, ColorScheme.
|
|
340
|
+
highlights = highlight_cssl(source, ColorScheme.CSSL_THEME)
|
|
341
341
|
|
|
342
342
|
# Build highlighted string
|
|
343
343
|
result = []
|
|
@@ -388,7 +388,7 @@ def get_pyqt_highlighter():
|
|
|
388
388
|
|
|
389
389
|
def _setup_rules(self):
|
|
390
390
|
"""Setup highlighting rules"""
|
|
391
|
-
scheme = ColorScheme.
|
|
391
|
+
scheme = ColorScheme.CSSL_THEME
|
|
392
392
|
|
|
393
393
|
for rule in CSSLSyntaxRules.get_rules():
|
|
394
394
|
fmt = QTextCharFormat()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
CSSL Data Types - Advanced container types for
|
|
2
|
+
CSSL Data Types - Advanced container types for CSSL
|
|
3
3
|
|
|
4
4
|
Types:
|
|
5
5
|
- datastruct<T>: Universal container (lazy declarator) - can hold any type
|
|
@@ -64,6 +64,33 @@ class DataStruct(list):
|
|
|
64
64
|
return target_type(self[0])
|
|
65
65
|
return None
|
|
66
66
|
|
|
67
|
+
def length(self) -> int:
|
|
68
|
+
"""Return datastruct length"""
|
|
69
|
+
return len(self)
|
|
70
|
+
|
|
71
|
+
def size(self) -> int:
|
|
72
|
+
"""Return datastruct size (alias for length)"""
|
|
73
|
+
return len(self)
|
|
74
|
+
|
|
75
|
+
def push(self, item: Any) -> 'DataStruct':
|
|
76
|
+
"""Push item to datastruct (alias for add)"""
|
|
77
|
+
self.append(item)
|
|
78
|
+
return self
|
|
79
|
+
|
|
80
|
+
def isEmpty(self) -> bool:
|
|
81
|
+
"""Check if datastruct is empty"""
|
|
82
|
+
return len(self) == 0
|
|
83
|
+
|
|
84
|
+
def contains(self, item: Any) -> bool:
|
|
85
|
+
"""Check if datastruct contains item"""
|
|
86
|
+
return item in self
|
|
87
|
+
|
|
88
|
+
def at(self, index: int) -> Any:
|
|
89
|
+
"""Get item at index (safe access)"""
|
|
90
|
+
if 0 <= index < len(self):
|
|
91
|
+
return self[index]
|
|
92
|
+
return None
|
|
93
|
+
|
|
67
94
|
def begin(self) -> int:
|
|
68
95
|
"""Return iterator to beginning (C++ style)"""
|
|
69
96
|
return 0
|
|
@@ -99,6 +126,16 @@ class Stack(list):
|
|
|
99
126
|
self.append(item)
|
|
100
127
|
return self
|
|
101
128
|
|
|
129
|
+
def pop(self) -> Any:
|
|
130
|
+
"""Pop and return top element from stack"""
|
|
131
|
+
if len(self) == 0:
|
|
132
|
+
return None
|
|
133
|
+
return super().pop()
|
|
134
|
+
|
|
135
|
+
def pop_back(self) -> Any:
|
|
136
|
+
"""Pop and return top element (alias for pop)"""
|
|
137
|
+
return self.pop()
|
|
138
|
+
|
|
102
139
|
def peek(self) -> Any:
|
|
103
140
|
"""View top item without removing"""
|
|
104
141
|
return self[-1] if self else None
|
|
@@ -701,6 +738,39 @@ class List(list):
|
|
|
701
738
|
self.extend([value] * count)
|
|
702
739
|
return self
|
|
703
740
|
|
|
741
|
+
def map(self, func: Callable[[Any], Any]) -> 'List':
|
|
742
|
+
"""Apply function to all elements"""
|
|
743
|
+
result = List(self._element_type)
|
|
744
|
+
result.extend(func(item) for item in self)
|
|
745
|
+
return result
|
|
746
|
+
|
|
747
|
+
def filter(self, predicate: Callable[[Any], bool]) -> 'List':
|
|
748
|
+
"""Filter elements by predicate"""
|
|
749
|
+
result = List(self._element_type)
|
|
750
|
+
result.extend(item for item in self if predicate(item))
|
|
751
|
+
return result
|
|
752
|
+
|
|
753
|
+
def forEach(self, func: Callable[[Any], None]) -> 'List':
|
|
754
|
+
"""Execute function for each element"""
|
|
755
|
+
for item in self:
|
|
756
|
+
func(item)
|
|
757
|
+
return self
|
|
758
|
+
|
|
759
|
+
def reduce(self, func: Callable[[Any, Any], Any], initial: Any = None) -> Any:
|
|
760
|
+
"""Reduce list to single value"""
|
|
761
|
+
from functools import reduce as py_reduce
|
|
762
|
+
if initial is None:
|
|
763
|
+
return py_reduce(func, self)
|
|
764
|
+
return py_reduce(func, self, initial)
|
|
765
|
+
|
|
766
|
+
def every(self, predicate: Callable[[Any], bool]) -> bool:
|
|
767
|
+
"""Check if all elements match predicate"""
|
|
768
|
+
return all(predicate(item) for item in self)
|
|
769
|
+
|
|
770
|
+
def some(self, predicate: Callable[[Any], bool]) -> bool:
|
|
771
|
+
"""Check if any element matches predicate"""
|
|
772
|
+
return any(predicate(item) for item in self)
|
|
773
|
+
|
|
704
774
|
def begin(self) -> int:
|
|
705
775
|
"""Return iterator to beginning"""
|
|
706
776
|
return 0
|
|
@@ -1499,7 +1569,10 @@ class CSSLInstance:
|
|
|
1499
1569
|
object.__setattr__(self, name, value)
|
|
1500
1570
|
|
|
1501
1571
|
def __repr__(self):
|
|
1502
|
-
return f"<
|
|
1572
|
+
return f"<{self._class.name} instance at 0x{id(self):x}>"
|
|
1573
|
+
|
|
1574
|
+
def __str__(self):
|
|
1575
|
+
return f"<{self._class.name} instance at 0x{id(self):x}>"
|
|
1503
1576
|
|
|
1504
1577
|
|
|
1505
1578
|
__all__ = [
|