expressir 2.4.30 → 2.4.32
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/scripts/test_installed_gem.rb +18 -4
- data/TODO.parity-ee/00-overview.md +1 -1
- data/TODO.suma-improvements/07-part28-xml.md +10 -13
- data/lib/expressir/cli.rb +7 -0
- data/lib/expressir/commands/parity_inputs.rb +6 -1
- data/lib/expressir/commands/smrl_xml_index.rb +25 -0
- data/lib/expressir/commands.rb +1 -0
- data/lib/expressir/express/core.rb +1 -7
- data/lib/expressir/express/grammar/parser.rb +7 -10
- data/lib/expressir/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c99980cc78fb445ea5c87f6b550c136c348e4b760b9fdabad8caf4a60a29884
|
|
4
|
+
data.tar.gz: 7effdd8da82e7a788dfedadfd54e13013febc24e90103542c1579052405e6e8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba219b7e2d9e4b740776308e31f3c14bdc0283c62e6400b83427b7f338a74acef3f5f8afad9ca1e57968204dc1d3e6c352c2f37bf5c7ea540daed395ceab783c
|
|
7
|
+
data.tar.gz: d9c2d5ad92afd32f7b38013e5f7c16795370c3d682e13fe60e4ee577602497e474b89dd3e475bed88f74a9f169053a51ac35bd66748909fa729400fdd78db346
|
|
@@ -5,8 +5,19 @@
|
|
|
5
5
|
# active and the parser must handle the standard and #462 forms.
|
|
6
6
|
require "expressir"
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
if Gem.win_platform? && !Expressir::Express::Core::NATIVE_AVAILABLE
|
|
9
|
+
# Interim expressir#487 guard: native is intentionally disabled on
|
|
10
|
+
# windows until the ancestor-walk fix (#499) merges and the guard
|
|
11
|
+
# reverts. The platform gem must still SHIP a loadable extension -
|
|
12
|
+
# that is this leg's contract while the guard stands.
|
|
13
|
+
gem_dir = Gem.loaded_specs["expressir"].gem_dir
|
|
14
|
+
shipped = Dir.glob(File.join(gem_dir, "**", "expressir_core.{so,dll}"))
|
|
15
|
+
abort "FAIL: expressir_core not shipped in the platform gem" if shipped.empty?
|
|
16
|
+
puts "native binding: deferred (windows guard, expressir#487)"
|
|
17
|
+
else
|
|
18
|
+
abort "FAIL: NATIVE_AVAILABLE is false" unless Expressir::Express::Core::NATIVE_AVAILABLE
|
|
19
|
+
puts "native binding: active"
|
|
20
|
+
end
|
|
10
21
|
|
|
11
22
|
repo = Expressir::Express::Parser.from_exp(
|
|
12
23
|
"SCHEMA smoke; ENTITY e; a : STRING; END_ENTITY; END_SCHEMA;",
|
|
@@ -28,7 +39,10 @@ puts "#462 form: ok"
|
|
|
28
39
|
|
|
29
40
|
# The platform gems force-build the Rust compiled-set writer; a leg that
|
|
30
41
|
# shipped a non-loadable expressir_core would otherwise pass this smoke.
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
# Windows under the #487 guard runs the pure-Ruby fallback instead.
|
|
43
|
+
unless Gem.win_platform? && !Expressir::Express::Core::NATIVE_AVAILABLE
|
|
44
|
+
abort "FAIL: core_set_available is false" unless Expressir::Express::Parser.core_set_available?
|
|
45
|
+
puts "compiled-set core: ok"
|
|
46
|
+
end
|
|
33
47
|
|
|
34
48
|
puts "SMOKE OK"
|
|
@@ -64,7 +64,7 @@ interface/qualify notes; `00check.txt` — check design notes.
|
|
|
64
64
|
| 12 | full check-p11 catalog port | planned |
|
|
65
65
|
| 13 | population / Part 21 validation | planned |
|
|
66
66
|
| 14 | SHTOLO completion (Annex G + corpus differential) | in progress |
|
|
67
|
-
| 15 | Part 28 XML + SMRL index |
|
|
67
|
+
| 15 | Part 28 XML + SMRL index | done (SMRL index + express2xsd shipped, #276; reference-XSD diff harness escalated to 17) |
|
|
68
68
|
| 16 | schema compare & patch | planned |
|
|
69
69
|
| 17 | official test-case incorporation | standing structure |
|
|
70
70
|
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
# 07 — Part 28 XML: select mapping v2 (#276)
|
|
1
|
+
# 07 — Part 28 XML: select mapping v2 (#276) — DONE
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Shipped: the ISO 10303-28 SELECT mapping lives in
|
|
4
|
+
lib/expressir/express/xsd.rb (complexType + xs:choice, entity members
|
|
5
|
+
as global-element refs, defined-type members by name+type, extensible-
|
|
6
|
+
empty fallback to sequence) and is covered by spec/expressir/express/
|
|
7
|
+
xsd_spec.rb. The CLI exposes both halves: `expressir xsd` and
|
|
8
|
+
`expressir xml-index` (#503).
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- validate generated XSDs against the ISO 10303-28 conformance examples
|
|
12
|
-
|
|
13
|
-
## Acceptance
|
|
14
|
-
- a select-typed attribute renders per the standard (not xs:anyType)
|
|
15
|
-
- the v1 examples still generate unchanged except where v2 improves them
|
|
10
|
+
Remaining escalation (moved to parity-ee 17 scope): validating the
|
|
11
|
+
generated XSDs against the Part 28 reference corpus — the detached
|
|
12
|
+
docs carry the standard text only, not the reference XSDs.
|
data/lib/expressir/cli.rb
CHANGED
|
@@ -111,6 +111,13 @@ module Expressir
|
|
|
111
111
|
Expressir::Commands::Xsd.new(options).run(path)
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
+
desc "xml-index DIR", "Write the SMRL index XML for every EXPRESS schema under DIR"
|
|
115
|
+
method_option :output, type: :string, aliases: "-o",
|
|
116
|
+
desc: "Output file path (defaults to stdout)"
|
|
117
|
+
def xml_index(path)
|
|
118
|
+
Expressir::Commands::SmrlXmlIndex.new(options).run(path)
|
|
119
|
+
end
|
|
120
|
+
|
|
114
121
|
desc "validate SUBCOMMAND", "EXPRESS schema validation commands"
|
|
115
122
|
subcommand "validate", Expressir::Commands::Validate
|
|
116
123
|
|
|
@@ -113,7 +113,12 @@ module Expressir
|
|
|
113
113
|
# Nearest ancestor directory NAMED `schemas`, or nil.
|
|
114
114
|
def ancestor_schemas_dir(root_path)
|
|
115
115
|
dir = File.dirname(File.expand_path(root_path))
|
|
116
|
-
|
|
116
|
+
# dirname reaches a fixed point at the filesystem root: "/" on
|
|
117
|
+
# POSIX, "D:/" (or a UNC root) on windows. Comparing against "/"
|
|
118
|
+
# alone spun forever on windows - every rake run since this
|
|
119
|
+
# shipped (e0f6651, 2026-09-24) burned the full 6h runner
|
|
120
|
+
# budget in the first expand example (#487).
|
|
121
|
+
until dir == "/" || dir == File.dirname(dir)
|
|
117
122
|
return dir if File.basename(dir) == "schemas"
|
|
118
123
|
|
|
119
124
|
dir = File.dirname(dir)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "thor"
|
|
4
|
+
|
|
5
|
+
module Expressir
|
|
6
|
+
module Commands
|
|
7
|
+
# `expressir xml-index` (#276): write the SMRL index XML for a
|
|
8
|
+
# repository — one <schema> element per schema, the data layer of
|
|
9
|
+
# the STEP Module Resource Library document set.
|
|
10
|
+
class SmrlXmlIndex < Base
|
|
11
|
+
def run(path)
|
|
12
|
+
repo = Expressir::Express::Parser.from_files(Dir.glob(File.join(path, "**", "*.exp")), skip_references: true)
|
|
13
|
+
raise Thor::Error, "no schemas under #{path}" if repo.schemas.empty?
|
|
14
|
+
|
|
15
|
+
xml = Expressir::Express::SmrlXml.format(repo)
|
|
16
|
+
if options[:output]
|
|
17
|
+
File.write(options[:output], xml)
|
|
18
|
+
say "written to #{options[:output]}"
|
|
19
|
+
else
|
|
20
|
+
$stdout.write(xml)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
data/lib/expressir/commands.rb
CHANGED
|
@@ -8,14 +8,8 @@ module Expressir
|
|
|
8
8
|
# extraction). Available when the native extension is built;
|
|
9
9
|
# callers fall back to the pure-Ruby parser otherwise.
|
|
10
10
|
#
|
|
11
|
-
# Windows is excluded along with parsanol's native engine
|
|
12
|
-
# (Grammar::Parser.native_available?): the core embeds the
|
|
13
|
-
# parsanol-rs parse stack, whose x64-mingw build deadlocks the
|
|
14
|
-
# same way at first parse (expressir#487) - the compiled
|
|
15
|
-
# extension is present, so the gate is explicit rather than a
|
|
16
|
-
# LoadError consequence.
|
|
17
11
|
module Core
|
|
18
|
-
NATIVE_AVAILABLE =
|
|
12
|
+
NATIVE_AVAILABLE = begin
|
|
19
13
|
require "expressir/expressir_core"
|
|
20
14
|
true
|
|
21
15
|
rescue LoadError
|
|
@@ -41,7 +41,13 @@ module Expressir
|
|
|
41
41
|
# ("RULE r FOR" parsed as one simpleId). simpleId additionally
|
|
42
42
|
# matches as a single quantified Re, which needs no exemption;
|
|
43
43
|
# the two mechanisms agree and stay for defense in depth.
|
|
44
|
-
|
|
44
|
+
# The whitespace/remark rules manage their own trivia end to end
|
|
45
|
+
# (they ARE the trivia surface for remarks); injection around
|
|
46
|
+
# them breaks consecutive remark lines on the Ruby engine
|
|
47
|
+
# ("-- X\n--\nSCHEMA ..." failed - the #487 windows follow-up,
|
|
48
|
+
# parsanol-ruby#195 family).
|
|
49
|
+
skip(:trivia, whitespace: :space,
|
|
50
|
+
exempt: %i[simpleId digits spaces space embeddedRemark tailRemark])
|
|
45
51
|
|
|
46
52
|
# Get cached parser instance (thread-safe)
|
|
47
53
|
# Reusing the parser avoids the overhead of reinitializing all rule definitions
|
|
@@ -62,15 +68,6 @@ module Expressir
|
|
|
62
68
|
|
|
63
69
|
# Check if native parsing is available
|
|
64
70
|
def self.native_available?
|
|
65
|
-
# parsanol 1.3.54+ x64-mingw builds deadlock inside the native
|
|
66
|
-
# parse at runtime: the library loads (early examples run) but
|
|
67
|
-
# the first parse never returns (expressir#487 — every windows
|
|
68
|
-
# rake run since 2026-09-29 hit the 6h limit; the control at
|
|
69
|
-
# green-era leptris/moxml/yeptris still hangs, parsanol 1.3.53
|
|
70
|
-
# was green). The pure-Ruby engine is correct, so windows falls
|
|
71
|
-
# back to it until parsanol fixes the mingw build.
|
|
72
|
-
return false if Gem.win_platform?
|
|
73
|
-
|
|
74
71
|
return @native_available unless @native_available.nil?
|
|
75
72
|
|
|
76
73
|
@native_available = begin
|
data/lib/expressir/version.rb
CHANGED
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.32
|
|
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-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|
|
@@ -460,6 +460,7 @@ files:
|
|
|
460
460
|
- lib/expressir/commands/non_ascii_violation_collection.rb
|
|
461
461
|
- lib/expressir/commands/package.rb
|
|
462
462
|
- lib/expressir/commands/parity_inputs.rb
|
|
463
|
+
- lib/expressir/commands/smrl_xml_index.rb
|
|
463
464
|
- lib/expressir/commands/validate.rb
|
|
464
465
|
- lib/expressir/commands/validate_ascii.rb
|
|
465
466
|
- lib/expressir/commands/validate_load.rb
|