Commit graph

9 commits

Author SHA1 Message Date
3933ce4736
feat: improve error handling in interpreter
Introduced better error handling in the Deuthon interpreter loop by wrapping the code execution in a try-except block to catch and print exceptions using `traceback`. This change also updates the interpreter to only print output when `eval` returns a non-None result, enhancing usability and feedback for the user. The addition of `traceback` provides users with more insightful error messages, helping to debug incorrect German code inputs more effectively.
2024-05-23 14:39:57 +02:00
3f9f941c7a
feat: introduce basic Deuthon type classes
Added a new module defining wrapper classes around Python's fundamental data types in the Deuthon programming language style. This setup paves the way for extending standard types with additional Deuthon-specific functionalities and characteristics in the future. It marks a foundational step in making Deuthon a more feature-rich, Python-compatible language.
2024-05-23 12:52:36 +02:00
31eef48ee4
feat: remove unused setuptools import
Removed an unnecessary import of `setuptools` from `__main__.py`. This cleanup reduces the module's dependencies and potentially decreases startup time, making the codebase more efficient and lightweight. No significant functionality is affected by this change, consistent with our ongoing efforts to streamline the code.
2024-05-23 12:52:16 +02:00
5a69bb0c91
feat: integrate JSON module for sys overrides
Prepares for built-in module overrides by explicitly importing the `json` module within the `prepare_builtin_overrides` function. This approach ensures that any modifications or custom logic applied to the system's version of JSON does not unintentionally conflict with the original module's functionality. The aliasing of the original JSON module under a new name allows for safe manipulation and extension of JSON handling capabilities without affecting the global namespace or existing dependencies that rely on the unmodified JSON module.

This strategic import and module aliasing facilitate future enhancements and potentially complex custom behaviors, ensuring that extensions or modifications are both isolated and reversible, safeguarding the integrity of the application's core functionalities.
2024-05-23 12:51:54 +02:00
fa8e744300
fix: correct default parameter in HTÜPVerbindung __init__
Resolved a minor but crucial bug where the `quelladdresse` parameter's default value in the `HTÜPVerbindung` constructor was mistakenly set to `Nicht`. It has been corrected to `Nichts` (None), ensuring consistency with other default parameter values and preventing potential runtime errors related to type mismatches or unexpected behavior in network operations where a source address is not specified. This fix enhances the robustness of HTTP connections established using our custom wrapper, contributing to more reliable network communication in our applications.
2024-05-23 12:51:22 +02:00
aec8564839
feat(tests): improve type handling in debug output
Updated the debug message in the test suite to use a more explicit type conversion method when displaying the current file name. This change ensures consistency and clarity in type handling within debug messages. By switching to `zeichenkette(__datei__)` for converting the file name to a string, the code becomes more readable and aligns with best practices for type conversion. This adjustment is particularly relevant for maintaining code quality and could help in future troubleshooting or enhancements by making the debug output more predictable and standardized.
2024-05-23 12:45:51 +02:00
e8dd82a6ba
Enhanced HTTP connection handling
Refactored the HTTP wrapper classes to introduce `HTÜPVerbindung`, a new class that supports configurable timeout, source address, and block size for HTTP connections, enhancing flexibility and control for HTTP requests in the Deuthon project. The `HTÜPAntwort` class now focuses solely on reading the response.
2024-01-14 22:06:32 +01:00
f61f72cb1b
Cleanup and standardize string delimiters
Removed unused imports in dictionary initialization and standardized quote usage for string literals in the transformer module. These changes promote code consistency and reduce clutter, making the codebase cleaner and more maintainable. Additionally, includes minor formatting improvements for readability.
2024-01-14 21:43:26 +01:00
6add03fe4e
Initial implementation of Deuthon interpreter
Introduced the Deuthon language interpreter for parsing and executing code written with German-like syntax in Python. Added infrastructure files, including a .gitignore, LICENSE, and pyproject.toml, defining the project setup and metadata. Implemented core modules to handle the language-specific logic, such as token transformations, custom import hooks, and wrappers for standard library modules with German names. This foundation enables the development and testing of Deuthon scripts, laying the groundwork for future enhancements and community contributions.
2024-01-14 19:44:16 +01:00