expressir 2.4.35 → 2.4.37
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 +4 -4
- data/.github/workflows/conformance.yml +34 -0
- data/.gitignore +3 -0
- data/Gemfile +1 -1
- data/TODO.sota/00-overview.md +57 -0
- data/TODO.sota/01-type-checking.md +115 -0
- data/TODO.sota/02-evaluator.md +86 -0
- data/TODO.sota/03-conformance.md +53 -0
- data/TODO.sota/04-lsp.md +70 -0
- data/TODO.sota/05-interop.md +55 -0
- data/TODO.sota/06-dialects.md +57 -0
- data/TODO.sota/07-reference-artifacts.md +55 -0
- data/docs/_guides/interop/index.adoc +25 -0
- data/docs/_guides/interop/json-schema.adoc +88 -0
- data/docs/_guides/interop/owl-rdf.adoc +87 -0
- data/docs/_guides/reference/checker-notes.adoc +55 -0
- data/docs/_guides/reference/checker.adoc +36 -0
- data/docs/_guides/reference/evaluator.adoc +40 -0
- data/docs/_guides/reference/grammar-crosswalk.adoc +299 -0
- data/docs/_guides/reference/index.adoc +22 -0
- data/docs/_guides/reference/lsp.adoc +41 -0
- data/docs/_guides/reference/p21.adoc +30 -0
- data/docs/_guides/reference/shtolo.adoc +36 -0
- data/exe/expressir-lsp +6 -0
- data/expressir.gemspec +2 -2
- data/ext/expressir_core/Cargo.toml +1 -1
- data/lib/expressir/cli.rb +18 -0
- data/lib/expressir/commands/check.rb +3 -1
- data/lib/expressir/commands/export_json_schema.rb +29 -0
- data/lib/expressir/commands/export_owl.rb +26 -0
- data/lib/expressir/commands/validate.rb +3 -0
- data/lib/expressir/commands.rb +2 -0
- data/lib/expressir/conformance/trend.rb +100 -0
- data/lib/expressir/conformance.rb +8 -0
- data/lib/expressir/eval/environment.rb +83 -0
- data/lib/expressir/eval/expression.rb +610 -0
- data/lib/expressir/eval/interpreter.rb +316 -0
- data/lib/expressir/eval/rules.rb +88 -0
- data/lib/expressir/eval/values.rb +74 -0
- data/lib/expressir/eval.rb +17 -0
- data/lib/expressir/express/builders/expression_builder.rb +9 -1
- data/lib/expressir/express/checker.rb +779 -2
- data/lib/expressir/express/dialect.rb +44 -0
- data/lib/expressir/express/formatters/expressions_formatter.rb +4 -1
- data/lib/expressir/express/parser.rb +9 -4
- data/lib/expressir/express.rb +1 -0
- data/lib/expressir/interop/json_schema.rb +195 -0
- data/lib/expressir/interop/owl.rb +216 -0
- data/lib/expressir/interop.rb +13 -0
- data/lib/expressir/lsp/document.rb +226 -0
- data/lib/expressir/lsp/server.rb +184 -0
- data/lib/expressir/lsp/workspace.rb +402 -0
- data/lib/expressir/lsp.rb +11 -0
- data/lib/expressir/mapping/refpath.rb +65 -4
- data/lib/expressir/reference/grammar_crosswalk.rb +122 -0
- data/lib/expressir/reference/grammar_crosswalk.yml +800 -0
- data/lib/expressir/reference/note_catalog.rb +54 -0
- data/lib/expressir/reference.rb +10 -0
- data/lib/expressir/version.rb +1 -1
- data/lib/expressir.rb +4 -0
- data/lib/tasks/conformance.rake +27 -0
- data/lib/tasks/reference.rake +25 -0
- metadata +50 -4
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Reference
|
|
5
|
+
# Catalog of Checker note ids, generated from the checker source so
|
|
6
|
+
# the published guide cannot drift from the implementation.
|
|
7
|
+
class NoteCatalog
|
|
8
|
+
CHECKER_PATH = File.expand_path("../express/checker.rb", __dir__)
|
|
9
|
+
NOTE_CALL = /note!\(:([a-z0-9_]+)/
|
|
10
|
+
|
|
11
|
+
class << self
|
|
12
|
+
def checker_path
|
|
13
|
+
CHECKER_PATH
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def entries
|
|
17
|
+
File.read(CHECKER_PATH).scan(NOTE_CALL).flatten.tally.sort.to_h
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def ids
|
|
21
|
+
entries.keys
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def render_adoc
|
|
25
|
+
lines = [
|
|
26
|
+
"= Checker note-id catalog",
|
|
27
|
+
"",
|
|
28
|
+
"// Generated from lib/expressir/express/checker.rb by",
|
|
29
|
+
"// `rake reference:notes`. Do not edit by hand; the reference",
|
|
30
|
+
"// spec fails when this file is stale.",
|
|
31
|
+
"",
|
|
32
|
+
"== Purpose",
|
|
33
|
+
"",
|
|
34
|
+
"Every note id the Checker can raise, with the number of call",
|
|
35
|
+
"sites in the implementation. New checks use `:check_*` ids;",
|
|
36
|
+
"the conformance-derived ids (`:check_expr_*`, `:check_dialect_*`)",
|
|
37
|
+
"cite their clause in the note message.",
|
|
38
|
+
"",
|
|
39
|
+
'[cols="3,1", options="header"]',
|
|
40
|
+
"|===",
|
|
41
|
+
"| Note id | Call sites",
|
|
42
|
+
"",
|
|
43
|
+
*entries.map { |id, count| "| `#{id}` | #{count}" },
|
|
44
|
+
"|===",
|
|
45
|
+
"",
|
|
46
|
+
"The catalog covers #{ids.size} note ids.",
|
|
47
|
+
"",
|
|
48
|
+
]
|
|
49
|
+
lines.join("\n")
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
# Citable reference artifacts generated from the implementation:
|
|
5
|
+
# the grammar cross-walk and the checker note-id catalog.
|
|
6
|
+
module Reference
|
|
7
|
+
autoload :GrammarCrosswalk, "#{__dir__}/reference/grammar_crosswalk"
|
|
8
|
+
autoload :NoteCatalog, "#{__dir__}/reference/note_catalog"
|
|
9
|
+
end
|
|
10
|
+
end
|
data/lib/expressir/version.rb
CHANGED
data/lib/expressir.rb
CHANGED
|
@@ -31,6 +31,7 @@ module Expressir
|
|
|
31
31
|
autoload :Version, "#{__dir__}/expressir/version"
|
|
32
32
|
autoload :Mapping, "#{__dir__}/expressir/mapping"
|
|
33
33
|
autoload :P21, "#{__dir__}/expressir/p21"
|
|
34
|
+
autoload :Reference, "#{__dir__}/expressir/reference"
|
|
34
35
|
|
|
35
36
|
# Error classes — autoload the same errors.rb file from each name.
|
|
36
37
|
# The first reference triggers the load; the file defines all 21 classes.
|
|
@@ -75,9 +76,12 @@ module Expressir
|
|
|
75
76
|
autoload :Model, "#{__dir__}/expressir/model"
|
|
76
77
|
autoload :Commands, "#{__dir__}/expressir/commands"
|
|
77
78
|
autoload :Changes, "#{__dir__}/expressir/changes"
|
|
79
|
+
autoload :Conformance, "#{__dir__}/expressir/conformance"
|
|
78
80
|
autoload :Package, "#{__dir__}/expressir/package"
|
|
79
81
|
autoload :Manifest, "#{__dir__}/expressir/manifest"
|
|
80
82
|
autoload :Eengine, "#{__dir__}/expressir/eengine"
|
|
83
|
+
autoload :Interop, "#{__dir__}/expressir/interop"
|
|
84
|
+
autoload :Lsp, "#{__dir__}/expressir/lsp"
|
|
81
85
|
autoload :SchemaManifest, "#{__dir__}/expressir/schema_manifest"
|
|
82
86
|
autoload :SchemaManifestEntry, "#{__dir__}/expressir/schema_manifest_entry"
|
|
83
87
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
desc "Property-based conformance harness over the full corpus " \
|
|
4
|
+
"(parse → format → parse idempotence)"
|
|
5
|
+
task :conformance do
|
|
6
|
+
ENV["EXPRESSIR_CONFORMANCE"] = "1"
|
|
7
|
+
sh "bundle exec rspec spec/expressir/express/formatter_roundtrip_conformance_spec.rb"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
namespace :conformance do
|
|
11
|
+
desc "Measure parse, diagnostic and idempotence rates over the corpus " \
|
|
12
|
+
"and write a JSON trend artifact"
|
|
13
|
+
task :trend do
|
|
14
|
+
require "expressir"
|
|
15
|
+
|
|
16
|
+
stepmod = ENV["STEPMOD_DIR"] ||
|
|
17
|
+
File.expand_path("~/src/mn/iso-10303-stepmod")
|
|
18
|
+
corpus = File.join(stepmod, "data/resources")
|
|
19
|
+
files = Dir[File.join(corpus, "**/*.exp")]
|
|
20
|
+
.select { |file| File.size(file) < 250_000 }
|
|
21
|
+
output = ENV["CONFORMANCE_TREND_OUT"] || "conformance-trend.json"
|
|
22
|
+
report = Expressir::Conformance::Trend.run(files, output: output)
|
|
23
|
+
puts "wrote #{output} " \
|
|
24
|
+
"(parse #{report['parse_rate']}, idempotence " \
|
|
25
|
+
"#{report['idempotence_rate']}, diagnostics #{report['diagnostic_rate']})"
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
namespace :reference do
|
|
4
|
+
desc "Regenerate the grammar cross-walk guide"
|
|
5
|
+
task :crosswalk do
|
|
6
|
+
require "expressir"
|
|
7
|
+
|
|
8
|
+
path = Expressir.root_path.join(
|
|
9
|
+
"docs/_guides/reference/grammar-crosswalk.adoc",
|
|
10
|
+
)
|
|
11
|
+
File.write(path, Expressir::Reference::GrammarCrosswalk.render_adoc)
|
|
12
|
+
puts "wrote #{path}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
desc "Regenerate the checker note-id catalog"
|
|
16
|
+
task :notes do
|
|
17
|
+
require "expressir"
|
|
18
|
+
|
|
19
|
+
path = Expressir.root_path.join(
|
|
20
|
+
"docs/_guides/reference/checker-notes.adoc",
|
|
21
|
+
)
|
|
22
|
+
File.write(path, Expressir::Reference::NoteCatalog.render_adoc)
|
|
23
|
+
puts "wrote #{path}"
|
|
24
|
+
end
|
|
25
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: expressir
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.4.
|
|
4
|
+
version: 2.4.37
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|
|
@@ -100,14 +100,14 @@ dependencies:
|
|
|
100
100
|
requirements:
|
|
101
101
|
- - "~>"
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: 0.8.
|
|
103
|
+
version: 0.8.114
|
|
104
104
|
type: :runtime
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
108
|
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: 0.8.
|
|
110
|
+
version: 0.8.114
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: moxml
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -246,6 +246,7 @@ email:
|
|
|
246
246
|
- open.source@ribose.com
|
|
247
247
|
executables:
|
|
248
248
|
- expressir
|
|
249
|
+
- expressir-lsp
|
|
249
250
|
extensions:
|
|
250
251
|
- ext/expressir_core/extconf.rb
|
|
251
252
|
extra_rdoc_files: []
|
|
@@ -253,6 +254,7 @@ files:
|
|
|
253
254
|
- ".cargo/config.toml"
|
|
254
255
|
- ".github/scripts/test_installed_gem.rb"
|
|
255
256
|
- ".github/workflows/codeql.yml"
|
|
257
|
+
- ".github/workflows/conformance.yml"
|
|
256
258
|
- ".github/workflows/docs.yml"
|
|
257
259
|
- ".github/workflows/links.yml"
|
|
258
260
|
- ".github/workflows/native-gems.yml"
|
|
@@ -349,6 +351,14 @@ files:
|
|
|
349
351
|
- TODO.parity-ee/19-architecture.md
|
|
350
352
|
- TODO.parity-ee/parity-matrix.md
|
|
351
353
|
- TODO.refpath-v2/00-overview.md
|
|
354
|
+
- TODO.sota/00-overview.md
|
|
355
|
+
- TODO.sota/01-type-checking.md
|
|
356
|
+
- TODO.sota/02-evaluator.md
|
|
357
|
+
- TODO.sota/03-conformance.md
|
|
358
|
+
- TODO.sota/04-lsp.md
|
|
359
|
+
- TODO.sota/05-interop.md
|
|
360
|
+
- TODO.sota/06-dialects.md
|
|
361
|
+
- TODO.sota/07-reference-artifacts.md
|
|
352
362
|
- TODO.suma-improvements/00-overview.md
|
|
353
363
|
- TODO.suma-improvements/01-prebuilt-platform-gems.md
|
|
354
364
|
- TODO.suma-improvements/02-suma-e2e.md
|
|
@@ -382,6 +392,9 @@ files:
|
|
|
382
392
|
- docs/_guides/cli/validate-schemas.adoc
|
|
383
393
|
- docs/_guides/formatter/formatter-architecture.adoc
|
|
384
394
|
- docs/_guides/index.adoc
|
|
395
|
+
- docs/_guides/interop/index.adoc
|
|
396
|
+
- docs/_guides/interop/json-schema.adoc
|
|
397
|
+
- docs/_guides/interop/owl-rdf.adoc
|
|
385
398
|
- docs/_guides/ler/creating-packages.adoc
|
|
386
399
|
- docs/_guides/ler/index.adoc
|
|
387
400
|
- docs/_guides/ler/loading-packages.adoc
|
|
@@ -398,6 +411,14 @@ files:
|
|
|
398
411
|
- docs/_guides/manifests/index.adoc
|
|
399
412
|
- docs/_guides/manifests/resolving-manifests.adoc
|
|
400
413
|
- docs/_guides/manifests/validating-manifests.adoc
|
|
414
|
+
- docs/_guides/reference/checker-notes.adoc
|
|
415
|
+
- docs/_guides/reference/checker.adoc
|
|
416
|
+
- docs/_guides/reference/evaluator.adoc
|
|
417
|
+
- docs/_guides/reference/grammar-crosswalk.adoc
|
|
418
|
+
- docs/_guides/reference/index.adoc
|
|
419
|
+
- docs/_guides/reference/lsp.adoc
|
|
420
|
+
- docs/_guides/reference/p21.adoc
|
|
421
|
+
- docs/_guides/reference/shtolo.adoc
|
|
401
422
|
- docs/_guides/ruby-api/formatting-schemas.adoc
|
|
402
423
|
- docs/_guides/ruby-api/index.adoc
|
|
403
424
|
- docs/_guides/ruby-api/parsing-files.adoc
|
|
@@ -437,6 +458,7 @@ files:
|
|
|
437
458
|
- exe/expressir
|
|
438
459
|
- exe/expressir-format
|
|
439
460
|
- exe/expressir-format-test
|
|
461
|
+
- exe/expressir-lsp
|
|
440
462
|
- expressir.gemspec
|
|
441
463
|
- ext/expressir_core/Cargo.toml
|
|
442
464
|
- ext/expressir_core/extconf.rb
|
|
@@ -460,6 +482,8 @@ files:
|
|
|
460
482
|
- lib/expressir/commands/clean.rb
|
|
461
483
|
- lib/expressir/commands/coverage.rb
|
|
462
484
|
- lib/expressir/commands/expand.rb
|
|
485
|
+
- lib/expressir/commands/export_json_schema.rb
|
|
486
|
+
- lib/expressir/commands/export_owl.rb
|
|
463
487
|
- lib/expressir/commands/file_violations.rb
|
|
464
488
|
- lib/expressir/commands/fix.rb
|
|
465
489
|
- lib/expressir/commands/flatten.rb
|
|
@@ -477,6 +501,8 @@ files:
|
|
|
477
501
|
- lib/expressir/commands/version_command.rb
|
|
478
502
|
- lib/expressir/commands/xsd.rb
|
|
479
503
|
- lib/expressir/config.rb
|
|
504
|
+
- lib/expressir/conformance.rb
|
|
505
|
+
- lib/expressir/conformance/trend.rb
|
|
480
506
|
- lib/expressir/coverage.rb
|
|
481
507
|
- lib/expressir/eengine.rb
|
|
482
508
|
- lib/expressir/eengine/arm_compare_report.rb
|
|
@@ -485,6 +511,12 @@ files:
|
|
|
485
511
|
- lib/expressir/eengine/mim_compare_report.rb
|
|
486
512
|
- lib/expressir/eengine/modified_object.rb
|
|
487
513
|
- lib/expressir/errors.rb
|
|
514
|
+
- lib/expressir/eval.rb
|
|
515
|
+
- lib/expressir/eval/environment.rb
|
|
516
|
+
- lib/expressir/eval/expression.rb
|
|
517
|
+
- lib/expressir/eval/interpreter.rb
|
|
518
|
+
- lib/expressir/eval/rules.rb
|
|
519
|
+
- lib/expressir/eval/values.rb
|
|
488
520
|
- lib/expressir/express.rb
|
|
489
521
|
- lib/expressir/express/adoc_hyperlink_formatter.rb
|
|
490
522
|
- lib/expressir/express/adoc_source_formatter.rb
|
|
@@ -530,6 +562,7 @@ files:
|
|
|
530
562
|
- lib/expressir/express/checker.rb
|
|
531
563
|
- lib/expressir/express/concatenator.rb
|
|
532
564
|
- lib/expressir/express/core.rb
|
|
565
|
+
- lib/expressir/express/dialect.rb
|
|
533
566
|
- lib/expressir/express/error.rb
|
|
534
567
|
- lib/expressir/express/formatter.rb
|
|
535
568
|
- lib/expressir/express/formatters.rb
|
|
@@ -573,7 +606,14 @@ files:
|
|
|
573
606
|
- lib/expressir/express/source_formatter.rb
|
|
574
607
|
- lib/expressir/express/streaming_builder.rb
|
|
575
608
|
- lib/expressir/express/xsd.rb
|
|
609
|
+
- lib/expressir/interop.rb
|
|
610
|
+
- lib/expressir/interop/json_schema.rb
|
|
611
|
+
- lib/expressir/interop/owl.rb
|
|
576
612
|
- lib/expressir/liquid.rb
|
|
613
|
+
- lib/expressir/lsp.rb
|
|
614
|
+
- lib/expressir/lsp/document.rb
|
|
615
|
+
- lib/expressir/lsp/server.rb
|
|
616
|
+
- lib/expressir/lsp/workspace.rb
|
|
577
617
|
- lib/expressir/manifest.rb
|
|
578
618
|
- lib/expressir/manifest/resolver.rb
|
|
579
619
|
- lib/expressir/manifest/validator.rb
|
|
@@ -685,9 +725,15 @@ files:
|
|
|
685
725
|
- lib/expressir/package/builder.rb
|
|
686
726
|
- lib/expressir/package/metadata.rb
|
|
687
727
|
- lib/expressir/package/reader.rb
|
|
728
|
+
- lib/expressir/reference.rb
|
|
729
|
+
- lib/expressir/reference/grammar_crosswalk.rb
|
|
730
|
+
- lib/expressir/reference/grammar_crosswalk.yml
|
|
731
|
+
- lib/expressir/reference/note_catalog.rb
|
|
688
732
|
- lib/expressir/schema_manifest.rb
|
|
689
733
|
- lib/expressir/schema_manifest_entry.rb
|
|
690
734
|
- lib/expressir/version.rb
|
|
735
|
+
- lib/tasks/conformance.rake
|
|
736
|
+
- lib/tasks/reference.rake
|
|
691
737
|
- lib/tasks/verify_remarks.rake
|
|
692
738
|
- rakelib/native.rake
|
|
693
739
|
- rakelib/oracle.rake
|