IncludeCPP 3.7.1__tar.gz → 3.7.3__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.
- {includecpp-3.7.1 → includecpp-3.7.3}/IncludeCPP.egg-info/PKG-INFO +1 -1
- {includecpp-3.7.1 → includecpp-3.7.3}/PKG-INFO +1 -1
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/__init__.py +1 -1
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/cli/commands.py +111 -4
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/CSSL_DOCUMENTATION.md +1 -1
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/cssl_parser.py +47 -2
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/cssl_runtime.py +12 -1
- {includecpp-3.7.1 → includecpp-3.7.3}/pyproject.toml +1 -1
- {includecpp-3.7.1 → includecpp-3.7.3}/setup.py +1 -1
- {includecpp-3.7.1 → includecpp-3.7.3}/IncludeCPP.egg-info/SOURCES.txt +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/IncludeCPP.egg-info/dependency_links.txt +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/IncludeCPP.egg-info/entry_points.txt +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/IncludeCPP.egg-info/requires.txt +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/IncludeCPP.egg-info/top_level.txt +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/LICENSE +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/MANIFEST.in +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/README.md +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/__init__.pyi +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/__main__.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/cli/__init__.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/cli/config_parser.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/__init__.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/ai_integration.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/build_manager.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cpp_api.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cpp_api.pyi +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cppy_converter.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/__init__.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/cssl_builtins.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/cssl_builtins.pyi +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/cssl_events.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/cssl_modules.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/cssl_syntax.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl/cssl_types.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl_bridge.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/cssl_bridge.pyi +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/error_catalog.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/error_formatter.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/exceptions.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/path_discovery.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/project_ui.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/core/settings_ui.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/generator/__init__.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/generator/parser.cpp +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/generator/parser.h +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/generator/type_resolver.cpp +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/generator/type_resolver.h +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/py.typed +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/templates/cpp.proj.template +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/vscode/__init__.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/vscode/cssl/__init__.py +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/vscode/cssl/language-configuration.json +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/vscode/cssl/package.json +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/vscode/cssl/snippets/cssl.snippets.json +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/requirements.txt +0 -0
- {includecpp-3.7.1 → includecpp-3.7.3}/setup.cfg +0 -0
|
@@ -7535,10 +7535,29 @@ def cssl_makemodule(path, output):
|
|
|
7535
7535
|
|
|
7536
7536
|
|
|
7537
7537
|
@cssl.command(name='doc')
|
|
7538
|
-
|
|
7539
|
-
|
|
7538
|
+
@click.argument('search', required=False, default=None)
|
|
7539
|
+
@click.option('--list', '-l', 'list_sections', is_flag=True, help='List all documentation sections')
|
|
7540
|
+
def cssl_doc(search, list_sections):
|
|
7541
|
+
"""Show CSSL documentation.
|
|
7542
|
+
|
|
7543
|
+
\b
|
|
7544
|
+
Usage:
|
|
7545
|
+
includecpp cssl doc # Show full documentation
|
|
7546
|
+
includecpp cssl doc "open" # Search for 'open' keyword
|
|
7547
|
+
includecpp cssl doc "$" # Search for shared variable syntax
|
|
7548
|
+
includecpp cssl doc "define" # Search for define keyword
|
|
7549
|
+
includecpp cssl doc --list # List all sections
|
|
7550
|
+
|
|
7551
|
+
\b
|
|
7552
|
+
Examples:
|
|
7553
|
+
includecpp cssl doc "class" # Show OOP/class documentation
|
|
7554
|
+
includecpp cssl doc "json::" # Show JSON functions
|
|
7555
|
+
includecpp cssl doc "this->" # Show this-> keyword usage
|
|
7556
|
+
includecpp cssl doc "map" # Show Map container docs
|
|
7557
|
+
"""
|
|
7540
7558
|
from pathlib import Path as PathLib
|
|
7541
7559
|
import os
|
|
7560
|
+
import re
|
|
7542
7561
|
|
|
7543
7562
|
# Find the documentation file in the cssl package directory
|
|
7544
7563
|
cssl_dir = PathLib(__file__).parent.parent / 'core' / 'cssl'
|
|
@@ -7558,8 +7577,96 @@ def cssl_doc():
|
|
|
7558
7577
|
|
|
7559
7578
|
if doc_path.exists():
|
|
7560
7579
|
content = doc_path.read_text(encoding='utf-8')
|
|
7561
|
-
|
|
7562
|
-
|
|
7580
|
+
|
|
7581
|
+
# List sections mode
|
|
7582
|
+
if list_sections:
|
|
7583
|
+
click.secho("CSSL Documentation Sections", fg='cyan', bold=True)
|
|
7584
|
+
click.secho("=" * 40, fg='cyan')
|
|
7585
|
+
sections = re.findall(r'^##\s+(.+)$', content, re.MULTILINE)
|
|
7586
|
+
for i, section in enumerate(sections, 1):
|
|
7587
|
+
click.echo(f" {i:2d}. {section}")
|
|
7588
|
+
click.echo()
|
|
7589
|
+
click.echo("Use: includecpp cssl doc \"<keyword>\" to search")
|
|
7590
|
+
return
|
|
7591
|
+
|
|
7592
|
+
# Search mode
|
|
7593
|
+
if search:
|
|
7594
|
+
click.secho(f"Searching for: '{search}'", fg='cyan', bold=True)
|
|
7595
|
+
click.secho("=" * 50, fg='cyan')
|
|
7596
|
+
click.echo()
|
|
7597
|
+
|
|
7598
|
+
# Split into sections (## headers)
|
|
7599
|
+
sections = re.split(r'(?=^## )', content, flags=re.MULTILINE)
|
|
7600
|
+
|
|
7601
|
+
found_sections = []
|
|
7602
|
+
for section in sections:
|
|
7603
|
+
if search.lower() in section.lower():
|
|
7604
|
+
found_sections.append(section)
|
|
7605
|
+
|
|
7606
|
+
if found_sections:
|
|
7607
|
+
# Also find specific lines with the search term
|
|
7608
|
+
all_lines = content.split('\n')
|
|
7609
|
+
matching_lines = []
|
|
7610
|
+
for i, line in enumerate(all_lines):
|
|
7611
|
+
if search.lower() in line.lower():
|
|
7612
|
+
# Get context (2 lines before and after)
|
|
7613
|
+
start = max(0, i - 2)
|
|
7614
|
+
end = min(len(all_lines), i + 3)
|
|
7615
|
+
context = '\n'.join(all_lines[start:end])
|
|
7616
|
+
if context not in matching_lines:
|
|
7617
|
+
matching_lines.append((i + 1, context))
|
|
7618
|
+
|
|
7619
|
+
# Show summary
|
|
7620
|
+
click.secho(f"Found in {len(found_sections)} section(s):", fg='green')
|
|
7621
|
+
for section in found_sections:
|
|
7622
|
+
# Extract section title
|
|
7623
|
+
title_match = re.match(r'^##\s+(.+)$', section, re.MULTILINE)
|
|
7624
|
+
if title_match:
|
|
7625
|
+
click.echo(f" - {title_match.group(1)}")
|
|
7626
|
+
|
|
7627
|
+
click.echo()
|
|
7628
|
+
|
|
7629
|
+
# Show matching contexts with highlighting
|
|
7630
|
+
click.secho("Matching content:", fg='yellow', bold=True)
|
|
7631
|
+
click.secho("-" * 50, fg='yellow')
|
|
7632
|
+
|
|
7633
|
+
for line_num, context in matching_lines[:15]: # Limit to 15 matches
|
|
7634
|
+
click.echo(f"\nLine {line_num}:")
|
|
7635
|
+
# Highlight the search term
|
|
7636
|
+
highlighted = re.sub(
|
|
7637
|
+
f'({re.escape(search)})',
|
|
7638
|
+
click.style(r'\1', fg='green', bold=True),
|
|
7639
|
+
context,
|
|
7640
|
+
flags=re.IGNORECASE
|
|
7641
|
+
)
|
|
7642
|
+
click.echo(highlighted)
|
|
7643
|
+
click.echo("-" * 30)
|
|
7644
|
+
|
|
7645
|
+
if len(matching_lines) > 15:
|
|
7646
|
+
click.echo(f"\n... and {len(matching_lines) - 15} more matches")
|
|
7647
|
+
|
|
7648
|
+
# Offer to show full sections
|
|
7649
|
+
click.echo()
|
|
7650
|
+
click.secho("Full sections containing your search:", fg='cyan')
|
|
7651
|
+
click.echo("(Scroll or pipe to a file for full content)")
|
|
7652
|
+
click.echo()
|
|
7653
|
+
|
|
7654
|
+
for section in found_sections:
|
|
7655
|
+
click.echo(section)
|
|
7656
|
+
click.echo()
|
|
7657
|
+
|
|
7658
|
+
else:
|
|
7659
|
+
click.secho(f"No matches found for '{search}'", fg='yellow')
|
|
7660
|
+
click.echo()
|
|
7661
|
+
click.echo("Try searching for:")
|
|
7662
|
+
click.echo(" - Keywords: class, function, define, open, global")
|
|
7663
|
+
click.echo(" - Syntax: $, @, ::, this->, <<==, <==")
|
|
7664
|
+
click.echo(" - Types: string, int, stack, vector, map, json")
|
|
7665
|
+
click.echo()
|
|
7666
|
+
click.echo("Or use: includecpp cssl doc --list")
|
|
7667
|
+
else:
|
|
7668
|
+
# Full documentation mode
|
|
7669
|
+
click.echo_via_pager(content)
|
|
7563
7670
|
else:
|
|
7564
7671
|
click.secho("Documentation file not found.", fg='yellow')
|
|
7565
7672
|
click.echo("Looking for: CSSL_DOCUMENTATION.md")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CSSL - C-Style Scripting Language
|
|
2
2
|
|
|
3
|
-
> Version 3.7.
|
|
3
|
+
> Version 3.7.2 | A modern scripting language with C++-style syntax and unique features like CodeInfusion and BruteInjection.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -2335,17 +2335,62 @@ class CSSLParser:
|
|
|
2335
2335
|
self._expect(TokenType.COMPARE_GT) # consume >
|
|
2336
2336
|
return ASTNode('instance_ref', value=instance_name)
|
|
2337
2337
|
|
|
2338
|
-
# Check for type generic instantiation: stack<string>, vector<int>, etc.
|
|
2338
|
+
# Check for type generic instantiation: stack<string>, vector<int>, map<string, int>, etc.
|
|
2339
2339
|
# This creates a new instance of the type with the specified element type
|
|
2340
2340
|
if name in TYPE_GENERICS and self._check(TokenType.COMPARE_LT):
|
|
2341
2341
|
self._advance() # consume <
|
|
2342
2342
|
element_type = 'dynamic'
|
|
2343
|
+
value_type = None # For map<K, V>
|
|
2344
|
+
|
|
2343
2345
|
if self._check(TokenType.KEYWORD) or self._check(TokenType.IDENTIFIER):
|
|
2344
2346
|
element_type = self._advance().value
|
|
2347
|
+
|
|
2348
|
+
# Check for second type parameter (map<K, V>)
|
|
2349
|
+
if name == 'map' and self._check(TokenType.COMMA):
|
|
2350
|
+
self._advance() # consume ,
|
|
2351
|
+
if self._check(TokenType.KEYWORD) or self._check(TokenType.IDENTIFIER):
|
|
2352
|
+
value_type = self._advance().value
|
|
2353
|
+
else:
|
|
2354
|
+
value_type = 'dynamic'
|
|
2355
|
+
|
|
2345
2356
|
self._expect(TokenType.COMPARE_GT) # consume >
|
|
2357
|
+
|
|
2358
|
+
# Check for inline initialization: map<K,V>{"key": "value", ...}
|
|
2359
|
+
init_values = None
|
|
2360
|
+
if self._check(TokenType.BLOCK_START):
|
|
2361
|
+
self._advance() # consume {
|
|
2362
|
+
init_values = {}
|
|
2363
|
+
|
|
2364
|
+
while not self._check(TokenType.BLOCK_END) and not self._is_at_end():
|
|
2365
|
+
# Parse key
|
|
2366
|
+
if self._check(TokenType.STRING):
|
|
2367
|
+
key = self._advance().value
|
|
2368
|
+
elif self._check(TokenType.IDENTIFIER):
|
|
2369
|
+
key = self._advance().value
|
|
2370
|
+
else:
|
|
2371
|
+
key = str(self._parse_expression().value) if hasattr(self._parse_expression(), 'value') else 'key'
|
|
2372
|
+
|
|
2373
|
+
# Expect : or =
|
|
2374
|
+
if self._check(TokenType.COLON):
|
|
2375
|
+
self._advance()
|
|
2376
|
+
elif self._check(TokenType.EQUALS):
|
|
2377
|
+
self._advance()
|
|
2378
|
+
|
|
2379
|
+
# Parse value
|
|
2380
|
+
value = self._parse_expression()
|
|
2381
|
+
init_values[key] = value
|
|
2382
|
+
|
|
2383
|
+
# Optional comma
|
|
2384
|
+
if self._check(TokenType.COMMA):
|
|
2385
|
+
self._advance()
|
|
2386
|
+
|
|
2387
|
+
self._expect(TokenType.BLOCK_END) # consume }
|
|
2388
|
+
|
|
2346
2389
|
return ASTNode('type_instantiation', value={
|
|
2347
2390
|
'type': name,
|
|
2348
|
-
'element_type': element_type
|
|
2391
|
+
'element_type': element_type,
|
|
2392
|
+
'value_type': value_type,
|
|
2393
|
+
'init_values': init_values
|
|
2349
2394
|
})
|
|
2350
2395
|
|
|
2351
2396
|
# Check for type-parameterized function call: OpenFind<string>(0)
|
|
@@ -1890,9 +1890,11 @@ class CSSLRuntime:
|
|
|
1890
1890
|
return self._eval_this_access(node)
|
|
1891
1891
|
|
|
1892
1892
|
if node.type == 'type_instantiation':
|
|
1893
|
-
# Create new instance of a type: stack<string>, vector<int>, etc.
|
|
1893
|
+
# Create new instance of a type: stack<string>, vector<int>, map<K,V>, etc.
|
|
1894
1894
|
type_name = node.value.get('type')
|
|
1895
1895
|
element_type = node.value.get('element_type', 'dynamic')
|
|
1896
|
+
value_type = node.value.get('value_type') # For map<K, V>
|
|
1897
|
+
init_values = node.value.get('init_values') # For inline init: map<K,V>{...}
|
|
1896
1898
|
|
|
1897
1899
|
if type_name == 'stack':
|
|
1898
1900
|
return Stack(element_type)
|
|
@@ -1916,6 +1918,15 @@ class CSSLRuntime:
|
|
|
1916
1918
|
return List(element_type)
|
|
1917
1919
|
elif type_name in ('dictionary', 'dict'):
|
|
1918
1920
|
return Dictionary(element_type)
|
|
1921
|
+
elif type_name == 'map':
|
|
1922
|
+
# Create Map with key_type and value_type
|
|
1923
|
+
m = Map(element_type, value_type or 'dynamic')
|
|
1924
|
+
# If inline initialization provided, populate the map
|
|
1925
|
+
if init_values:
|
|
1926
|
+
for key, value_node in init_values.items():
|
|
1927
|
+
value = self._evaluate(value_node)
|
|
1928
|
+
m.insert(key, value)
|
|
1929
|
+
return m
|
|
1919
1930
|
else:
|
|
1920
1931
|
return None
|
|
1921
1932
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "IncludeCPP"
|
|
7
|
-
version = "3.7.
|
|
7
|
+
version = "3.7.3"
|
|
8
8
|
description = "Professional C++ Python bindings with type-generic templates, pystubs and native threading"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="IncludeCPP",
|
|
9
|
-
version="3.7.
|
|
9
|
+
version="3.7.3",
|
|
10
10
|
author="Lilias Hatterscheidt",
|
|
11
11
|
author_email="lilias@includecpp.dev",
|
|
12
12
|
description="Professional C++ Python bindings with type-generic templates and native threading",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|