expressir 2.4.59 → 2.4.60

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4181000c9add84fc12e08bc6fcccc032bc78af565a8e4afb5ab609857b2b381
4
- data.tar.gz: 5b419669ff9e9be7e71d93a504a685816de23b0f2bbe91ad0ae5830a67993998
3
+ metadata.gz: 29c83e3e9d01ee3db87a008179c399d402e75dd3418ad6ec39467c1dd1d30529
4
+ data.tar.gz: 34ef441b6d1608fdb5c7beff7fe1b15680bddfa4c2f7814bfb246ab9355b11b5
5
5
  SHA512:
6
- metadata.gz: ec220509bebb58b9c1c8463ac4f0dfd82a61cbbbfa5b7e71d9e413c36b0a90ac9d68e72b52ff9fa6d147080155c38321bfc7bdba69febf2b2e7bc63dff2628c0
7
- data.tar.gz: 23bb737bbd86b68961d2d5533683882d5266c08144b1e61f53b0cdaa27110ec5b4e0d28e601bb47a8e500750f5e049e7522c254abd715f0190ec2cfe0f567f9d
6
+ metadata.gz: 4fa3d5c730186049dece681e6b0cc40cc279257c33c4c99edecd7a9c48aefed63f03b21208046a21476057b73bccdcc786ac92bc09a7ab60fd71063f7cc69676
7
+ data.tar.gz: 2bd518b3d9ecd22ddaa9c55b27e52a825d7ec076e16f72bc171b907cd9560b69b09aba7e1172b7f69b8d5447025bae275a99375c4e41947f2b48ca9bd10ea68e
@@ -13,7 +13,7 @@ magnus = { version = "0.9" }
13
13
  # Pinned core release (M1, TODO.parity-ee/19): the ext never floats
14
14
  # main — bump the tag per expressir release, alongside the validation
15
15
  # run that pins it.
16
- expressir-rs = { git = "https://github.com/lutaml/expressir-rs", tag = "v0.1.28" }
16
+ expressir-rs = { git = "https://github.com/lutaml/expressir-rs", tag = "v0.1.30" }
17
17
  serde_json = "1.0"
18
18
 
19
19
 
@@ -10,27 +10,36 @@ module Expressir
10
10
  def format_remark_item(node)
11
11
  return "" unless node.remarks&.any?
12
12
 
13
- # Check if any remark contains newlines
14
- has_newlines = node.remarks.any? { |r| r.to_s.include?("\n") }
15
- remarks_text = node.remarks.join("\n")
16
-
17
- # The tag is the schema-relative EXPRESS path: node.path is
18
- # rooted at the ExpFile, whose id is the file path — drop that
19
- # leading segment so the tag reads like the source form
13
+ # The tag form follows the owner: items in rule contexts
14
+ # (WHERE/UNIQUE/IP) historically carry bare tags
15
+ # (`--"unusual_placement" text`), WG12-style items carry the
16
+ # schema-relative path. node.path is rooted at the ExpFile,
17
+ # whose id is the file path — drop that leading segment
20
18
  # (expressir#603).
21
- tag = node.path.to_s
22
- root = node
23
- root = root.parent while root.respond_to?(:parent) && root.parent
24
- prefix = "#{root.id}." if root.respond_to?(:id) && root.id
25
- tag = tag.delete_prefix(prefix) if prefix && tag.start_with?(prefix)
26
-
27
- if has_newlines || node.remarks.length > 1
28
- # Multi-line format: (*"path" remarks *)
29
- "(*\"#{tag}\"\n#{remarks_text}\n*)"
19
+ rule_context = node.parent.is_a?(Model::Declarations::WhereRule) ||
20
+ node.parent.is_a?(Model::Declarations::UniqueRule) ||
21
+ node.parent.is_a?(Model::Declarations::InformalPropositionRule)
22
+ if rule_context
23
+ tag = node.id.to_s
30
24
  else
31
- # Single-line format: --"path" text
32
- "--\"#{tag}\" #{remarks_text}"
25
+ tag = node.path.to_s
26
+ root = node
27
+ root = root.parent while root.respond_to?(:parent) && root.parent
28
+ prefix = "#{root.id}." if root.respond_to?(:id) && root.id
29
+ tag = tag.delete_prefix(prefix) if prefix && tag.start_with?(prefix)
33
30
  end
31
+
32
+ # One line per remark. Single-line remarks take the tail form
33
+ # (the dominant inline convention); multi-line text takes the
34
+ # block form, which a tail line cannot express.
35
+ node.remarks.map do |remark|
36
+ remark = remark.to_s
37
+ if remark.include?("\n")
38
+ "(*\"#{tag}\"\n#{remark}\n*)"
39
+ else
40
+ "--\"#{tag}\" #{remark}"
41
+ end
42
+ end.join("\n")
34
43
  end
35
44
  end
36
45
  end
@@ -3,6 +3,6 @@ module Expressir
3
3
  # autoload it (Ruby autoload only works for module/class constants, not
4
4
  # for string constants like `Expressir::VERSION`).
5
5
  module Version
6
- VERSION = "2.4.59".freeze
6
+ VERSION = "2.4.60".freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressir
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.59
4
+ version: 2.4.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.