lclang 0.3.0__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.
- lclang-0.3.0/.gitignore +11 -0
- lclang-0.3.0/AGENTS.md +66 -0
- lclang-0.3.0/CHANGELOG.md +125 -0
- lclang-0.3.0/LICENSE +21 -0
- lclang-0.3.0/PKG-INFO +187 -0
- lclang-0.3.0/README.md +168 -0
- lclang-0.3.0/README_cn.md +145 -0
- lclang-0.3.0/doc_cn/README_cn.md +10 -0
- lclang-0.3.0/doc_cn/cli_cn.md +247 -0
- lclang-0.3.0/doc_cn/configuration_cn.md +83 -0
- lclang-0.3.0/doc_cn/runtime-api_cn.md +108 -0
- lclang-0.3.0/docs/README.md +20 -0
- lclang-0.3.0/docs/architecture/README.md +6 -0
- lclang-0.3.0/docs/architecture/module-layout.md +64 -0
- lclang-0.3.0/docs/architecture/python-file-name-audit.md +267 -0
- lclang-0.3.0/docs/configuration.md +103 -0
- lclang-0.3.0/docs/lcl-lang.md +482 -0
- lclang-0.3.0/docs/reference/runtime-api.md +175 -0
- lclang-0.3.0/docs/specs/M001-product-and-architecture.md +46 -0
- lclang-0.3.0/docs/specs/M002-packaging.md +18 -0
- lclang-0.3.0/docs/specs/M003-quality-tooling.md +25 -0
- lclang-0.3.0/docs/specs/M004-portable-scripts.md +19 -0
- lclang-0.3.0/docs/specs/M005-documentation-layout.md +18 -0
- lclang-0.3.0/docs/specs/M006-foundation-release-gate.md +19 -0
- lclang-0.3.0/docs/specs/M007-rst-docstrings.md +39 -0
- lclang-0.3.0/docs/specs/M008-lclang-identity-and-src-layout.md +29 -0
- lclang-0.3.0/docs/specs/M010-types-and-sources.md +36 -0
- lclang-0.3.0/docs/specs/M011-errors.md +30 -0
- lclang-0.3.0/docs/specs/M012-ast-base.md +27 -0
- lclang-0.3.0/docs/specs/M013-core-lexer.md +39 -0
- lclang-0.3.0/docs/specs/M014-literals.md +41 -0
- lclang-0.3.0/docs/specs/M015-fstrings.md +40 -0
- lclang-0.3.0/docs/specs/M016-expression-ast.md +40 -0
- lclang-0.3.0/docs/specs/M017-pratt-core.md +41 -0
- lclang-0.3.0/docs/specs/M018-parser-primaries.md +35 -0
- lclang-0.3.0/docs/specs/M019-parser-displays.md +37 -0
- lclang-0.3.0/docs/specs/M020-logical-parser.md +36 -0
- lclang-0.3.0/docs/specs/M021-comprehensions.md +41 -0
- lclang-0.3.0/docs/specs/M022-function-error-forms.md +47 -0
- lclang-0.3.0/docs/specs/M023-control-forms.md +44 -0
- lclang-0.3.0/docs/specs/M024-canonical-printer.md +39 -0
- lclang-0.3.0/docs/specs/M025-parser-api.md +40 -0
- lclang-0.3.0/docs/specs/M026-evaluator-core.md +44 -0
- lclang-0.3.0/docs/specs/M027-operations.md +38 -0
- lclang-0.3.0/docs/specs/M028-logical-evaluation.md +36 -0
- lclang-0.3.0/docs/specs/M029-collections.md +56 -0
- lclang-0.3.0/docs/specs/M030-primaries-and-calls.md +42 -0
- lclang-0.3.0/docs/specs/M031-functions.md +45 -0
- lclang-0.3.0/docs/specs/M032-error-control.md +47 -0
- lclang-0.3.0/docs/specs/M033-context-managers.md +48 -0
- lclang-0.3.0/docs/specs/M034-fstrings-and-evaluator-api.md +47 -0
- lclang-0.3.0/docs/specs/M035-frame-cache.md +42 -0
- lclang-0.3.0/docs/specs/M036-parent-lookup.md +35 -0
- lclang-0.3.0/docs/specs/M037-single-flight.md +37 -0
- lclang-0.3.0/docs/specs/M038-cancellation.md +35 -0
- lclang-0.3.0/docs/specs/M039-recalculation.md +45 -0
- lclang-0.3.0/docs/specs/M040-evaluation-limits.md +56 -0
- lclang-0.3.0/docs/specs/M041-frame-close.md +50 -0
- lclang-0.3.0/docs/specs/M042-static-dependencies.md +51 -0
- lclang-0.3.0/docs/specs/M043-dependency-graph.md +52 -0
- lclang-0.3.0/docs/specs/M044-dynamic-dependencies.md +61 -0
- lclang-0.3.0/docs/specs/M045-frame-dependencies.md +60 -0
- lclang-0.3.0/docs/specs/M046-presets-and-factories.md +52 -0
- lclang-0.3.0/docs/specs/M047-stdlib-manifests.md +49 -0
- lclang-0.3.0/docs/specs/M048-stdlib-helpers.md +52 -0
- lclang-0.3.0/docs/specs/M049-runtime-public-api.md +45 -0
- lclang-0.3.0/docs/specs/M050-runtime-documentation.md +47 -0
- lclang-0.3.0/docs/specs/M051-runtime-release.md +178 -0
- lclang-0.3.0/docs/specs/M052-jihulab-ci-pipeline.md +49 -0
- lclang-0.3.0/docs/specs/M052-recursive-functional-programs.md +46 -0
- lclang-0.3.0/docs/specs/M053-frame-hierarchy-shortcuts.md +104 -0
- lclang-0.3.0/docs/specs/M054-definition-context-dates-frame-graph.md +94 -0
- lclang-0.3.0/docs/specs/M055-api-ergonomics-module-layout.md +90 -0
- lclang-0.3.0/docs/specs/M056-frame-inspection-package.md +98 -0
- lclang-0.3.0/docs/specs/M057-inspection-dependency-deduplication.md +41 -0
- lclang-0.3.0/docs/specs/M058-inspection-representation.md +59 -0
- lclang-0.3.0/docs/specs/M060-config-model.md +45 -0
- lclang-0.3.0/docs/specs/M061-config-lines.md +45 -0
- lclang-0.3.0/docs/specs/M062-config-comments.md +41 -0
- lclang-0.3.0/docs/specs/M063-config-definitions.md +47 -0
- lclang-0.3.0/docs/specs/M064-config-memory-sources.md +47 -0
- lclang-0.3.0/docs/specs/M065-config-includes.md +47 -0
- lclang-0.3.0/docs/specs/M066-config-precedence.md +46 -0
- lclang-0.3.0/docs/specs/M067-config-origins.md +48 -0
- lclang-0.3.0/docs/specs/M068-config-include-cycles.md +43 -0
- lclang-0.3.0/docs/specs/M069-config-versions-diagnostics.md +46 -0
- lclang-0.3.0/docs/specs/M070-config-public-api.md +46 -0
- lclang-0.3.0/docs/specs/M071-config-stress.md +43 -0
- lclang-0.3.0/docs/specs/M072-config-release.md +60 -0
- lclang-0.3.0/docs/specs/M080-cli-contract.md +48 -0
- lclang-0.3.0/docs/specs/M081-cli-context.md +46 -0
- lclang-0.3.0/docs/specs/M082-cli-entrances.md +47 -0
- lclang-0.3.0/docs/specs/M083-cli-fixed-arity.md +51 -0
- lclang-0.3.0/docs/specs/M084-cli-routing.md +43 -0
- lclang-0.3.0/docs/specs/M085-cli-help.md +46 -0
- lclang-0.3.0/docs/specs/M086-cli-frame-construction.md +52 -0
- lclang-0.3.0/docs/specs/M087-cli-run.md +51 -0
- lclang-0.3.0/docs/specs/M088-cli-dry-run.md +41 -0
- lclang-0.3.0/docs/specs/M089-cli-builtins.md +41 -0
- lclang-0.3.0/docs/specs/M090-cli-entry-points.md +41 -0
- lclang-0.3.0/docs/specs/M091-cli-platform-tests.md +47 -0
- lclang-0.3.0/docs/specs/M092-cli-release.md +62 -0
- lclang-0.3.0/docs/specs/M093-cli-module-commands.md +65 -0
- lclang-0.3.0/docs/specs/M094-cli-literal-host-overrides.md +53 -0
- lclang-0.3.0/docs/specs/M095-native-inspection-values.md +64 -0
- lclang-0.3.0/docs/specs/M096-builtin-repr-evaluation-stack.md +75 -0
- lclang-0.3.0/docs/specs/M097-boolean-overrides-evaluated-inspection.md +62 -0
- lclang-0.3.0/docs/specs/M098-ast-value-inspection-repr.md +63 -0
- lclang-0.3.0/docs/specs/M099-cli-builtins-command.md +50 -0
- lclang-0.3.0/docs/specs/M601-execution-status.md +75 -0
- lclang-0.3.0/docs/specs/M602-scoped-steps.md +56 -0
- lclang-0.3.0/docs/specs/TEMPLATE.md +24 -0
- lclang-0.3.0/docs/tutorials/README.md +105 -0
- lclang-0.3.0/docs/tutorials/cli.md +300 -0
- lclang-0.3.0/docs/tutorials/config_file.md +248 -0
- lclang-0.3.0/docs/tutorials/dependency-analytics.md +287 -0
- lclang-0.3.0/docs/tutorials/lcl_examples.md +485 -0
- lclang-0.3.0/docs/tutorials/runtime.md +401 -0
- lclang-0.3.0/docs/tutorials/workflow-status.md +127 -0
- lclang-0.3.0/progress.md +456 -0
- lclang-0.3.0/pyproject.toml +100 -0
- lclang-0.3.0/src/lclang/__init__.py +80 -0
- lclang-0.3.0/src/lclang/_version.py +3 -0
- lclang-0.3.0/src/lclang/api.py +155 -0
- lclang-0.3.0/src/lclang/ast/__init__.py +83 -0
- lclang-0.3.0/src/lclang/ast/atoms.py +69 -0
- lclang-0.3.0/src/lclang/ast/base.py +76 -0
- lclang-0.3.0/src/lclang/ast/call_arguments.py +119 -0
- lclang-0.3.0/src/lclang/ast/comprehensions.py +140 -0
- lclang-0.3.0/src/lclang/ast/control_forms.py +155 -0
- lclang-0.3.0/src/lclang/ast/displays.py +150 -0
- lclang-0.3.0/src/lclang/ast/expressions.py +187 -0
- lclang-0.3.0/src/lclang/ast/forms.py +138 -0
- lclang-0.3.0/src/lclang/ast/fstrings.py +95 -0
- lclang-0.3.0/src/lclang/ast/operators.py +68 -0
- lclang-0.3.0/src/lclang/ast/primaries.py +154 -0
- lclang-0.3.0/src/lclang/cli/__init__.py +28 -0
- lclang-0.3.0/src/lclang/cli/__main__.py +8 -0
- lclang-0.3.0/src/lclang/cli/application.py +78 -0
- lclang-0.3.0/src/lclang/cli/binding.py +160 -0
- lclang-0.3.0/src/lclang/cli/builtin_docs.py +115 -0
- lclang-0.3.0/src/lclang/cli/commands.py +193 -0
- lclang-0.3.0/src/lclang/cli/context.py +45 -0
- lclang-0.3.0/src/lclang/cli/entrance.py +49 -0
- lclang-0.3.0/src/lclang/cli/help.py +120 -0
- lclang-0.3.0/src/lclang/cli/logging.py +97 -0
- lclang-0.3.0/src/lclang/cli/models.py +210 -0
- lclang-0.3.0/src/lclang/cli/parser.py +207 -0
- lclang-0.3.0/src/lclang/cli/process.py +48 -0
- lclang-0.3.0/src/lclang/cli/routing.py +104 -0
- lclang-0.3.0/src/lclang/cli/run.py +197 -0
- lclang-0.3.0/src/lclang/cli/validation.py +92 -0
- lclang-0.3.0/src/lclang/config/__init__.py +43 -0
- lclang-0.3.0/src/lclang/config/api.py +74 -0
- lclang-0.3.0/src/lclang/config/declarations.py +124 -0
- lclang-0.3.0/src/lclang/config/errors.py +63 -0
- lclang-0.3.0/src/lclang/config/expressions.py +123 -0
- lclang-0.3.0/src/lclang/config/files.py +79 -0
- lclang-0.3.0/src/lclang/config/limits.py +41 -0
- lclang-0.3.0/src/lclang/config/lines.py +160 -0
- lclang-0.3.0/src/lclang/config/loader.py +196 -0
- lclang-0.3.0/src/lclang/config/model.py +114 -0
- lclang-0.3.0/src/lclang/config/parser.py +137 -0
- lclang-0.3.0/src/lclang/config/positions.py +79 -0
- lclang-0.3.0/src/lclang/config/protocols.py +34 -0
- lclang-0.3.0/src/lclang/config/result.py +91 -0
- lclang-0.3.0/src/lclang/config/sources.py +109 -0
- lclang-0.3.0/src/lclang/errors.py +172 -0
- lclang-0.3.0/src/lclang/lang/__init__.py +16 -0
- lclang-0.3.0/src/lclang/lang/evaluator/__init__.py +15 -0
- lclang-0.3.0/src/lclang/lang/evaluator/_types.py +8 -0
- lclang-0.3.0/src/lclang/lang/evaluator/awaitables.py +23 -0
- lclang-0.3.0/src/lclang/lang/evaluator/budget.py +137 -0
- lclang-0.3.0/src/lclang/lang/evaluator/calls.py +93 -0
- lclang-0.3.0/src/lclang/lang/evaluator/comprehensions.py +164 -0
- lclang-0.3.0/src/lclang/lang/evaluator/context.py +90 -0
- lclang-0.3.0/src/lclang/lang/evaluator/contexts.py +108 -0
- lclang-0.3.0/src/lclang/lang/evaluator/definition_context.py +76 -0
- lclang-0.3.0/src/lclang/lang/evaluator/dispatch.py +180 -0
- lclang-0.3.0/src/lclang/lang/evaluator/displays.py +107 -0
- lclang-0.3.0/src/lclang/lang/evaluator/errors.py +157 -0
- lclang-0.3.0/src/lclang/lang/evaluator/fstrings.py +69 -0
- lclang-0.3.0/src/lclang/lang/evaluator/function_arguments.py +138 -0
- lclang-0.3.0/src/lclang/lang/evaluator/functions.py +115 -0
- lclang-0.3.0/src/lclang/lang/evaluator/iteration.py +27 -0
- lclang-0.3.0/src/lclang/lang/evaluator/logical.py +71 -0
- lclang-0.3.0/src/lclang/lang/evaluator/operations.py +105 -0
- lclang-0.3.0/src/lclang/lang/evaluator/primaries.py +70 -0
- lclang-0.3.0/src/lclang/lang/evaluator/sync.py +32 -0
- lclang-0.3.0/src/lclang/lang/lexer/__init__.py +6 -0
- lclang-0.3.0/src/lclang/lang/lexer/escapes.py +191 -0
- lclang-0.3.0/src/lclang/lang/lexer/fstring_values.py +67 -0
- lclang-0.3.0/src/lclang/lang/lexer/fstrings.py +301 -0
- lclang-0.3.0/src/lclang/lang/lexer/literals.py +200 -0
- lclang-0.3.0/src/lclang/lang/lexer/scanner.py +290 -0
- lclang-0.3.0/src/lclang/lang/lexer/tokens.py +95 -0
- lclang-0.3.0/src/lclang/lang/parser/__init__.py +5 -0
- lclang-0.3.0/src/lclang/lang/parser/atoms.py +101 -0
- lclang-0.3.0/src/lclang/lang/parser/bindings.py +21 -0
- lclang-0.3.0/src/lclang/lang/parser/comprehensions.py +112 -0
- lclang-0.3.0/src/lclang/lang/parser/control_forms.py +191 -0
- lclang-0.3.0/src/lclang/lang/parser/displays.py +311 -0
- lclang-0.3.0/src/lclang/lang/parser/forms.py +230 -0
- lclang-0.3.0/src/lclang/lang/parser/fstrings.py +97 -0
- lclang-0.3.0/src/lclang/lang/parser/logical.py +268 -0
- lclang-0.3.0/src/lclang/lang/parser/pratt.py +222 -0
- lclang-0.3.0/src/lclang/lang/parser/primaries.py +294 -0
- lclang-0.3.0/src/lclang/lang/parser/stream.py +100 -0
- lclang-0.3.0/src/lclang/lang/printer/__init__.py +5 -0
- lclang-0.3.0/src/lclang/lang/printer/_types.py +8 -0
- lclang-0.3.0/src/lclang/lang/printer/atoms.py +105 -0
- lclang-0.3.0/src/lclang/lang/printer/collections.py +133 -0
- lclang-0.3.0/src/lclang/lang/printer/dispatch.py +56 -0
- lclang-0.3.0/src/lclang/lang/printer/expressions.py +102 -0
- lclang-0.3.0/src/lclang/lang/printer/forms.py +114 -0
- lclang-0.3.0/src/lclang/lang/printer/primaries.py +104 -0
- lclang-0.3.0/src/lclang/py.typed +1 -0
- lclang-0.3.0/src/lclang/runtime/__init__.py +57 -0
- lclang-0.3.0/src/lclang/runtime/dependency/__init__.py +1 -0
- lclang-0.3.0/src/lclang/runtime/dependency/analysis.py +201 -0
- lclang-0.3.0/src/lclang/runtime/dependency/frame/__init__.py +1 -0
- lclang-0.3.0/src/lclang/runtime/dependency/frame/builder.py +144 -0
- lclang-0.3.0/src/lclang/runtime/dependency/frame/model.py +199 -0
- lclang-0.3.0/src/lclang/runtime/dependency/frame/resolution.py +83 -0
- lclang-0.3.0/src/lclang/runtime/dependency/graph.py +185 -0
- lclang-0.3.0/src/lclang/runtime/dependency/model.py +80 -0
- lclang-0.3.0/src/lclang/runtime/dependency/ordering.py +120 -0
- lclang-0.3.0/src/lclang/runtime/dependency/reconciliation.py +64 -0
- lclang-0.3.0/src/lclang/runtime/dependency/snapshot.py +46 -0
- lclang-0.3.0/src/lclang/runtime/dependency/tracing.py +97 -0
- lclang-0.3.0/src/lclang/runtime/frame/__init__.py +17 -0
- lclang-0.3.0/src/lclang/runtime/frame/closing.py +48 -0
- lclang-0.3.0/src/lclang/runtime/frame/core.py +135 -0
- lclang-0.3.0/src/lclang/runtime/frame/dependencies.py +129 -0
- lclang-0.3.0/src/lclang/runtime/frame/derivation.py +49 -0
- lclang-0.3.0/src/lclang/runtime/frame/evaluation.py +144 -0
- lclang-0.3.0/src/lclang/runtime/frame/factory.py +103 -0
- lclang-0.3.0/src/lclang/runtime/frame/flights.py +54 -0
- lclang-0.3.0/src/lclang/runtime/frame/inspection.py +169 -0
- lclang-0.3.0/src/lclang/runtime/frame/inspector.py +190 -0
- lclang-0.3.0/src/lclang/runtime/frame/lifecycle.py +144 -0
- lclang-0.3.0/src/lclang/runtime/frame/limits.py +87 -0
- lclang-0.3.0/src/lclang/runtime/frame/lookup.py +81 -0
- lclang-0.3.0/src/lclang/runtime/frame/recalculation.py +60 -0
- lclang-0.3.0/src/lclang/runtime/frame/values.py +68 -0
- lclang-0.3.0/src/lclang/runtime/modules.py +38 -0
- lclang-0.3.0/src/lclang/runtime/presets.py +56 -0
- lclang-0.3.0/src/lclang/source.py +93 -0
- lclang-0.3.0/src/lclang/stdlib/__init__.py +29 -0
- lclang-0.3.0/src/lclang/stdlib/builtins.py +45 -0
- lclang-0.3.0/src/lclang/stdlib/data.py +41 -0
- lclang-0.3.0/src/lclang/stdlib/dates.py +36 -0
- lclang-0.3.0/src/lclang/stdlib/iterables.py +34 -0
- lclang-0.3.0/src/lclang/stdlib/json_values.py +41 -0
- lclang-0.3.0/src/lclang/stdlib/manifest.py +89 -0
- lclang-0.3.0/src/lclang/stdlib/namespaces.py +106 -0
- lclang-0.3.0/src/lclang/stdlib/recursion.py +64 -0
- lclang-0.3.0/src/lclang/stdlib/text.py +44 -0
- lclang-0.3.0/src/lclang/types.py +15 -0
- lclang-0.3.0/src/lclang/version.py +17 -0
- lclang-0.3.0/src/lclang/workflow/__init__.py +13 -0
- lclang-0.3.0/src/lclang/workflow/finalization.py +107 -0
- lclang-0.3.0/src/lclang/workflow/manager.py +164 -0
- lclang-0.3.0/src/lclang/workflow/models.py +125 -0
- lclang-0.3.0/src/lclang/workflow/steps.py +102 -0
- lclang-0.3.0/tests/__init__.py +1 -0
- lclang-0.3.0/tests/ast/__init__.py +1 -0
- lclang-0.3.0/tests/ast/test_base.py +46 -0
- lclang-0.3.0/tests/ast/test_call_arguments.py +40 -0
- lclang-0.3.0/tests/ast/test_comprehensions.py +56 -0
- lclang-0.3.0/tests/ast/test_control_forms.py +52 -0
- lclang-0.3.0/tests/ast/test_displays.py +33 -0
- lclang-0.3.0/tests/ast/test_expressions.py +57 -0
- lclang-0.3.0/tests/ast/test_forms.py +41 -0
- lclang-0.3.0/tests/ast/test_fstrings.py +37 -0
- lclang-0.3.0/tests/ast/test_operators.py +17 -0
- lclang-0.3.0/tests/ast/test_primaries.py +30 -0
- lclang-0.3.0/tests/cli/__init__.py +1 -0
- lclang-0.3.0/tests/cli/platform_support.py +69 -0
- lclang-0.3.0/tests/cli/test_binding.py +148 -0
- lclang-0.3.0/tests/cli/test_builtin_docs.py +88 -0
- lclang-0.3.0/tests/cli/test_commands.py +163 -0
- lclang-0.3.0/tests/cli/test_context_entrance.py +68 -0
- lclang-0.3.0/tests/cli/test_logging.py +47 -0
- lclang-0.3.0/tests/cli/test_models.py +98 -0
- lclang-0.3.0/tests/cli/test_module_entrance.py +351 -0
- lclang-0.3.0/tests/cli/test_parser.py +141 -0
- lclang-0.3.0/tests/cli/test_platform.py +97 -0
- lclang-0.3.0/tests/cli/test_process.py +32 -0
- lclang-0.3.0/tests/cli/test_public_api.py +25 -0
- lclang-0.3.0/tests/cli/test_routing_help.py +91 -0
- lclang-0.3.0/tests/cli/test_run.py +343 -0
- lclang-0.3.0/tests/cli/test_tutorial.py +35 -0
- lclang-0.3.0/tests/cli/test_validation.py +24 -0
- lclang-0.3.0/tests/config/support.py +43 -0
- lclang-0.3.0/tests/config/test_api.py +99 -0
- lclang-0.3.0/tests/config/test_documentation.py +42 -0
- lclang-0.3.0/tests/config/test_files.py +29 -0
- lclang-0.3.0/tests/config/test_limits.py +12 -0
- lclang-0.3.0/tests/config/test_lines.py +39 -0
- lclang-0.3.0/tests/config/test_loader.py +309 -0
- lclang-0.3.0/tests/config/test_model.py +33 -0
- lclang-0.3.0/tests/config/test_parser.py +126 -0
- lclang-0.3.0/tests/config/test_sources.py +43 -0
- lclang-0.3.0/tests/config/test_stress.py +83 -0
- lclang-0.3.0/tests/lang/__init__.py +1 -0
- lclang-0.3.0/tests/lang/evaluator/__init__.py +1 -0
- lclang-0.3.0/tests/lang/evaluator/context_support.py +81 -0
- lclang-0.3.0/tests/lang/evaluator/test_awaitables.py +25 -0
- lclang-0.3.0/tests/lang/evaluator/test_budget.py +16 -0
- lclang-0.3.0/tests/lang/evaluator/test_calls.py +139 -0
- lclang-0.3.0/tests/lang/evaluator/test_comprehensions.py +184 -0
- lclang-0.3.0/tests/lang/evaluator/test_context.py +40 -0
- lclang-0.3.0/tests/lang/evaluator/test_contexts.py +143 -0
- lclang-0.3.0/tests/lang/evaluator/test_definition_context.py +83 -0
- lclang-0.3.0/tests/lang/evaluator/test_dispatch.py +84 -0
- lclang-0.3.0/tests/lang/evaluator/test_displays.py +85 -0
- lclang-0.3.0/tests/lang/evaluator/test_errors.py +188 -0
- lclang-0.3.0/tests/lang/evaluator/test_fstrings.py +73 -0
- lclang-0.3.0/tests/lang/evaluator/test_function_arguments.py +63 -0
- lclang-0.3.0/tests/lang/evaluator/test_functions.py +164 -0
- lclang-0.3.0/tests/lang/evaluator/test_iteration.py +75 -0
- lclang-0.3.0/tests/lang/evaluator/test_logical.py +104 -0
- lclang-0.3.0/tests/lang/evaluator/test_operations.py +139 -0
- lclang-0.3.0/tests/lang/evaluator/test_primaries.py +72 -0
- lclang-0.3.0/tests/lang/evaluator/test_sync.py +32 -0
- lclang-0.3.0/tests/lang/lexer/__init__.py +1 -0
- lclang-0.3.0/tests/lang/lexer/test_escapes.py +21 -0
- lclang-0.3.0/tests/lang/lexer/test_fstring_values.py +15 -0
- lclang-0.3.0/tests/lang/lexer/test_fstrings.py +111 -0
- lclang-0.3.0/tests/lang/lexer/test_literals.py +135 -0
- lclang-0.3.0/tests/lang/lexer/test_scanner.py +126 -0
- lclang-0.3.0/tests/lang/lexer/test_tokens.py +26 -0
- lclang-0.3.0/tests/lang/parser/__init__.py +1 -0
- lclang-0.3.0/tests/lang/parser/test_atoms.py +56 -0
- lclang-0.3.0/tests/lang/parser/test_comprehensions.py +113 -0
- lclang-0.3.0/tests/lang/parser/test_control_forms.py +86 -0
- lclang-0.3.0/tests/lang/parser/test_displays.py +91 -0
- lclang-0.3.0/tests/lang/parser/test_forms.py +87 -0
- lclang-0.3.0/tests/lang/parser/test_fstrings.py +69 -0
- lclang-0.3.0/tests/lang/parser/test_logical.py +97 -0
- lclang-0.3.0/tests/lang/parser/test_pratt.py +86 -0
- lclang-0.3.0/tests/lang/parser/test_primaries.py +107 -0
- lclang-0.3.0/tests/lang/parser/test_stream.py +52 -0
- lclang-0.3.0/tests/lang/printer/__init__.py +1 -0
- lclang-0.3.0/tests/lang/printer/test_atoms.py +59 -0
- lclang-0.3.0/tests/lang/printer/test_collections.py +34 -0
- lclang-0.3.0/tests/lang/printer/test_dispatch.py +28 -0
- lclang-0.3.0/tests/lang/printer/test_expressions.py +27 -0
- lclang-0.3.0/tests/lang/printer/test_forms.py +30 -0
- lclang-0.3.0/tests/lang/printer/test_primaries.py +43 -0
- lclang-0.3.0/tests/release/__init__.py +1 -0
- lclang-0.3.0/tests/release/support.py +60 -0
- lclang-0.3.0/tests/release/test_artifacts.py +49 -0
- lclang-0.3.0/tests/release/test_clean_install.py +26 -0
- lclang-0.3.0/tests/release/test_release_candidate.py +39 -0
- lclang-0.3.0/tests/runtime/__init__.py +1 -0
- lclang-0.3.0/tests/runtime/dependency/__init__.py +1 -0
- lclang-0.3.0/tests/runtime/dependency/frame/__init__.py +1 -0
- lclang-0.3.0/tests/runtime/dependency/frame/test_builder.py +144 -0
- lclang-0.3.0/tests/runtime/dependency/frame/test_model.py +138 -0
- lclang-0.3.0/tests/runtime/dependency/test_analysis.py +125 -0
- lclang-0.3.0/tests/runtime/dependency/test_graph.py +74 -0
- lclang-0.3.0/tests/runtime/dependency/test_model.py +55 -0
- lclang-0.3.0/tests/runtime/dependency/test_ordering.py +76 -0
- lclang-0.3.0/tests/runtime/dependency/test_reconciliation.py +72 -0
- lclang-0.3.0/tests/runtime/dependency/test_snapshot.py +55 -0
- lclang-0.3.0/tests/runtime/dependency/test_tracing.py +71 -0
- lclang-0.3.0/tests/runtime/frame/__init__.py +1 -0
- lclang-0.3.0/tests/runtime/frame/lifecycle_support.py +71 -0
- lclang-0.3.0/tests/runtime/frame/test_cancellation.py +58 -0
- lclang-0.3.0/tests/runtime/frame/test_core.py +200 -0
- lclang-0.3.0/tests/runtime/frame/test_dependencies.py +146 -0
- lclang-0.3.0/tests/runtime/frame/test_derivation.py +76 -0
- lclang-0.3.0/tests/runtime/frame/test_factory.py +117 -0
- lclang-0.3.0/tests/runtime/frame/test_flights.py +138 -0
- lclang-0.3.0/tests/runtime/frame/test_inspection.py +459 -0
- lclang-0.3.0/tests/runtime/frame/test_integration_comprehensions.py +32 -0
- lclang-0.3.0/tests/runtime/frame/test_lifecycle.py +171 -0
- lclang-0.3.0/tests/runtime/frame/test_limits.py +119 -0
- lclang-0.3.0/tests/runtime/frame/test_lookup.py +67 -0
- lclang-0.3.0/tests/runtime/frame/test_recalculation.py +152 -0
- lclang-0.3.0/tests/runtime/frame/test_recalculation_flights.py +104 -0
- lclang-0.3.0/tests/runtime/frame/test_values.py +78 -0
- lclang-0.3.0/tests/runtime/test_modules.py +36 -0
- lclang-0.3.0/tests/runtime/test_presets.py +56 -0
- lclang-0.3.0/tests/stdlib/test_builtins.py +61 -0
- lclang-0.3.0/tests/stdlib/test_data.py +35 -0
- lclang-0.3.0/tests/stdlib/test_dates.py +52 -0
- lclang-0.3.0/tests/stdlib/test_iterables.py +64 -0
- lclang-0.3.0/tests/stdlib/test_json_values.py +24 -0
- lclang-0.3.0/tests/stdlib/test_manifest.py +46 -0
- lclang-0.3.0/tests/stdlib/test_namespaces.py +92 -0
- lclang-0.3.0/tests/stdlib/test_recursion.py +99 -0
- lclang-0.3.0/tests/stdlib/test_text.py +38 -0
- lclang-0.3.0/tests/test_api.py +167 -0
- lclang-0.3.0/tests/test_errors.py +67 -0
- lclang-0.3.0/tests/test_package_metadata.py +48 -0
- lclang-0.3.0/tests/test_public_api.py +20 -0
- lclang-0.3.0/tests/test_quality_configuration.py +90 -0
- lclang-0.3.0/tests/test_quality_script.py +127 -0
- lclang-0.3.0/tests/test_runtime_public_api.py +69 -0
- lclang-0.3.0/tests/test_types_and_sources.py +61 -0
- lclang-0.3.0/tests/workflow/test_public_api.py +14 -0
- lclang-0.3.0/tests/workflow/test_status.py +218 -0
- lclang-0.3.0/tests/workflow/test_step_scope.py +110 -0
- lclang-0.3.0/tests/workflow/test_tutorial.py +29 -0
lclang-0.3.0/.gitignore
ADDED
lclang-0.3.0/AGENTS.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# lclang Agent Handoff
|
|
2
|
+
|
|
3
|
+
Read this file, `progress.md`, the active milestone specification, and both
|
|
4
|
+
README files before changing the project.
|
|
5
|
+
|
|
6
|
+
## Project identity
|
|
7
|
+
|
|
8
|
+
- Distribution and import name: `lclang`.
|
|
9
|
+
- Production package root: `src/lclang`.
|
|
10
|
+
- Runtime: Python 3.14 or newer; no third-party runtime dependencies.
|
|
11
|
+
- License: MIT.
|
|
12
|
+
- Target: complete and verify the 0.4 release described in `progress.md`.
|
|
13
|
+
- Security model: trusted configuration language, not a hostile-code sandbox.
|
|
14
|
+
|
|
15
|
+
## Non-negotiable architecture
|
|
16
|
+
|
|
17
|
+
- The parser is a pure-Python lexer plus Pratt/recursive-descent parser.
|
|
18
|
+
- Execution uses the custom AST interpreter only. Do not add ANTLR, Java,
|
|
19
|
+
`eval`, `exec`, Python-AST compilation, or a bytecode backend.
|
|
20
|
+
- Public evaluation is async-first. `evaluate_sync` is the only synchronous
|
|
21
|
+
convenience boundary.
|
|
22
|
+
- No class or function name can start with an underscore.
|
|
23
|
+
- A `Frame` is safe for concurrent tasks in one event loop, not across loops.
|
|
24
|
+
- Cached values are snapshots. Recalculation never invalidates dependants.
|
|
25
|
+
- Source files must stay below 200 lines, excluding docstrings and imports. Split modules by responsibility.
|
|
26
|
+
- Every production docstring is English rST. All functions and methods (including private ones)
|
|
27
|
+
document how it works, and every parameter with `:param name:`, their result with `:returns:` unless no return or `None`,
|
|
28
|
+
every intentional exception with `:raises Type:`, and genuinely useful special
|
|
29
|
+
behaviour with an rST `.. note::`. Do not add notes that merely restate the
|
|
30
|
+
declaration, owning subsystem, or ordinary lifecycle. All value classes
|
|
31
|
+
(including private ones) document constructor fields
|
|
32
|
+
and edge cases with the same conventions.
|
|
33
|
+
- A Comment for each constant values to describe it.
|
|
34
|
+
- In unittest, mock any external connectivities, and use separated TemporaryDirectory to hold file input and outputs.
|
|
35
|
+
- CLI unittest configuration sources are static fixtures declared with their test
|
|
36
|
+
cases. Every enabled log file is rooted in a per-test temporary directory that
|
|
37
|
+
is cleaned automatically.
|
|
38
|
+
|
|
39
|
+
Runtime packages and tests follow `docs/architecture/module-layout.md`. Tests
|
|
40
|
+
mirror production subsystem boundaries; reusable fixtures live in dedicated
|
|
41
|
+
support modules rather than unrelated test files.
|
|
42
|
+
|
|
43
|
+
## Required workflow
|
|
44
|
+
|
|
45
|
+
For every implementation milestone:
|
|
46
|
+
|
|
47
|
+
1. Write or update its English specification in `docs/specs/`.
|
|
48
|
+
2. Add a behavioural test and run it to prove RED, test must include practical and meaningful sunny, rainy, composite-complex cases.
|
|
49
|
+
3. Implement the smallest correct behaviour and prove GREEN.
|
|
50
|
+
4. Refactor, then run milestone and full quality checks.
|
|
51
|
+
5. Update `README.md`, `README_cn.md`, and `progress.md`.
|
|
52
|
+
6. Mark `DONE` only with commands and evidence recorded in `progress.md`.
|
|
53
|
+
|
|
54
|
+
For a bug, reproduce it with a failing test before fixing it. Documentation-only
|
|
55
|
+
milestones use link, metadata, or structural checks rather than artificial unit
|
|
56
|
+
test failures.
|
|
57
|
+
|
|
58
|
+
## Sources of truth
|
|
59
|
+
|
|
60
|
+
- `progress.md`: current work, status, evidence, and release gates.
|
|
61
|
+
- `docs/specs/`: behaviour and public contracts.
|
|
62
|
+
- `README.md` and `README_cn.md`: user-visible implemented capability only.
|
|
63
|
+
- `pyproject.toml`: supported Python and tool configuration.
|
|
64
|
+
|
|
65
|
+
Do not advertise planned behaviour as implemented. Preserve unrelated user
|
|
66
|
+
changes. Update this file only when durable architecture or workflow changes.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- Renamed the distribution and import package to `lclang`, moved production
|
|
6
|
+
code to `src/lclang`, and migrated packaging, CI, tests, and documentation.
|
|
7
|
+
- Added ordered workflow execution-status trees, shared sub-task manager cursors,
|
|
8
|
+
deterministic parent aggregation, subtree locking, and synchronous scoped
|
|
9
|
+
finalization that records exceptions without suppressing them.
|
|
10
|
+
- Added scoped step handles that begin running, accept atomic description/status
|
|
11
|
+
updates, succeed on clean exit, and record errors without suppressing them.
|
|
12
|
+
- Raised the enforced project gate to 100% branch coverage and added behavioral
|
|
13
|
+
assertions for every previously uncovered statement and branch.
|
|
14
|
+
- Manually malformed call, dictionary-display, and dictionary-comprehension AST
|
|
15
|
+
wrapper values now fail explicitly instead of being silently ignored.
|
|
16
|
+
|
|
17
|
+
## 0.3.0 release candidate — 2026-08-09
|
|
18
|
+
|
|
19
|
+
- Added immutable CLI parameters, results, contexts, and logging configuration
|
|
20
|
+
through the focused `lclang.cli` public API without expanding the package root.
|
|
21
|
+
- Added exact async command decorators, nested snake_case groups, full Python
|
|
22
|
+
executable/script argv parsing, command routing, and dependency-free structured help.
|
|
23
|
+
- Added lazy preset/default/config/override/runtime Frame layering, strict as-of
|
|
24
|
+
dates, literal and deferred `LCL[...]` overrides, required presence checks,
|
|
25
|
+
handler-owned dryrun behavior, isolated UTF-8 logging, and deterministic cleanup.
|
|
26
|
+
- Added executable English and Chinese Python-script CLI tutorials, static config
|
|
27
|
+
fixture guidance, temporary-log testing, platform cases, and clean-install CLI smokes.
|
|
28
|
+
- Added `CliResult.success`/`fail` shortcuts and executable `python -m lclang.cli`
|
|
29
|
+
commands for non-evaluating `RESULT` inspection and lazy result evaluation.
|
|
30
|
+
- Literal and malformed-marker CLI overrides now remain external-provided string
|
|
31
|
+
bindings; only successfully parsed `LCL[...]` values become lazy definitions.
|
|
32
|
+
- Dependency inspection now classifies canonical reviewed builtins/namespaces as
|
|
33
|
+
`NativeProvided`, with stable address-free callable and concise namespace reprs.
|
|
34
|
+
- Native inspection payloads now use uniform `Builtin Function: name` and
|
|
35
|
+
`Builtin Namespace: name` syntax. Structured evaluation failures include the
|
|
36
|
+
direct-to-failing variable owner stack, including lexical LCL function calls.
|
|
37
|
+
- Valueless `-o/--override KEY` now stores boolean `True`, and a following
|
|
38
|
+
override option can no longer be consumed as a value. `parse_lcl -o EVAL`
|
|
39
|
+
evaluates `RESULT` first and renders either its successful or failed cache tree.
|
|
40
|
+
- Dependency-tree values that are supported `LclAstNode` objects or evaluated
|
|
41
|
+
LCL function closures now render with canonical LCL expressions instead of
|
|
42
|
+
nested dataclass, closure, resolver, evaluator, and source-span reprs.
|
|
43
|
+
- Added the native `recursive(builder)` builtin, a Python variadic eager Z
|
|
44
|
+
combinator for defining recursive LCL functions without supplying an LCL
|
|
45
|
+
combinator; its results use stable `Recursive Function: <source-or-name>`
|
|
46
|
+
reprs, and the original LCL Y/Z examples remain supported and documented.
|
|
47
|
+
- Added `python -m lclang.cli builtins` with sorted one-line descriptions and
|
|
48
|
+
manifest-ordered, two-space-indented methods beneath builtin namespaces.
|
|
49
|
+
- Iterable items are now recursively awaited at the shared sync/async iteration
|
|
50
|
+
boundary, fixing Python `map` with async LCL functions in starred displays,
|
|
51
|
+
comprehensions, call expansion, and reviewed iterable helpers.
|
|
52
|
+
|
|
53
|
+
## 0.2.0 release candidate — 2026-08-08
|
|
54
|
+
|
|
55
|
+
- `Frame` now accepts a string or omitted ID, defaulting direct construction to
|
|
56
|
+
`frame-<module name>`, and the complete subsystem now lives under
|
|
57
|
+
`lclang.runtime.frame`.
|
|
58
|
+
- Added side-effect-free `Frame.inspect_variable()` trees with cache/host state,
|
|
59
|
+
selected definitions, exact lookup paths, owners, dependency branches,
|
|
60
|
+
finite cycle rendering, compact reprs, and markdown-style lines.
|
|
61
|
+
- Inspection trees now collapse repeated direct dependency names in first-seen
|
|
62
|
+
order while retaining the same variable independently on separate branches;
|
|
63
|
+
graphs, traces, and snapshots remain occurrence-preserving.
|
|
64
|
+
- Refined inspection's source-oriented repr to
|
|
65
|
+
`name@frame/path: [definition ](Status) typed-payload`: ASTs have clear status
|
|
66
|
+
spacing, external values omit definition text, values render as `type: repr`,
|
|
67
|
+
and errors render as `ErrorType: message`.
|
|
68
|
+
- Made `lhs()` lexical inside LCL function values, so call arguments retain the
|
|
69
|
+
caller owner while function bodies retain their defining variable name.
|
|
70
|
+
- `evaluate_sync` now accepts expression source text directly, and
|
|
71
|
+
`FrameFactory.create()` defaults its ID to `frame-<module name>`.
|
|
72
|
+
- Added a complete dependency analytics tutorial and reorganized internal
|
|
73
|
+
analytics into `runtime/dependency/`, including nested Frame graph modules;
|
|
74
|
+
redundant evaluator/printer/config filenames now describe their contents.
|
|
75
|
+
|
|
76
|
+
- Added definition-scoped `lhs()` in `LCL_ROOT` and strict locale-independent
|
|
77
|
+
`parse_ymd`/`to_ymd` calendar conversion in `LCL_BUILTINS`.
|
|
78
|
+
- Extended dependency graph construction to accept a Frame and report qualified
|
|
79
|
+
definition/value bindings, exact lookup paths, and unresolved references
|
|
80
|
+
without evaluating or touching runtime traces.
|
|
81
|
+
- Added reusable default-parent policy to `FrameFactory`; configuration-created
|
|
82
|
+
Frames now use the canonical root/builtin hierarchy by default.
|
|
83
|
+
|
|
84
|
+
- Replaced the oversized user cheatsheet and legacy runtime quickstarts with an
|
|
85
|
+
English tutorial path covering installation, Modules and Frames, the complete
|
|
86
|
+
LCL feature gallery, fixed-point recursion, quicksort, and `.lclcfg`
|
|
87
|
+
integration through executable examples.
|
|
88
|
+
|
|
89
|
+
- Added UTF-8 `.lclcfg` parsing with optional version metadata, colon
|
|
90
|
+
definitions, comments, explicit backslash continuation, and eager
|
|
91
|
+
source-file magic constants.
|
|
92
|
+
- Added async path-backed `using` expansion with deterministic later-wins
|
|
93
|
+
precedence, complete shadow history, cycle detection, loading limits,
|
|
94
|
+
single-flight caching, cancellation isolation, and filesystem containment.
|
|
95
|
+
- Added the curated `lclang.config` parsing/loading API and runtime Module,
|
|
96
|
+
FrameFactory, and guaranteed-cleanup evaluation bridge.
|
|
97
|
+
|
|
98
|
+
- Added the preferred `define_module` and `define_frame` construction shortcuts
|
|
99
|
+
with the explicit `LCL_ROOT -> LCL_BUILTINS -> LCL_RUNTIME -> LCL_IMPORTS ->
|
|
100
|
+
user module` lookup hierarchy.
|
|
101
|
+
- Added non-evaluating `Frame.has` and `Frame.get_definition` inspection backed
|
|
102
|
+
by the same recursive owner-selection rule as `Frame.get`.
|
|
103
|
+
- Added `Frame.derive` as the preferred concise constructor for independent
|
|
104
|
+
child Frames with detached local values.
|
|
105
|
+
- Added atomic right-biased `Frame.mixin` host-value updates while preserving
|
|
106
|
+
cached definition snapshots until explicit recalculation.
|
|
107
|
+
|
|
108
|
+
## 0.1.0 release candidate — 2026-08-06
|
|
109
|
+
|
|
110
|
+
The first released `lclang` language/runtime surface includes:
|
|
111
|
+
|
|
112
|
+
- a pure-Python, versioned expression grammar with immutable AST values,
|
|
113
|
+
canonical printing, comprehensions, functions, closures, errors, and context
|
|
114
|
+
management;
|
|
115
|
+
- an async-first evaluator with a synchronous convenience boundary, hierarchical
|
|
116
|
+
Frame caching, dependency inspection, recalculation, limits, cancellation
|
|
117
|
+
isolation, and deterministic cleanup;
|
|
118
|
+
- immutable modules, presets, reusable Frame factories, dependency graphs, and
|
|
119
|
+
a reviewed standard preset with `iter`, `text`, `data`, and `json` namespaces;
|
|
120
|
+
- bilingual tutorials, API guidance, and executable examples;
|
|
121
|
+
- zero-dependency runtime packaging for Python 3.14+ with a platform-independent
|
|
122
|
+
wheel and source distribution release gate.
|
|
123
|
+
|
|
124
|
+
`lclang` is intended for trusted application configuration. It is not a hostile-
|
|
125
|
+
code sandbox; host-provided values and callables retain ordinary Python powers.
|
lclang-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 lclang contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
lclang-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lclang
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A typed, async-first configuration expression language
|
|
5
|
+
Project-URL: Documentation, https://jihulab.com/midnightprotocol/lclang/-/tree/main/docs
|
|
6
|
+
Project-URL: Issues, https://jihulab.com/midnightprotocol/lclang/-/work_items
|
|
7
|
+
Project-URL: Source, https://jihulab.com/midnightprotocol/lclang
|
|
8
|
+
Author: RuntimeRomance
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Requires-Python: >=3.14
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# lclang
|
|
21
|
+
|
|
22
|
+
[中文说明](README_cn.md)
|
|
23
|
+
|
|
24
|
+
`lclang` is a pure-Python, async-first configuration expression language for
|
|
25
|
+
Python 3.14+. The 0.3.0 language, runtime, `.lclcfg`, and typed CLI release candidate is
|
|
26
|
+
verified; publication is a separate maintainer action. See
|
|
27
|
+
[CHANGELOG.md](CHANGELOG.md).
|
|
28
|
+
|
|
29
|
+
The distribution and import name is `lclang`; production code lives under
|
|
30
|
+
`src/lclang`.
|
|
31
|
+
|
|
32
|
+
## Project status
|
|
33
|
+
|
|
34
|
+
- Target: 0.4.0 development release
|
|
35
|
+
- Latest completed milestone: M008 — `lclang` identity and `src` package layout
|
|
36
|
+
- Next planned milestone: M100 — trusted-input security boundary audit
|
|
37
|
+
- Implemented: foundation, enforced English rST API docs, source-aware lexer,
|
|
38
|
+
immutable AST, complete expression/comprehension parsing, all planned V1
|
|
39
|
+
expression forms, deterministic AST-to-source rendering, semantic f-string
|
|
40
|
+
parsing, stable root parse/print APIs, async expression evaluation with
|
|
41
|
+
recursively awaited sync/async iterable items, lexical
|
|
42
|
+
closures, structured failures, assertions, try recovery, finalization, and
|
|
43
|
+
synchronous/asynchronous context management, semantic f-string evaluation,
|
|
44
|
+
immutable runtime modules, and hierarchical single-flight Frame caching with
|
|
45
|
+
structured cycle detection, cancellation isolation, and atomic targeted
|
|
46
|
+
recalculation without dependant invalidation, plus task-local depth, work, and
|
|
47
|
+
materialized-collection limits, deterministic Frame close/resource cleanup,
|
|
48
|
+
scope-aware eager/conditional/deferred dependency analysis, immutable module
|
|
49
|
+
dependency graphs, filtered queries, deterministic topological ordering,
|
|
50
|
+
bounded runtime lookup tracing, static/dynamic edge reconciliation, and
|
|
51
|
+
owner-aware immutable Frame dependency snapshots with atomic refresh semantics,
|
|
52
|
+
plus shallow immutable host presets, reusable independent Frame factories,
|
|
53
|
+
manifest-driven read-only attribute namespaces, and reviewed async iterable,
|
|
54
|
+
text, immutable data, and strict JSON helpers in a standard preset, exposed
|
|
55
|
+
through a focused root API for the complete runtime workflow, plus preferred
|
|
56
|
+
source-string `define_module`/`define_frame` shortcuts and the canonical
|
|
57
|
+
`LCL_ROOT -> LCL_BUILTINS -> LCL_RUNTIME -> LCL_IMPORTS -> user` hierarchy,
|
|
58
|
+
preferred `Frame.derive` child construction, non-evaluating `has` and
|
|
59
|
+
`get_definition` lookup inspection, side-effect-free `inspect_variable`
|
|
60
|
+
dependency trees with first-seen direct-name deduplication and source-oriented
|
|
61
|
+
one-line representations with typed value/error payloads, including canonical
|
|
62
|
+
`<node-type>: <LCL expression>` payloads for AST values and canonical source
|
|
63
|
+
reprs for evaluated LCL function closures, plus controlled
|
|
64
|
+
right-biased `Frame.mixin`
|
|
65
|
+
host-value updates, definition-scoped `lhs()`, strict `YYYYMMDD` date builtins,
|
|
66
|
+
the native variadic fixed-point builtin `recursive`,
|
|
67
|
+
and non-evaluating Frame-qualified dependency graphs with value terminals and
|
|
68
|
+
lookup paths, lexical closure ownership for `lhs()`, source-string
|
|
69
|
+
`evaluate_sync`, deterministic direct/FrameFactory IDs, and a dependency
|
|
70
|
+
analytics tutorial backed by audited nested dependency and Frame packages,
|
|
71
|
+
plus immutable CLI values, exact async command decorators, nested snake_case
|
|
72
|
+
groups, full-argv parsing, structured help, lazy preset/default/config/override
|
|
73
|
+
Frame layering, handler-owned dryrun, isolated logging, result/cleanup mapping,
|
|
74
|
+
concise `CliResult.success`/`fail` constructors, valueless override keys as
|
|
75
|
+
boolean `True`, and built-in `parse_lcl` with optional evaluated inspection,
|
|
76
|
+
lazy `eval_lcl`, and deterministic nested `builtins` module commands, with canonical lclang
|
|
77
|
+
builtins and standard namespaces identified as `NativeProvided` and rendered
|
|
78
|
+
uniformly as `Builtin Function` or `Builtin Namespace`, plus structured
|
|
79
|
+
failures carrying direct-to-failing variable evaluation stacks, plus ordered
|
|
80
|
+
workflow execution-status trees, shared sub-task manager cursors, deterministic
|
|
81
|
+
parent aggregation, subtree locking, exception-transparent `with` finalization,
|
|
82
|
+
and scoped steps with atomic description/status updates and clean auto-success,
|
|
83
|
+
packaged with the `lclang` identity from the `src/lclang` source tree
|
|
84
|
+
- Test status: 844 tests pass at 100.00% branch coverage; strict mypy, Ruff,
|
|
85
|
+
exhaustive source/docstring policy, executable documentation, and artifact
|
|
86
|
+
gates pass
|
|
87
|
+
|
|
88
|
+
The authoritative milestone ledger is in [progress.md](progress.md). Planned
|
|
89
|
+
features are deliberately not presented as implemented features.
|
|
90
|
+
|
|
91
|
+
## Quickstart
|
|
92
|
+
|
|
93
|
+
Run from a checkout with its development environment installed. The example is
|
|
94
|
+
extracted and executed by the test suite.
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
import asyncio
|
|
98
|
+
|
|
99
|
+
import lclang
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
async def main() -> None:
|
|
103
|
+
module = lclang.define_module(
|
|
104
|
+
"quickstart",
|
|
105
|
+
{"result": 'json.encode({"message": "hello lclang"})'},
|
|
106
|
+
)
|
|
107
|
+
frame = lclang.define_frame(module)
|
|
108
|
+
try:
|
|
109
|
+
print(await frame.get("result"))
|
|
110
|
+
snapshot = frame.dependency_snapshot("result")
|
|
111
|
+
print(",".join(str(edge.target) for edge in snapshot.dynamic_edges))
|
|
112
|
+
finally:
|
|
113
|
+
await frame.close()
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
asyncio.run(main())
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Inspect an override-defined result without evaluating it, or evaluate it through
|
|
120
|
+
the same lazy Frame pipeline:
|
|
121
|
+
|
|
122
|
+
```console
|
|
123
|
+
python -m lclang.cli builtins
|
|
124
|
+
python -m lclang.cli parse_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
|
|
125
|
+
python -m lclang.cli eval_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The first command lists canonical builtins and nested namespace methods. The
|
|
129
|
+
second prints the static `RESULT -> a, b` inspection tree. The third prints
|
|
130
|
+
`100200` because ordinary CLI override values are literal strings.
|
|
131
|
+
|
|
132
|
+
Continue with the [tutorial index](docs/tutorials/README.md), then choose the
|
|
133
|
+
[runtime guide](docs/tutorials/runtime.md),
|
|
134
|
+
[LCL examples gallery](docs/tutorials/lcl_examples.md), or
|
|
135
|
+
[configuration-file guide](docs/tutorials/config_file.md). Use the
|
|
136
|
+
[dependency analytics tutorial](docs/tutorials/dependency-analytics.md) for
|
|
137
|
+
static graphs, Frame paths, runtime traces, and reconciliation. The
|
|
138
|
+
[CLI tutorial](docs/tutorials/cli.md) shows how to build a configuration-driven
|
|
139
|
+
Python script. The [workflow-status tutorial](docs/tutorials/workflow-status.md)
|
|
140
|
+
explains task/step trees, aggregation, descriptions, locking, and scoped error
|
|
141
|
+
capture for both tasks and steps. The
|
|
142
|
+
[runtime API guide](docs/reference/runtime-api.md) remains the detailed
|
|
143
|
+
reference.
|
|
144
|
+
|
|
145
|
+
## Intended capability
|
|
146
|
+
|
|
147
|
+
The 0.4 target comprises:
|
|
148
|
+
|
|
149
|
+
- a versioned Python-like expression grammar with a custom AST;
|
|
150
|
+
- an async-first interpreter and cached hierarchical runtime frames;
|
|
151
|
+
- dependency analysis with eager, conditional, deferred, and dynamic edges;
|
|
152
|
+
- UTF-8 `.lclcfg` files with versioned `using` expansion and source-aware diagnostics;
|
|
153
|
+
- a typed framework for building configuration-driven command-line tools;
|
|
154
|
+
- strict typing, branch coverage, parser differential tests, stress tests,
|
|
155
|
+
memory-leak checks, and portable package verification.
|
|
156
|
+
|
|
157
|
+
## Engineering policy
|
|
158
|
+
|
|
159
|
+
Development is documentation-first and test-driven. Every implementation
|
|
160
|
+
milestone starts with an executable behavioural contract, demonstrates a
|
|
161
|
+
failing test, implements the behaviour, passes the complete quality gate, and
|
|
162
|
+
then updates both README files and the progress ledger. Production and unit-test
|
|
163
|
+
submodules mirror one another as defined in
|
|
164
|
+
[the module-layout specification](docs/architecture/module-layout.md).
|
|
165
|
+
|
|
166
|
+
The language is intended for trusted application configuration. It is not a
|
|
167
|
+
security sandbox for hostile expressions.
|
|
168
|
+
|
|
169
|
+
## Documentation
|
|
170
|
+
|
|
171
|
+
- Durable development rules: [AGENTS.md](AGENTS.md)
|
|
172
|
+
- Progress and verification evidence: [progress.md](progress.md)
|
|
173
|
+
- English specifications: `docs/specs/`
|
|
174
|
+
- Complete LCL syntax: [docs/lcl-lang.md](docs/lcl-lang.md)
|
|
175
|
+
- English tutorial index: [docs/tutorials/README.md](docs/tutorials/README.md)
|
|
176
|
+
- Runtime tutorial: [docs/tutorials/runtime.md](docs/tutorials/runtime.md)
|
|
177
|
+
- LCL examples gallery: [docs/tutorials/lcl_examples.md](docs/tutorials/lcl_examples.md)
|
|
178
|
+
- Configuration-file tutorial: [docs/tutorials/config_file.md](docs/tutorials/config_file.md)
|
|
179
|
+
- Dependency analytics tutorial: [docs/tutorials/dependency-analytics.md](docs/tutorials/dependency-analytics.md)
|
|
180
|
+
- Python-script CLI tutorial: [docs/tutorials/cli.md](docs/tutorials/cli.md)
|
|
181
|
+
- Workflow-status tutorial: [docs/tutorials/workflow-status.md](docs/tutorials/workflow-status.md)
|
|
182
|
+
- Chinese CLI tutorial: [doc_cn/cli_cn.md](doc_cn/cli_cn.md)
|
|
183
|
+
- Chinese tutorials: `doc_cn/`
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
MIT. Version 0.3.0 requires Python 3.14+ and has no runtime dependencies.
|
lclang-0.3.0/README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# lclang
|
|
2
|
+
|
|
3
|
+
[中文说明](README_cn.md)
|
|
4
|
+
|
|
5
|
+
`lclang` is a pure-Python, async-first configuration expression language for
|
|
6
|
+
Python 3.14+. The 0.3.0 language, runtime, `.lclcfg`, and typed CLI release candidate is
|
|
7
|
+
verified; publication is a separate maintainer action. See
|
|
8
|
+
[CHANGELOG.md](CHANGELOG.md).
|
|
9
|
+
|
|
10
|
+
The distribution and import name is `lclang`; production code lives under
|
|
11
|
+
`src/lclang`.
|
|
12
|
+
|
|
13
|
+
## Project status
|
|
14
|
+
|
|
15
|
+
- Target: 0.4.0 development release
|
|
16
|
+
- Latest completed milestone: M008 — `lclang` identity and `src` package layout
|
|
17
|
+
- Next planned milestone: M100 — trusted-input security boundary audit
|
|
18
|
+
- Implemented: foundation, enforced English rST API docs, source-aware lexer,
|
|
19
|
+
immutable AST, complete expression/comprehension parsing, all planned V1
|
|
20
|
+
expression forms, deterministic AST-to-source rendering, semantic f-string
|
|
21
|
+
parsing, stable root parse/print APIs, async expression evaluation with
|
|
22
|
+
recursively awaited sync/async iterable items, lexical
|
|
23
|
+
closures, structured failures, assertions, try recovery, finalization, and
|
|
24
|
+
synchronous/asynchronous context management, semantic f-string evaluation,
|
|
25
|
+
immutable runtime modules, and hierarchical single-flight Frame caching with
|
|
26
|
+
structured cycle detection, cancellation isolation, and atomic targeted
|
|
27
|
+
recalculation without dependant invalidation, plus task-local depth, work, and
|
|
28
|
+
materialized-collection limits, deterministic Frame close/resource cleanup,
|
|
29
|
+
scope-aware eager/conditional/deferred dependency analysis, immutable module
|
|
30
|
+
dependency graphs, filtered queries, deterministic topological ordering,
|
|
31
|
+
bounded runtime lookup tracing, static/dynamic edge reconciliation, and
|
|
32
|
+
owner-aware immutable Frame dependency snapshots with atomic refresh semantics,
|
|
33
|
+
plus shallow immutable host presets, reusable independent Frame factories,
|
|
34
|
+
manifest-driven read-only attribute namespaces, and reviewed async iterable,
|
|
35
|
+
text, immutable data, and strict JSON helpers in a standard preset, exposed
|
|
36
|
+
through a focused root API for the complete runtime workflow, plus preferred
|
|
37
|
+
source-string `define_module`/`define_frame` shortcuts and the canonical
|
|
38
|
+
`LCL_ROOT -> LCL_BUILTINS -> LCL_RUNTIME -> LCL_IMPORTS -> user` hierarchy,
|
|
39
|
+
preferred `Frame.derive` child construction, non-evaluating `has` and
|
|
40
|
+
`get_definition` lookup inspection, side-effect-free `inspect_variable`
|
|
41
|
+
dependency trees with first-seen direct-name deduplication and source-oriented
|
|
42
|
+
one-line representations with typed value/error payloads, including canonical
|
|
43
|
+
`<node-type>: <LCL expression>` payloads for AST values and canonical source
|
|
44
|
+
reprs for evaluated LCL function closures, plus controlled
|
|
45
|
+
right-biased `Frame.mixin`
|
|
46
|
+
host-value updates, definition-scoped `lhs()`, strict `YYYYMMDD` date builtins,
|
|
47
|
+
the native variadic fixed-point builtin `recursive`,
|
|
48
|
+
and non-evaluating Frame-qualified dependency graphs with value terminals and
|
|
49
|
+
lookup paths, lexical closure ownership for `lhs()`, source-string
|
|
50
|
+
`evaluate_sync`, deterministic direct/FrameFactory IDs, and a dependency
|
|
51
|
+
analytics tutorial backed by audited nested dependency and Frame packages,
|
|
52
|
+
plus immutable CLI values, exact async command decorators, nested snake_case
|
|
53
|
+
groups, full-argv parsing, structured help, lazy preset/default/config/override
|
|
54
|
+
Frame layering, handler-owned dryrun, isolated logging, result/cleanup mapping,
|
|
55
|
+
concise `CliResult.success`/`fail` constructors, valueless override keys as
|
|
56
|
+
boolean `True`, and built-in `parse_lcl` with optional evaluated inspection,
|
|
57
|
+
lazy `eval_lcl`, and deterministic nested `builtins` module commands, with canonical lclang
|
|
58
|
+
builtins and standard namespaces identified as `NativeProvided` and rendered
|
|
59
|
+
uniformly as `Builtin Function` or `Builtin Namespace`, plus structured
|
|
60
|
+
failures carrying direct-to-failing variable evaluation stacks, plus ordered
|
|
61
|
+
workflow execution-status trees, shared sub-task manager cursors, deterministic
|
|
62
|
+
parent aggregation, subtree locking, exception-transparent `with` finalization,
|
|
63
|
+
and scoped steps with atomic description/status updates and clean auto-success,
|
|
64
|
+
packaged with the `lclang` identity from the `src/lclang` source tree
|
|
65
|
+
- Test status: 844 tests pass at 100.00% branch coverage; strict mypy, Ruff,
|
|
66
|
+
exhaustive source/docstring policy, executable documentation, and artifact
|
|
67
|
+
gates pass
|
|
68
|
+
|
|
69
|
+
The authoritative milestone ledger is in [progress.md](progress.md). Planned
|
|
70
|
+
features are deliberately not presented as implemented features.
|
|
71
|
+
|
|
72
|
+
## Quickstart
|
|
73
|
+
|
|
74
|
+
Run from a checkout with its development environment installed. The example is
|
|
75
|
+
extracted and executed by the test suite.
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import asyncio
|
|
79
|
+
|
|
80
|
+
import lclang
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
async def main() -> None:
|
|
84
|
+
module = lclang.define_module(
|
|
85
|
+
"quickstart",
|
|
86
|
+
{"result": 'json.encode({"message": "hello lclang"})'},
|
|
87
|
+
)
|
|
88
|
+
frame = lclang.define_frame(module)
|
|
89
|
+
try:
|
|
90
|
+
print(await frame.get("result"))
|
|
91
|
+
snapshot = frame.dependency_snapshot("result")
|
|
92
|
+
print(",".join(str(edge.target) for edge in snapshot.dynamic_edges))
|
|
93
|
+
finally:
|
|
94
|
+
await frame.close()
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
asyncio.run(main())
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Inspect an override-defined result without evaluating it, or evaluate it through
|
|
101
|
+
the same lazy Frame pipeline:
|
|
102
|
+
|
|
103
|
+
```console
|
|
104
|
+
python -m lclang.cli builtins
|
|
105
|
+
python -m lclang.cli parse_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
|
|
106
|
+
python -m lclang.cli eval_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The first command lists canonical builtins and nested namespace methods. The
|
|
110
|
+
second prints the static `RESULT -> a, b` inspection tree. The third prints
|
|
111
|
+
`100200` because ordinary CLI override values are literal strings.
|
|
112
|
+
|
|
113
|
+
Continue with the [tutorial index](docs/tutorials/README.md), then choose the
|
|
114
|
+
[runtime guide](docs/tutorials/runtime.md),
|
|
115
|
+
[LCL examples gallery](docs/tutorials/lcl_examples.md), or
|
|
116
|
+
[configuration-file guide](docs/tutorials/config_file.md). Use the
|
|
117
|
+
[dependency analytics tutorial](docs/tutorials/dependency-analytics.md) for
|
|
118
|
+
static graphs, Frame paths, runtime traces, and reconciliation. The
|
|
119
|
+
[CLI tutorial](docs/tutorials/cli.md) shows how to build a configuration-driven
|
|
120
|
+
Python script. The [workflow-status tutorial](docs/tutorials/workflow-status.md)
|
|
121
|
+
explains task/step trees, aggregation, descriptions, locking, and scoped error
|
|
122
|
+
capture for both tasks and steps. The
|
|
123
|
+
[runtime API guide](docs/reference/runtime-api.md) remains the detailed
|
|
124
|
+
reference.
|
|
125
|
+
|
|
126
|
+
## Intended capability
|
|
127
|
+
|
|
128
|
+
The 0.4 target comprises:
|
|
129
|
+
|
|
130
|
+
- a versioned Python-like expression grammar with a custom AST;
|
|
131
|
+
- an async-first interpreter and cached hierarchical runtime frames;
|
|
132
|
+
- dependency analysis with eager, conditional, deferred, and dynamic edges;
|
|
133
|
+
- UTF-8 `.lclcfg` files with versioned `using` expansion and source-aware diagnostics;
|
|
134
|
+
- a typed framework for building configuration-driven command-line tools;
|
|
135
|
+
- strict typing, branch coverage, parser differential tests, stress tests,
|
|
136
|
+
memory-leak checks, and portable package verification.
|
|
137
|
+
|
|
138
|
+
## Engineering policy
|
|
139
|
+
|
|
140
|
+
Development is documentation-first and test-driven. Every implementation
|
|
141
|
+
milestone starts with an executable behavioural contract, demonstrates a
|
|
142
|
+
failing test, implements the behaviour, passes the complete quality gate, and
|
|
143
|
+
then updates both README files and the progress ledger. Production and unit-test
|
|
144
|
+
submodules mirror one another as defined in
|
|
145
|
+
[the module-layout specification](docs/architecture/module-layout.md).
|
|
146
|
+
|
|
147
|
+
The language is intended for trusted application configuration. It is not a
|
|
148
|
+
security sandbox for hostile expressions.
|
|
149
|
+
|
|
150
|
+
## Documentation
|
|
151
|
+
|
|
152
|
+
- Durable development rules: [AGENTS.md](AGENTS.md)
|
|
153
|
+
- Progress and verification evidence: [progress.md](progress.md)
|
|
154
|
+
- English specifications: `docs/specs/`
|
|
155
|
+
- Complete LCL syntax: [docs/lcl-lang.md](docs/lcl-lang.md)
|
|
156
|
+
- English tutorial index: [docs/tutorials/README.md](docs/tutorials/README.md)
|
|
157
|
+
- Runtime tutorial: [docs/tutorials/runtime.md](docs/tutorials/runtime.md)
|
|
158
|
+
- LCL examples gallery: [docs/tutorials/lcl_examples.md](docs/tutorials/lcl_examples.md)
|
|
159
|
+
- Configuration-file tutorial: [docs/tutorials/config_file.md](docs/tutorials/config_file.md)
|
|
160
|
+
- Dependency analytics tutorial: [docs/tutorials/dependency-analytics.md](docs/tutorials/dependency-analytics.md)
|
|
161
|
+
- Python-script CLI tutorial: [docs/tutorials/cli.md](docs/tutorials/cli.md)
|
|
162
|
+
- Workflow-status tutorial: [docs/tutorials/workflow-status.md](docs/tutorials/workflow-status.md)
|
|
163
|
+
- Chinese CLI tutorial: [doc_cn/cli_cn.md](doc_cn/cli_cn.md)
|
|
164
|
+
- Chinese tutorials: `doc_cn/`
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
MIT. Version 0.3.0 requires Python 3.14+ and has no runtime dependencies.
|