expressir 2.4.29-arm-linux
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.
- checksums.yaml +7 -0
- data/.cargo/config.toml +3 -0
- data/.github/scripts/test_installed_gem.rb +34 -0
- data/.github/workflows/codeql.yml +35 -0
- data/.github/workflows/docs.yml +99 -0
- data/.github/workflows/links.yml +100 -0
- data/.github/workflows/native-gems.yml +201 -0
- data/.github/workflows/rake.yml +19 -0
- data/.github/workflows/release.yml +37 -0
- data/.github/workflows/rust-ext.yml +41 -0
- data/.github/workflows/stress.yml +36 -0
- data/.github/workflows/validate_schemas.yml +48 -0
- data/.github/workflows/verify_remarks.yml +33 -0
- data/.gitignore +55 -0
- data/.hound.yml +3 -0
- data/.rspec +2 -0
- data/.rubocop.yml +18 -0
- data/.rubocop_todo.yml +297 -0
- data/CHANGELOG.md +159 -0
- data/Gemfile +18 -0
- data/README.adoc +2783 -0
- data/Rakefile +41 -0
- data/TODO.bugs/01-stale-transformer-autoload.md +39 -0
- data/TODO.bugs/02-parser-class-instance-vars.md +36 -0
- data/TODO.bugs/03-builder-mutable-state.md +43 -0
- data/TODO.bugs/04-formatter-public-send-dispatch.md +53 -0
- data/TODO.bugs/05-anonymous-formatter-subclass.md +45 -0
- data/TODO.bugs/06-collection-registry-single-source.md +53 -0
- data/TODO.bugs/07-require-relative-cleanup.md +42 -0
- data/TODO.bugs/08-require-expressir-in-commands.md +34 -0
- data/TODO.bugs/09-parser-split.md +53 -0
- data/TODO.bugs/10-to-s-override.md +42 -0
- data/TODO.bugs/11-parser-class-variables.md +39 -0
- data/TODO.bugs/12-marker-modules-vs-registry.md +64 -0
- data/TODO.bugs/13-string-literal-scanner-limitation.md +52 -0
- data/TODO.bugs/14-model-formatting-leak.md +30 -0
- data/TODO.bugs/15-expression-children-macro.md +27 -0
- data/TODO.bugs/16-pretty-formatter-duplication.md +28 -0
- data/TODO.bugs/17-snake-case-cache-mutable-constant.md +28 -0
- data/TODO.bugs/18-const-get-private-constants.md +30 -0
- data/TODO.bugs/19-format-methods-public.md +22 -0
- data/TODO.bugs/20-coverage-nested-entities-dedup.md +20 -0
- data/TODO.bugs/21-operator-tokens-secondary-dispatch.md +21 -0
- data/TODO.bugs/22-builder-fast-path-wrappers.md +32 -0
- data/TODO.bugs/23-coverage-inverse-maps.md +21 -0
- data/TODO.bugs/24-streaming-builder-complexity.md +19 -0
- data/TODO.bugs/25-debug-puts-in-production.md +21 -0
- data/TODO.bugs/26-generic-entity-children-misplaced.md +21 -0
- data/TODO.bugs/27-package-build-god-method.md +19 -0
- data/TODO.bugs/28-package-god-class.md +30 -0
- data/TODO.bugs/29-validate-ascii-god-class.md +24 -0
- data/TODO.bugs/30-unicode-map-extraction.md +19 -0
- data/TODO.bugs/README.md +43 -0
- data/TODO.max-perf/01-restore-ci-green.md +36 -0
- data/TODO.max-perf/02-streaming-parse-path.md +31 -0
- data/TODO.max-perf/03-cli-parallel-opt-in.md +27 -0
- data/TODO.max-perf/04-benchmark-harness.md +28 -0
- data/TODO.max-perf/05-parallel-fidelity-specs.md +22 -0
- data/TODO.max-perf/06-builder-cpu-audit.md +41 -0
- data/TODO.max-perf/07-upstream-parsanol-roadmap.md +27 -0
- data/TODO.max-perf/08-builder-build-perf.md +45 -0
- data/TODO.max-perf/09-grammar-cold-start.md +25 -0
- data/TODO.max-perf/10-parser-facade-hygiene.md +23 -0
- data/TODO.max-perf/11-ci-green-closeout.md +25 -0
- data/TODO.max-perf/12-require-boot-profile.md +25 -0
- data/TODO.max-perf/13-key-conversion-specs.md +26 -0
- data/TODO.max-perf/14-builder-call-handler-audit.md +28 -0
- data/TODO.parity-ee/00-overview.md +76 -0
- data/TODO.parity-ee/01-annex-g-rule-extraction.md +41 -0
- data/TODO.parity-ee/02-eeng-algorithm-inventory.md +8 -0
- data/TODO.parity-ee/03-eeng-oracle-harness.md +33 -0
- data/TODO.parity-ee/04-shtolo-concatenate.md +44 -0
- data/TODO.parity-ee/05-shtolo-longform-flatten.md +53 -0
- data/TODO.parity-ee/06-interface-scheduling-parity.md +47 -0
- data/TODO.parity-ee/07-semantic-checks-port.md +35 -0
- data/TODO.parity-ee/08-pretty-roundtrip-gate.md +27 -0
- data/TODO.parity-ee/09-smrl-index-and-listing.md +22 -0
- data/TODO.parity-ee/10-interface-dot-graph.md +21 -0
- data/TODO.parity-ee/11-import-eeng-tests.md +79 -0
- data/TODO.parity-ee/12-full-check-catalog.md +67 -0
- data/TODO.parity-ee/13-population-p21.md +54 -0
- data/TODO.parity-ee/14-shtolo-completion.md +44 -0
- data/TODO.parity-ee/15-part28-xml.md +51 -0
- data/TODO.parity-ee/16-compare-patch.md +48 -0
- data/TODO.parity-ee/17-official-tests.md +42 -0
- data/TODO.parity-ee/18-mim-mapping.md +47 -0
- data/TODO.parity-ee/19-architecture.md +97 -0
- data/TODO.parity-ee/parity-matrix.md +108 -0
- data/TODO.refpath-v2/00-overview.md +64 -0
- data/TODO.suma-improvements/00-overview.md +23 -0
- data/TODO.suma-improvements/01-prebuilt-platform-gems.md +33 -0
- data/TODO.suma-improvements/02-suma-e2e.md +39 -0
- data/TODO.suma-improvements/03-item-graph.md +22 -0
- data/TODO.suma-improvements/04-compiled-set-default.md +16 -0
- data/TODO.suma-improvements/05-validation-in-docs.md +17 -0
- data/TODO.suma-improvements/06-memory-remeasure.md +36 -0
- data/TODO.suma-improvements/07-part28-xml.md +15 -0
- data/TODO.suma-improvements/08-windows-gnu-toolchain.md +15 -0
- data/TODO.suma-improvements/09-checker-tranche3.md +13 -0
- data/TODO.suma-improvements/10-expressdoc.md +8 -0
- data/benchmark/srl_benchmark.rb +458 -0
- data/benchmark/srl_native_benchmark.rb +146 -0
- data/benchmark/srl_ruby_benchmark.rb +132 -0
- data/bin/console +11 -0
- data/bin/rspec +30 -0
- data/bin/setup +8 -0
- data/docs/Gemfile +12 -0
- data/docs/_config.yml +141 -0
- data/docs/_guides/changes/changes-format.adoc +778 -0
- data/docs/_guides/changes/importing-eengine.adoc +898 -0
- data/docs/_guides/changes/index.adoc +396 -0
- data/docs/_guides/changes/programmatic-usage.adoc +1038 -0
- data/docs/_guides/changes/validating-changes.adoc +681 -0
- data/docs/_guides/cli/benchmark-performance.adoc +834 -0
- data/docs/_guides/cli/coverage-analysis.adoc +921 -0
- data/docs/_guides/cli/format-schemas.adoc +547 -0
- data/docs/_guides/cli/index.adoc +8 -0
- data/docs/_guides/cli/managing-changes.adoc +927 -0
- data/docs/_guides/cli/validate-ascii.adoc +645 -0
- data/docs/_guides/cli/validate-schemas.adoc +534 -0
- data/docs/_guides/formatter/formatter-architecture.adoc +401 -0
- data/docs/_guides/index.adoc +165 -0
- data/docs/_guides/ler/creating-packages.adoc +664 -0
- data/docs/_guides/ler/index.adoc +305 -0
- data/docs/_guides/ler/loading-packages.adoc +707 -0
- data/docs/_guides/ler/package-formats.adoc +748 -0
- data/docs/_guides/ler/querying-packages.adoc +826 -0
- data/docs/_guides/ler/step-packages.adoc +385 -0
- data/docs/_guides/ler/validating-packages.adoc +750 -0
- data/docs/_guides/liquid/basic-templates.adoc +813 -0
- data/docs/_guides/liquid/documentation-generation.adoc +1042 -0
- data/docs/_guides/liquid/drops-reference.adoc +829 -0
- data/docs/_guides/liquid/filters-and-tags.adoc +912 -0
- data/docs/_guides/liquid/index.adoc +468 -0
- data/docs/_guides/manifests/creating-manifests.adoc +483 -0
- data/docs/_guides/manifests/index.adoc +307 -0
- data/docs/_guides/manifests/resolving-manifests.adoc +557 -0
- data/docs/_guides/manifests/validating-manifests.adoc +713 -0
- data/docs/_guides/ruby-api/formatting-schemas.adoc +605 -0
- data/docs/_guides/ruby-api/index.adoc +257 -0
- data/docs/_guides/ruby-api/parsing-files.adoc +421 -0
- data/docs/_guides/ruby-api/search-engine.adoc +609 -0
- data/docs/_guides/ruby-api/working-with-repository.adoc +577 -0
- data/docs/_pages/data-model.adoc +665 -0
- data/docs/_pages/express-language.adoc +506 -0
- data/docs/_pages/getting-started.adoc +414 -0
- data/docs/_pages/index.adoc +116 -0
- data/docs/_pages/introduction.adoc +256 -0
- data/docs/_pages/ler-packages.adoc +837 -0
- data/docs/_pages/parsers.adoc +709 -0
- data/docs/_pages/schema-manifests.adoc +431 -0
- data/docs/_references/index.adoc +228 -0
- data/docs/_tutorials/creating-ler-package.adoc +735 -0
- data/docs/_tutorials/documentation-coverage.adoc +795 -0
- data/docs/_tutorials/formatting-schemas.adoc +89 -0
- data/docs/_tutorials/index.adoc +231 -0
- data/docs/_tutorials/liquid-templates.adoc +806 -0
- data/docs/_tutorials/parsing-your-first-schema.adoc +522 -0
- data/docs/_tutorials/querying-schemas.adoc +751 -0
- data/docs/_tutorials/working-with-multiple-schemas.adoc +676 -0
- data/docs/index.adoc +242 -0
- data/docs/lychee.toml +90 -0
- data/examples/demo_ler_usage.sh +86 -0
- data/examples/ler/README.md +111 -0
- data/examples/ler/simple_example.ler +0 -0
- data/examples/ler/simple_schema.exp +33 -0
- data/examples/ler_build.rb +75 -0
- data/examples/ler_cli.rb +79 -0
- data/examples/ler_demo_complete.rb +276 -0
- data/examples/ler_query.rb +91 -0
- data/examples/ler_query_examples.rb +305 -0
- data/examples/ler_stats.rb +81 -0
- data/examples/phase3_demo.rb +159 -0
- data/examples/query_demo_simple.rb +131 -0
- data/exe/expressir +11 -0
- data/exe/expressir-format +14 -0
- data/exe/expressir-format-test +82 -0
- data/expressir.gemspec +61 -0
- data/lib/expressir/3.2/expressir_core.so +0 -0
- data/lib/expressir/3.3/expressir_core.so +0 -0
- data/lib/expressir/3.4/expressir_core.so +0 -0
- data/lib/expressir/4.0/expressir_core.so +0 -0
- data/lib/expressir/benchmark.rb +310 -0
- data/lib/expressir/changes/item_change.rb +20 -0
- data/lib/expressir/changes/mapping_change.rb +16 -0
- data/lib/expressir/changes/schema_change.rb +85 -0
- data/lib/expressir/changes/version_change.rb +26 -0
- data/lib/expressir/changes.rb +9 -0
- data/lib/expressir/cli.rb +148 -0
- data/lib/expressir/commands/base.rb +25 -0
- data/lib/expressir/commands/benchmark.rb +59 -0
- data/lib/expressir/commands/benchmark_cache.rb +80 -0
- data/lib/expressir/commands/changes.rb +34 -0
- data/lib/expressir/commands/changes_import_eengine.rb +146 -0
- data/lib/expressir/commands/changes_validate.rb +63 -0
- data/lib/expressir/commands/check.rb +56 -0
- data/lib/expressir/commands/clean.rb +20 -0
- data/lib/expressir/commands/coverage.rb +458 -0
- data/lib/expressir/commands/expand.rb +26 -0
- data/lib/expressir/commands/file_violations.rb +70 -0
- data/lib/expressir/commands/fix.rb +33 -0
- data/lib/expressir/commands/flatten.rb +29 -0
- data/lib/expressir/commands/format.rb +43 -0
- data/lib/expressir/commands/manifest.rb +420 -0
- data/lib/expressir/commands/mapping_validate.rb +68 -0
- data/lib/expressir/commands/non_ascii_character.rb +49 -0
- data/lib/expressir/commands/non_ascii_violation_collection.rb +301 -0
- data/lib/expressir/commands/package.rb +1222 -0
- data/lib/expressir/commands/parity_inputs.rb +160 -0
- data/lib/expressir/commands/validate.rb +106 -0
- data/lib/expressir/commands/validate_ascii.rb +94 -0
- data/lib/expressir/commands/validate_load.rb +91 -0
- data/lib/expressir/commands/version.rb +9 -0
- data/lib/expressir/commands/xsd.rb +23 -0
- data/lib/expressir/commands.rb +30 -0
- data/lib/expressir/config.rb +60 -0
- data/lib/expressir/coverage.rb +510 -0
- data/lib/expressir/eengine/arm_compare_report.rb +23 -0
- data/lib/expressir/eengine/changes_section.rb +16 -0
- data/lib/expressir/eengine/compare_report.rb +69 -0
- data/lib/expressir/eengine/mim_compare_report.rb +23 -0
- data/lib/expressir/eengine/modified_object.rb +21 -0
- data/lib/expressir/eengine.rb +9 -0
- data/lib/expressir/errors.rb +113 -0
- data/lib/expressir/express/adoc_hyperlink_formatter.rb +30 -0
- data/lib/expressir/express/adoc_source_formatter.rb +12 -0
- data/lib/expressir/express/ast_key_converter.rb +114 -0
- data/lib/expressir/express/builder.rb +277 -0
- data/lib/expressir/express/builder_context.rb +22 -0
- data/lib/expressir/express/builder_registry.rb +397 -0
- data/lib/expressir/express/builders/attribute_decl_builder.rb +32 -0
- data/lib/expressir/express/builders/built_in_builder.rb +75 -0
- data/lib/expressir/express/builders/constant_builder.rb +108 -0
- data/lib/expressir/express/builders/declaration_builder.rb +20 -0
- data/lib/expressir/express/builders/derive_clause_builder.rb +14 -0
- data/lib/expressir/express/builders/derived_attr_builder.rb +28 -0
- data/lib/expressir/express/builders/domain_rule_builder.rb +21 -0
- data/lib/expressir/express/builders/entity_decl_builder.rb +116 -0
- data/lib/expressir/express/builders/explicit_attr_builder.rb +49 -0
- data/lib/expressir/express/builders/expression_builder.rb +416 -0
- data/lib/expressir/express/builders/function_decl_builder.rb +86 -0
- data/lib/expressir/express/builders/helpers.rb +148 -0
- data/lib/expressir/express/builders/interface_builder.rb +151 -0
- data/lib/expressir/express/builders/inverse_attr_builder.rb +43 -0
- data/lib/expressir/express/builders/inverse_attr_type_builder.rb +30 -0
- data/lib/expressir/express/builders/inverse_clause_builder.rb +14 -0
- data/lib/expressir/express/builders/literal_builder.rb +93 -0
- data/lib/expressir/express/builders/procedure_decl_builder.rb +82 -0
- data/lib/expressir/express/builders/qualifier_builder.rb +102 -0
- data/lib/expressir/express/builders/reference_builder.rb +18 -0
- data/lib/expressir/express/builders/rule_decl_builder.rb +97 -0
- data/lib/expressir/express/builders/schema_body_decl_builder.rb +18 -0
- data/lib/expressir/express/builders/schema_decl_builder.rb +56 -0
- data/lib/expressir/express/builders/schema_version_builder.rb +34 -0
- data/lib/expressir/express/builders/simple_id_builder.rb +17 -0
- data/lib/expressir/express/builders/statement_builder.rb +243 -0
- data/lib/expressir/express/builders/subtype_constraint_builder.rb +166 -0
- data/lib/expressir/express/builders/syntax_builder.rb +30 -0
- data/lib/expressir/express/builders/type_builder.rb +238 -0
- data/lib/expressir/express/builders/type_decl_builder.rb +26 -0
- data/lib/expressir/express/builders/unique_clause_builder.rb +20 -0
- data/lib/expressir/express/builders/unique_rule_builder.rb +41 -0
- data/lib/expressir/express/builders/where_clause_builder.rb +20 -0
- data/lib/expressir/express/builders.rb +55 -0
- data/lib/expressir/express/cache.rb +76 -0
- data/lib/expressir/express/checker.rb +812 -0
- data/lib/expressir/express/concatenator.rb +79 -0
- data/lib/expressir/express/core.rb +95 -0
- data/lib/expressir/express/error.rb +124 -0
- data/lib/expressir/express/formatter.rb +149 -0
- data/lib/expressir/express/formatters/data_types_formatter.rb +362 -0
- data/lib/expressir/express/formatters/declarations_formatter.rb +753 -0
- data/lib/expressir/express/formatters/expressions_formatter.rb +180 -0
- data/lib/expressir/express/formatters/literals_formatter.rb +55 -0
- data/lib/expressir/express/formatters/references_formatter.rb +53 -0
- data/lib/expressir/express/formatters/remark_formatter.rb +270 -0
- data/lib/expressir/express/formatters/remark_item_formatter.rb +28 -0
- data/lib/expressir/express/formatters/statements_formatter.rb +272 -0
- data/lib/expressir/express/formatters/supertype_expressions_formatter.rb +54 -0
- data/lib/expressir/express/formatters.rb +22 -0
- data/lib/expressir/express/grammar/parser.rb +712 -0
- data/lib/expressir/express/grammar.rb +11 -0
- data/lib/expressir/express/hyperlink_formatter.rb +35 -0
- data/lib/expressir/express/interface_dot.rb +105 -0
- data/lib/expressir/express/lazy_repository.rb +211 -0
- data/lib/expressir/express/line_map.rb +48 -0
- data/lib/expressir/express/listing.rb +174 -0
- data/lib/expressir/express/model_traversal.rb +42 -0
- data/lib/expressir/express/model_visitor.rb +25 -0
- data/lib/expressir/express/node_position_index.rb +342 -0
- data/lib/expressir/express/parallel_files.rb +229 -0
- data/lib/expressir/express/parser.rb +523 -0
- data/lib/expressir/express/pretty_formatter.rb +586 -0
- data/lib/expressir/express/pretty_gate.rb +61 -0
- data/lib/expressir/express/refs_overlay.rb +47 -0
- data/lib/expressir/express/remark_attacher.rb +1098 -0
- data/lib/expressir/express/remark_overlay.rb +86 -0
- data/lib/expressir/express/remark_scanner.rb +245 -0
- data/lib/expressir/express/resolve_references_model_visitor.rb +29 -0
- data/lib/expressir/express/schema_block_scanner.rb +137 -0
- data/lib/expressir/express/schema_head_formatter.rb +22 -0
- data/lib/expressir/express/schema_plain_source_formatter.rb +11 -0
- data/lib/expressir/express/schema_source_formatter.rb +15 -0
- data/lib/expressir/express/scope_resolver.rb +223 -0
- data/lib/expressir/express/self_schema_reference.rb +126 -0
- data/lib/expressir/express/shtolo.rb +679 -0
- data/lib/expressir/express/smrl_xml.rb +125 -0
- data/lib/expressir/express/source_formatter.rb +15 -0
- data/lib/expressir/express/streaming_builder.rb +435 -0
- data/lib/expressir/express/xsd.rb +259 -0
- data/lib/expressir/express.rb +53 -0
- data/lib/expressir/liquid.rb +1 -0
- data/lib/expressir/manifest/resolver.rb +210 -0
- data/lib/expressir/manifest/validator.rb +192 -0
- data/lib/expressir/manifest.rb +6 -0
- data/lib/expressir/mapping/refpath.rb +857 -0
- data/lib/expressir/mapping.rb +253 -0
- data/lib/expressir/model/cache.rb +18 -0
- data/lib/expressir/model/concerns.rb +42 -0
- data/lib/expressir/model/data_types/aggregate.rb +26 -0
- data/lib/expressir/model/data_types/array.rb +25 -0
- data/lib/expressir/model/data_types/bag.rb +21 -0
- data/lib/expressir/model/data_types/binary.rb +19 -0
- data/lib/expressir/model/data_types/boolean.rb +15 -0
- data/lib/expressir/model/data_types/enumeration.rb +21 -0
- data/lib/expressir/model/data_types/enumeration_item.rb +24 -0
- data/lib/expressir/model/data_types/generic.rb +24 -0
- data/lib/expressir/model/data_types/generic_entity.rb +24 -0
- data/lib/expressir/model/data_types/integer.rb +15 -0
- data/lib/expressir/model/data_types/list.rb +23 -0
- data/lib/expressir/model/data_types/logical.rb +15 -0
- data/lib/expressir/model/data_types/number.rb +15 -0
- data/lib/expressir/model/data_types/real.rb +17 -0
- data/lib/expressir/model/data_types/select.rb +23 -0
- data/lib/expressir/model/data_types/set.rb +21 -0
- data/lib/expressir/model/data_types/string.rb +19 -0
- data/lib/expressir/model/data_types.rb +25 -0
- data/lib/expressir/model/declarations/attribute.rb +38 -0
- data/lib/expressir/model/declarations/constant.rb +28 -0
- data/lib/expressir/model/declarations/derived_attribute.rb +25 -0
- data/lib/expressir/model/declarations/entity.rb +62 -0
- data/lib/expressir/model/declarations/function.rb +59 -0
- data/lib/expressir/model/declarations/informal_proposition_rule.rb +25 -0
- data/lib/expressir/model/declarations/interface.rb +37 -0
- data/lib/expressir/model/declarations/interface_item.rb +21 -0
- data/lib/expressir/model/declarations/interfaced_item.rb +33 -0
- data/lib/expressir/model/declarations/inverse_attribute.rb +25 -0
- data/lib/expressir/model/declarations/parameter.rb +28 -0
- data/lib/expressir/model/declarations/procedure.rb +57 -0
- data/lib/expressir/model/declarations/remark_item.rb +21 -0
- data/lib/expressir/model/declarations/rule.rb +66 -0
- data/lib/expressir/model/declarations/schema.rb +215 -0
- data/lib/expressir/model/declarations/schema_version.rb +19 -0
- data/lib/expressir/model/declarations/schema_version_item.rb +19 -0
- data/lib/expressir/model/declarations/subtype_constraint.rb +32 -0
- data/lib/expressir/model/declarations/type.rb +45 -0
- data/lib/expressir/model/declarations/unique_rule.rb +26 -0
- data/lib/expressir/model/declarations/variable.rb +28 -0
- data/lib/expressir/model/declarations/where_rule.rb +26 -0
- data/lib/expressir/model/declarations.rb +31 -0
- data/lib/expressir/model/dependency_resolver.rb +268 -0
- data/lib/expressir/model/exp_file.rb +42 -0
- data/lib/expressir/model/expressions/aggregate_initializer.rb +18 -0
- data/lib/expressir/model/expressions/aggregate_initializer_item.rb +20 -0
- data/lib/expressir/model/expressions/binary_expression.rb +59 -0
- data/lib/expressir/model/expressions/entity_constructor.rb +20 -0
- data/lib/expressir/model/expressions/function_call.rb +20 -0
- data/lib/expressir/model/expressions/interval.rb +29 -0
- data/lib/expressir/model/expressions/query_expression.rb +31 -0
- data/lib/expressir/model/expressions/unary_expression.rb +25 -0
- data/lib/expressir/model/expressions.rb +18 -0
- data/lib/expressir/model/identifier.rb +26 -0
- data/lib/expressir/model/indexes/entity_index.rb +103 -0
- data/lib/expressir/model/indexes/item_graph.rb +185 -0
- data/lib/expressir/model/indexes/reference_index.rb +148 -0
- data/lib/expressir/model/indexes/type_index.rb +149 -0
- data/lib/expressir/model/indexes.rb +12 -0
- data/lib/expressir/model/interface_validator.rb +384 -0
- data/lib/expressir/model/literals/binary.rb +17 -0
- data/lib/expressir/model/literals/integer.rb +17 -0
- data/lib/expressir/model/literals/logical.rb +21 -0
- data/lib/expressir/model/literals/real.rb +17 -0
- data/lib/expressir/model/literals/string.rb +20 -0
- data/lib/expressir/model/literals.rb +13 -0
- data/lib/expressir/model/model_element.rb +377 -0
- data/lib/expressir/model/references/attribute_reference.rb +19 -0
- data/lib/expressir/model/references/group_reference.rb +19 -0
- data/lib/expressir/model/references/index_reference.rb +23 -0
- data/lib/expressir/model/references/simple_reference.rb +21 -0
- data/lib/expressir/model/references.rb +12 -0
- data/lib/expressir/model/remark_format.rb +17 -0
- data/lib/expressir/model/remark_info.rb +92 -0
- data/lib/expressir/model/remark_placement.rb +42 -0
- data/lib/expressir/model/repository.rb +483 -0
- data/lib/expressir/model/repository_validator.rb +293 -0
- data/lib/expressir/model/search_engine.rb +551 -0
- data/lib/expressir/model/statements/alias.rb +31 -0
- data/lib/expressir/model/statements/assignment.rb +23 -0
- data/lib/expressir/model/statements/case.rb +42 -0
- data/lib/expressir/model/statements/case_action.rb +20 -0
- data/lib/expressir/model/statements/compound.rb +21 -0
- data/lib/expressir/model/statements/escape.rb +18 -0
- data/lib/expressir/model/statements/if.rb +26 -0
- data/lib/expressir/model/statements/null.rb +18 -0
- data/lib/expressir/model/statements/procedure_call.rb +22 -0
- data/lib/expressir/model/statements/repeat.rb +40 -0
- data/lib/expressir/model/statements/return.rb +20 -0
- data/lib/expressir/model/statements/skip.rb +18 -0
- data/lib/expressir/model/statements.rb +20 -0
- data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +25 -0
- data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +17 -0
- data/lib/expressir/model/supertype_expressions.rb +12 -0
- data/lib/expressir/model.rb +39 -0
- data/lib/expressir/package/builder.rb +231 -0
- data/lib/expressir/package/metadata.rb +79 -0
- data/lib/expressir/package/reader.rb +149 -0
- data/lib/expressir/package.rb +8 -0
- data/lib/expressir/schema_manifest.rb +159 -0
- data/lib/expressir/schema_manifest_entry.rb +15 -0
- data/lib/expressir/version.rb +8 -0
- data/lib/expressir.rb +94 -0
- data/lib/tasks/verify_remarks.rake +16 -0
- data/rakelib/native.rake +24 -0
- data/rakelib/oracle.rake +52 -0
- data/rakelib/verify_remarks.rake +16 -0
- metadata +692 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "zip"
|
|
4
|
+
|
|
5
|
+
module Expressir
|
|
6
|
+
module Package
|
|
7
|
+
# Loads LER packages into Repository instances
|
|
8
|
+
# Single responsibility: Load .ler ZIP packages
|
|
9
|
+
class Reader
|
|
10
|
+
# Load repository from LER package
|
|
11
|
+
# @param package_path [String] Path to .ler file
|
|
12
|
+
# @return [Model::Repository] Loaded repository
|
|
13
|
+
def self.load(package_path)
|
|
14
|
+
new.load(package_path)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Load repository from LER package
|
|
18
|
+
# @param package_path [String] Path to .ler file
|
|
19
|
+
# @return [Model::Repository] Loaded repository
|
|
20
|
+
def load(package_path)
|
|
21
|
+
unless File.exist?(package_path)
|
|
22
|
+
raise ArgumentError, "Package file not found: #{package_path}"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
repository = nil
|
|
26
|
+
metadata = nil
|
|
27
|
+
|
|
28
|
+
Zip::File.open(package_path) do |zip|
|
|
29
|
+
# Read metadata first
|
|
30
|
+
metadata = load_metadata(zip)
|
|
31
|
+
|
|
32
|
+
# Load repository based on resolution mode
|
|
33
|
+
repository = if metadata.resolution_mode == "resolved"
|
|
34
|
+
load_serialized_repository(zip,
|
|
35
|
+
metadata.serialization_format)
|
|
36
|
+
else
|
|
37
|
+
load_from_express_files(zip)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Load and restore indexes
|
|
41
|
+
load_indexes(zip, repository)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
repository
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
# Load metadata from package
|
|
50
|
+
# @param zip [Zip::File] ZIP archive
|
|
51
|
+
# @return [Metadata] Package metadata
|
|
52
|
+
def load_metadata(zip)
|
|
53
|
+
entry = zip.find_entry("metadata.yaml")
|
|
54
|
+
raise "Metadata not found in package" unless entry
|
|
55
|
+
|
|
56
|
+
Metadata.from_yaml(entry.get_input_stream.read)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Load serialized repository from package
|
|
60
|
+
# @param zip [Zip::File] ZIP archive
|
|
61
|
+
# @param format [String] Serialization format
|
|
62
|
+
# @return [Model::Repository] Repository instance
|
|
63
|
+
def load_serialized_repository(zip, format)
|
|
64
|
+
case format
|
|
65
|
+
when "marshal"
|
|
66
|
+
load_marshal_repository(zip)
|
|
67
|
+
when "json"
|
|
68
|
+
load_json_repository(zip)
|
|
69
|
+
when "yaml"
|
|
70
|
+
load_yaml_repository(zip)
|
|
71
|
+
else
|
|
72
|
+
raise "Unknown serialization format: #{format}"
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Load repository from Marshal format
|
|
77
|
+
# @param zip [Zip::File] ZIP archive
|
|
78
|
+
# @return [Model::Repository] Repository instance
|
|
79
|
+
def load_marshal_repository(zip)
|
|
80
|
+
entry = zip.find_entry("repository.marshal")
|
|
81
|
+
raise "Serialized repository not found" unless entry
|
|
82
|
+
|
|
83
|
+
Marshal.load(entry.get_input_stream.read)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Load repository from JSON format
|
|
87
|
+
# @param zip [Zip::File] ZIP archive
|
|
88
|
+
# @return [Model::Repository] Repository instance
|
|
89
|
+
def load_json_repository(zip)
|
|
90
|
+
entry = zip.find_entry("repository.json")
|
|
91
|
+
raise "Serialized repository not found" unless entry
|
|
92
|
+
|
|
93
|
+
Model::Repository.from_json(entry.get_input_stream.read)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Load repository from YAML format
|
|
97
|
+
# @param zip [Zip::File] ZIP archive
|
|
98
|
+
# @return [Model::Repository] Repository instance
|
|
99
|
+
def load_yaml_repository(zip)
|
|
100
|
+
entry = zip.find_entry("repository.yaml")
|
|
101
|
+
raise "Serialized repository not found" unless entry
|
|
102
|
+
|
|
103
|
+
Model::Repository.from_yaml(entry.get_input_stream.read)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Load repository from EXPRESS files
|
|
107
|
+
# @param zip [Zip::File] ZIP archive
|
|
108
|
+
# @return [Model::Repository] Repository instance
|
|
109
|
+
def load_from_express_files(zip)
|
|
110
|
+
repository = Model::Repository.new
|
|
111
|
+
|
|
112
|
+
# Find all EXPRESS files in the package
|
|
113
|
+
express_entries = zip.entries.select do |entry|
|
|
114
|
+
entry.name.start_with?("express_files/") && entry.name.end_with?(".exp")
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Parse each EXPRESS file
|
|
118
|
+
express_entries.each do |entry|
|
|
119
|
+
content = entry.get_input_stream.read
|
|
120
|
+
schema = Expressir::Express::Parser.from_exp(content)
|
|
121
|
+
repository.schemas << schema.schemas.first if schema.schemas.any?
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Resolve references
|
|
125
|
+
repository.resolve_all_references
|
|
126
|
+
|
|
127
|
+
repository
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Load and restore indexes
|
|
131
|
+
# @param zip [Zip::File] ZIP archive
|
|
132
|
+
# @param repository [Model::Repository] Repository instance
|
|
133
|
+
# @return [void]
|
|
134
|
+
def load_indexes(zip, repository)
|
|
135
|
+
indexes = {}
|
|
136
|
+
|
|
137
|
+
%w[entity_index type_index reference_index].each do |name|
|
|
138
|
+
entry = zip.find_entry("#{name}.marshal")
|
|
139
|
+
if entry
|
|
140
|
+
indexes[name.to_sym] =
|
|
141
|
+
Marshal.load(entry.get_input_stream.read)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
repository.restore_indexes(**indexes) unless indexes.empty?
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
class SchemaManifest < Lutaml::Model::Serializable
|
|
5
|
+
attribute :schemas, "Expressir::SchemaManifestEntry",
|
|
6
|
+
collection: true,
|
|
7
|
+
initialize_empty: true
|
|
8
|
+
attribute :path, :string
|
|
9
|
+
attr_accessor :output_path
|
|
10
|
+
|
|
11
|
+
def initialize(**args)
|
|
12
|
+
@path = path_relative_to_absolute(path) if path
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def base_path
|
|
17
|
+
File.dirname(@path)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
yaml do
|
|
21
|
+
map "schemas", with: { from: :schemas_from_yaml, to: :schemas_to_yaml }
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.from_file(path)
|
|
25
|
+
from_yaml(File.read(path)).tap do |x|
|
|
26
|
+
x.set_initial_path(path)
|
|
27
|
+
end
|
|
28
|
+
rescue StandardError => e
|
|
29
|
+
raise ManifestValidationError,
|
|
30
|
+
"Invalid schema manifest format: #{e.message}"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def to_file(to_path = path)
|
|
34
|
+
FileUtils.mkdir_p(File.dirname(to_path))
|
|
35
|
+
File.write(to_path, to_yaml)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def set_initial_path(new_path)
|
|
39
|
+
@path = path_relative_to_absolute(new_path)
|
|
40
|
+
schemas.each do |schema|
|
|
41
|
+
schema.path = path_relative_to_absolute(schema.path)
|
|
42
|
+
schema.container_path = File.expand_path(@path)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def schemas_from_yaml(model, value)
|
|
47
|
+
model.schemas = value.map do |k, v|
|
|
48
|
+
SchemaManifestEntry.new(id: k,
|
|
49
|
+
path: path_relative_to_absolute(v["path"]))
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def schemas_to_yaml(model, doc)
|
|
54
|
+
doc["schemas"] = model.schemas.sort_by(&:id).to_h do |schema|
|
|
55
|
+
# We are outputting the schemas collection file to the directory where
|
|
56
|
+
# the collection config is at (assumed to be Dir.pwd), not to the
|
|
57
|
+
# directory we sourced the manifest from, e.g.
|
|
58
|
+
# documents/iso-10303-41/schemas.yaml.
|
|
59
|
+
|
|
60
|
+
# So the schema.container_path = @config.path is not
|
|
61
|
+
# in fact needed, as the files are already absolute. This notion of
|
|
62
|
+
# using @path to create relative paths was misconceived
|
|
63
|
+
[
|
|
64
|
+
schema.id,
|
|
65
|
+
{
|
|
66
|
+
"path" => path_absolute_to_relative(
|
|
67
|
+
schema.path,
|
|
68
|
+
model.output_path || Dir.pwd,
|
|
69
|
+
),
|
|
70
|
+
},
|
|
71
|
+
]
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def path_relative_to_absolute(relative_path)
|
|
76
|
+
return relative_path if relative_path.nil? || relative_path.empty?
|
|
77
|
+
|
|
78
|
+
eval_path = Pathname.new(relative_path)
|
|
79
|
+
return relative_path if eval_path.absolute?
|
|
80
|
+
|
|
81
|
+
# Or based on current working directory?
|
|
82
|
+
return relative_path unless @path
|
|
83
|
+
|
|
84
|
+
# ... but if this calculates path, we end up expanding it anyway
|
|
85
|
+
|
|
86
|
+
Pathname.new(File.dirname(@path)).join(eval_path).expand_path.to_s
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def path_absolute_to_relative(absolute_path, container_path)
|
|
90
|
+
return absolute_path if absolute_path.nil? || absolute_path.empty?
|
|
91
|
+
|
|
92
|
+
container_path ||= @path
|
|
93
|
+
return absolute_path unless container_path
|
|
94
|
+
return absolute_path if container_path.empty?
|
|
95
|
+
|
|
96
|
+
p = Pathname.new(container_path)
|
|
97
|
+
container = p.directory? ? p.to_s : p.dirname
|
|
98
|
+
|
|
99
|
+
# Check if absolute_path is actually absolute
|
|
100
|
+
abs_pathname = Pathname.new(absolute_path)
|
|
101
|
+
return absolute_path unless abs_pathname.absolute?
|
|
102
|
+
|
|
103
|
+
abs_pathname.relative_path_from(container).to_s
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def update_path(new_path)
|
|
107
|
+
if @path.nil?
|
|
108
|
+
@path = new_path
|
|
109
|
+
return @path
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
old_base_path = File.dirname(@path)
|
|
113
|
+
new_base_path = File.dirname(new_path)
|
|
114
|
+
update_schema_path(old_base_path, new_base_path)
|
|
115
|
+
|
|
116
|
+
@path = new_path
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def concat(another_config)
|
|
120
|
+
unless another_config.is_a?(self.class)
|
|
121
|
+
raise StandardError,
|
|
122
|
+
"Can only concat a SchemaManifest object."
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# We need to update the relative paths when paths exist
|
|
126
|
+
if path && another_config.path && path != another_config.path
|
|
127
|
+
new_config = another_config.dup
|
|
128
|
+
new_config.update_path(path)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
schemas.concat(another_config.schemas)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def save_to_path(filename)
|
|
135
|
+
new_config = dup.tap do |c|
|
|
136
|
+
c.path = filename
|
|
137
|
+
c.update_path(File.dirname(filename))
|
|
138
|
+
c.output_path = filename
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
File.open(filename, "w") do |f|
|
|
142
|
+
puts "Writing #{filename}..."
|
|
143
|
+
f.write(new_config.to_yaml)
|
|
144
|
+
puts "Done."
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def update_schema_path(old_base_path, new_base_path)
|
|
149
|
+
schemas.each do |schema|
|
|
150
|
+
schema_path = Pathname.new(schema.path)
|
|
151
|
+
next if schema_path.absolute?
|
|
152
|
+
|
|
153
|
+
schema_path = (Pathname.new(old_base_path) + schema_path).cleanpath
|
|
154
|
+
# This is the new relative schema_path
|
|
155
|
+
schema.path = schema_path.relative_path_from(new_base_path)
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
class SchemaManifestEntry < Lutaml::Model::Serializable
|
|
5
|
+
attribute :id, :string
|
|
6
|
+
attribute :path, :string
|
|
7
|
+
# attribute :schemas_only, :boolean
|
|
8
|
+
|
|
9
|
+
# container_path is a copy of Expressir::SchemaManifest.path,
|
|
10
|
+
# used to resolve the path of each schema within
|
|
11
|
+
# Expressir::SchemaManifest.schemas,
|
|
12
|
+
# when Expressir::SchemaManifest.schemas is recursively flattened
|
|
13
|
+
attr_accessor :container_path
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
module Expressir
|
|
2
|
+
# Gem version. Wrapped in a Version module so that lib/expressir.rb can
|
|
3
|
+
# autoload it (Ruby autoload only works for module/class constants, not
|
|
4
|
+
# for string constants like `Expressir::VERSION`).
|
|
5
|
+
module Version
|
|
6
|
+
VERSION = "2.4.29".freeze
|
|
7
|
+
end
|
|
8
|
+
end
|
data/lib/expressir.rb
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
require "lutaml/model"
|
|
2
|
+
# Liquid is intentionally NOT required here: lutaml-model's Liquefiable
|
|
3
|
+
# lazily loads it on first #to_liquid (lutaml-model#800), keeping ~170ms
|
|
4
|
+
# off the boot of every consumer that never renders Liquid templates.
|
|
5
|
+
|
|
6
|
+
# ..........................................................
|
|
7
|
+
# https://bugs.ruby-lang.org/issues/19319
|
|
8
|
+
# The issue is that this bug is fixed for 3.1 and above,
|
|
9
|
+
# but not for 3.0 or 2.7, so we need a "safe" function
|
|
10
|
+
# ..........................................................
|
|
11
|
+
if RUBY_VERSION < "3.1"
|
|
12
|
+
class String
|
|
13
|
+
def safe_downcase
|
|
14
|
+
each_char.map(&:downcase).join
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
else
|
|
18
|
+
class String
|
|
19
|
+
def safe_downcase
|
|
20
|
+
downcase
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
module Expressir
|
|
26
|
+
# Namespace modules - autoload loads the namespace file which contains
|
|
27
|
+
# autoload definitions for classes within that namespace
|
|
28
|
+
autoload :Config, "#{__dir__}/expressir/config"
|
|
29
|
+
extend Config
|
|
30
|
+
|
|
31
|
+
autoload :Version, "#{__dir__}/expressir/version"
|
|
32
|
+
autoload :Mapping, "#{__dir__}/expressir/mapping"
|
|
33
|
+
|
|
34
|
+
# Error classes — autoload the same errors.rb file from each name.
|
|
35
|
+
# The first reference triggers the load; the file defines all 21 classes.
|
|
36
|
+
autoload :Error, "#{__dir__}/expressir/errors"
|
|
37
|
+
autoload :FileNotFoundError, "#{__dir__}/expressir/errors"
|
|
38
|
+
autoload :ManifestNotFoundError, "#{__dir__}/expressir/errors"
|
|
39
|
+
autoload :PackageNotFoundError, "#{__dir__}/expressir/errors"
|
|
40
|
+
autoload :SchemaNotFoundError, "#{__dir__}/expressir/errors"
|
|
41
|
+
autoload :UsageError, "#{__dir__}/expressir/errors"
|
|
42
|
+
autoload :MissingRequiredArgumentError, "#{__dir__}/expressir/errors"
|
|
43
|
+
autoload :InvalidOptionError, "#{__dir__}/expressir/errors"
|
|
44
|
+
autoload :ValidationError, "#{__dir__}/expressir/errors"
|
|
45
|
+
autoload :ManifestValidationError, "#{__dir__}/expressir/errors"
|
|
46
|
+
autoload :SchemaValidationError, "#{__dir__}/expressir/errors"
|
|
47
|
+
autoload :ReferentialIntegrityError, "#{__dir__}/expressir/errors"
|
|
48
|
+
autoload :NoValidSchemaPathsError, "#{__dir__}/expressir/errors"
|
|
49
|
+
autoload :CommandError, "#{__dir__}/expressir/errors"
|
|
50
|
+
autoload :PackageBuildError, "#{__dir__}/expressir/errors"
|
|
51
|
+
autoload :PackageReadError, "#{__dir__}/expressir/errors"
|
|
52
|
+
autoload :PackageExtractError, "#{__dir__}/expressir/errors"
|
|
53
|
+
autoload :PackageValidationError, "#{__dir__}/expressir/errors"
|
|
54
|
+
autoload :PackageListError, "#{__dir__}/expressir/errors"
|
|
55
|
+
autoload :PackageSearchError, "#{__dir__}/expressir/errors"
|
|
56
|
+
autoload :PackageTreeError, "#{__dir__}/expressir/errors"
|
|
57
|
+
|
|
58
|
+
# Backward-compatible top-level VERSION constant.
|
|
59
|
+
# Expressir::VERSION is a string, which Ruby autoload cannot lazy-load
|
|
60
|
+
# (autoload only works for module/class constants). The actual value
|
|
61
|
+
# lives in Expressir::Version::VERSION, autoloaded on first reference.
|
|
62
|
+
# This const_missing triggers the autoload when Expressir::VERSION is
|
|
63
|
+
# referenced, then caches the result.
|
|
64
|
+
def self.const_missing(name)
|
|
65
|
+
return Version::VERSION if name == :VERSION
|
|
66
|
+
|
|
67
|
+
super
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
autoload :Benchmark, "#{__dir__}/expressir/benchmark"
|
|
71
|
+
autoload :Coverage, "#{__dir__}/expressir/coverage"
|
|
72
|
+
|
|
73
|
+
autoload :Express, "#{__dir__}/expressir/express"
|
|
74
|
+
autoload :Model, "#{__dir__}/expressir/model"
|
|
75
|
+
autoload :Commands, "#{__dir__}/expressir/commands"
|
|
76
|
+
autoload :Changes, "#{__dir__}/expressir/changes"
|
|
77
|
+
autoload :Package, "#{__dir__}/expressir/package"
|
|
78
|
+
autoload :Manifest, "#{__dir__}/expressir/manifest"
|
|
79
|
+
autoload :Eengine, "#{__dir__}/expressir/eengine"
|
|
80
|
+
autoload :SchemaManifest, "#{__dir__}/expressir/schema_manifest"
|
|
81
|
+
autoload :SchemaManifestEntry, "#{__dir__}/expressir/schema_manifest_entry"
|
|
82
|
+
|
|
83
|
+
# CLI is loaded last so that namespace autoloads are defined first
|
|
84
|
+
# CLI uses Expressir::Commands::* which triggers autoload
|
|
85
|
+
autoload :Cli, "#{__dir__}/expressir/cli"
|
|
86
|
+
|
|
87
|
+
def self.root
|
|
88
|
+
File.dirname(__dir__)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def self.root_path
|
|
92
|
+
@root_path ||= Pathname.new(Expressir.root)
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# `rake verify:remarks` — the remark conservation gate. Runs only the
|
|
4
|
+
# production-scale checks (`:production_scale` tag; see spec_helper's
|
|
5
|
+
# filter), which the default suite excludes: they parse a full-size
|
|
6
|
+
# schema and cost about a minute.
|
|
7
|
+
#
|
|
8
|
+
# Guarded: rake-compiler-dock's bundle carries production dependencies
|
|
9
|
+
# only, and cross-gem rake invocations must still load the task files.
|
|
10
|
+
if defined?(RSpec)
|
|
11
|
+
RSpec::Core::RakeTask.new(:"verify:remarks") do |task|
|
|
12
|
+
task.rspec_opts = "--tag production_scale"
|
|
13
|
+
end
|
|
14
|
+
else
|
|
15
|
+
warn "verify_remarks: rspec not available — task not defined"
|
|
16
|
+
end
|
data/rakelib/native.rake
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Prebuilt platform gems (TODO.suma-improvements/01): the compiled Rust
|
|
4
|
+
# core ships inside per-platform gems, mirroring the parsanol-ruby
|
|
5
|
+
# pattern (RbSys::ExtensionTask + cross_compiling staging). The source
|
|
6
|
+
# gem keeps its gemspec-declared extconf build; platform gems carry the
|
|
7
|
+
# artifact in lib/expressir/, which core.rb's first require finds.
|
|
8
|
+
begin
|
|
9
|
+
require "rb_sys/extensiontask"
|
|
10
|
+
|
|
11
|
+
gemspec = Gem::Specification.load("expressir.gemspec")
|
|
12
|
+
|
|
13
|
+
RbSys::ExtensionTask.new("expressir_core", gemspec) do |ext|
|
|
14
|
+
ext.lib_dir = "lib/expressir"
|
|
15
|
+
# rb-sys stages the cross-built artifact itself; a manual cp into
|
|
16
|
+
# lib_dir here would claim the file rake-compiler's own
|
|
17
|
+
# copy:expressir_core:<host-platform> task owns, and the cross gem's
|
|
18
|
+
# dependency chain would then force a host-ruby build (rb-sys
|
|
19
|
+
# refuses windows bindings from linux headers).
|
|
20
|
+
end
|
|
21
|
+
rescue LoadError
|
|
22
|
+
# rake-compiler/rb_sys not installed (consumer checkouts); the native
|
|
23
|
+
# gem tasks are a maintainer/CI concern only.
|
|
24
|
+
end
|
data/rakelib/oracle.rake
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "digest"
|
|
4
|
+
require "fileutils"
|
|
5
|
+
|
|
6
|
+
ORACLE_TAG = "eeng-5.2.8"
|
|
7
|
+
ORACLE_BASE =
|
|
8
|
+
"https://github.com/expresslang/eengine-releases/releases/download/#{ORACLE_TAG}".freeze
|
|
9
|
+
# Release-asset naming convention for the pinned tag: platform prefix
|
|
10
|
+
# and CPU tag used by expresslang/eengine-releases.
|
|
11
|
+
ORACLE_ASSET_NAMES = {
|
|
12
|
+
%w[darwin arm64] => "mac-arm64",
|
|
13
|
+
%w[darwin x86_64] => "mac-x86-64",
|
|
14
|
+
%w[linux x86_64] => "lnx-x86-64",
|
|
15
|
+
%w[linux arm64] => "lnx-arm64",
|
|
16
|
+
%w[mingw x86_64] => "win-x86-64",
|
|
17
|
+
}.freeze
|
|
18
|
+
|
|
19
|
+
namespace :oracle do
|
|
20
|
+
desc "Fetch the eengine oracle (#{ORACLE_TAG}) into tmp/oracle/eengine " \
|
|
21
|
+
"for the SHTOLO corpus differential"
|
|
22
|
+
task :fetch do
|
|
23
|
+
platform = [Gem::Platform.local.os, Gem::Platform.local.cpu]
|
|
24
|
+
tag = ORACLE_ASSET_NAMES[platform]
|
|
25
|
+
abort "no #{ORACLE_TAG} asset for #{platform.join('-')}" unless tag
|
|
26
|
+
|
|
27
|
+
version = ORACLE_TAG.delete_prefix("eeng-")
|
|
28
|
+
asset = "eengine-#{version}-#{tag}-sbcl#{'.exe' if platform.first == 'mingw'}"
|
|
29
|
+
target = File.expand_path("../tmp/oracle/eengine", __dir__)
|
|
30
|
+
digest = "#{target}.sha256"
|
|
31
|
+
|
|
32
|
+
if File.executable?(target)
|
|
33
|
+
expected = File.read(digest).strip.split(/\s+/).first if File.exist?(digest)
|
|
34
|
+
if expected && Digest::SHA256.file(target).hexdigest == expected
|
|
35
|
+
warn "oracle already present: #{target}"
|
|
36
|
+
exit 0
|
|
37
|
+
end
|
|
38
|
+
warn "cached oracle is missing or corrupt; refetching"
|
|
39
|
+
rm_f target
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
dir = File.dirname(target)
|
|
43
|
+
mkdir_p dir
|
|
44
|
+
download = File.join(dir, "#{asset}.part")
|
|
45
|
+
sh "curl", "-fSL", "-o", download, "#{ORACLE_BASE}/#{asset}"
|
|
46
|
+
sha = Digest::SHA256.file(download).hexdigest
|
|
47
|
+
mv download, target
|
|
48
|
+
chmod 0o755, target
|
|
49
|
+
File.write(digest, "#{sha} eengine\n")
|
|
50
|
+
puts "oracle ready: #{target} (#{sha})"
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
namespace :verify do
|
|
4
|
+
desc "Check remarks against the recorded round-trip gaps, production included"
|
|
5
|
+
task :remarks do
|
|
6
|
+
specs = %w[
|
|
7
|
+
spec/expressir/remark_conservation_spec.rb
|
|
8
|
+
spec/expressir/remark_ownership_spec.rb
|
|
9
|
+
spec/expressir/express/formatter_remark_conservation_spec.rb
|
|
10
|
+
spec/expressir/express/formatter_remark_ownership_spec.rb
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
sh({ "EXPRESSIR_PRODUCTION_SCALE" => "1" },
|
|
14
|
+
"bundle", "exec", "rspec", *specs)
|
|
15
|
+
end
|
|
16
|
+
end
|