expressir 2.4.58-x86_64-linux → 2.4.60-x86_64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 997dddf2dc1e16722211a674f1938a016a13010f82e498c0a11540b4ca9f6415
4
- data.tar.gz: c9bd5fca92156cda3a56dd69b76c6f5baa14296509de4a9370d3f94b1e9d2b33
3
+ metadata.gz: c1842449a26993ce58d415dbc1f525ef65a2f04baabf723be60fba33fa5e4b0c
4
+ data.tar.gz: d452b99ecb213b20a364f1317e97af8ed3061ebbace7a324cd19db95746e5c88
5
5
  SHA512:
6
- metadata.gz: ee5f9a08de7a4256d5186017d90a6d754df9bc2b0904261795612618e7184ae20e2f34f757ac950fd68239357210a5671ad9f817ebecda71df743cefb440881c
7
- data.tar.gz: afa68a6aec202183f3166a27f0011329276a68cce98891a90c75e32d6ef43538819af50ecc35a6e9dacf9ef4eb52df03d27807ae0d16ab4824c32ea37f1496dc
6
+ metadata.gz: 2ac5a8573061ba2e6c9383ed7ff5a1a1711fce4488da5ac5c4fdaf7d6f5bf9e005fd16c44328a86a7ead4981faaca241552bcfa8f8b295932785f5c8e6a03f18
7
+ data.tar.gz: 8ec14a01674464bacff9e7cc9cc3241d89044ac7842ba50e5843ba0756167e28b562eb0f09715b0b7ab2cdc0deb473543edf598c666edafc0868749c95c2e41f
Binary file
Binary file
Binary file
Binary file
@@ -182,7 +182,12 @@ module Expressir
182
182
  end
183
183
 
184
184
  def format_data_types_enumeration_item(node)
185
- node.id
185
+ return node.id unless node.respond_to?(:remark_items) && Array(node.remark_items).any?
186
+
187
+ [
188
+ node.id,
189
+ *Array(node.remark_items).map { |item| ["\n", format(item)].join },
190
+ ].join
186
191
  end
187
192
 
188
193
  def format_data_types_generic_entity(node)
@@ -91,6 +91,7 @@ module Expressir
91
91
  end,
92
92
  ";",
93
93
  format_inline_tail_remark(node),
94
+ *format_remark_items(node).map { |x| ["\n", x].join },
94
95
  ].join
95
96
  end
96
97
 
@@ -106,6 +107,7 @@ module Expressir
106
107
  " ",
107
108
  format(node.expression),
108
109
  ";",
110
+ *format_remark_items(node).map { |x| ["\n", x].join },
109
111
  ].join
110
112
  end
111
113
 
@@ -218,6 +220,7 @@ module Expressir
218
220
  indent(node.where_rules.map { |x| format(x) }.join("\n")),
219
221
  ]
220
222
  end,
223
+ *format_remark_items(node).map { |x| indent(x) },
221
224
  [
222
225
  "END_ENTITY",
223
226
  ";",
@@ -302,6 +305,7 @@ module Expressir
302
305
  indent(node.statements.map { |x| format(x) }.join("\n"))
303
306
  end,
304
307
  *format_trailing_region_remarks(node, :statements).map { |x| indent(x) },
308
+ *format_remark_items(node).map { |x| indent(x) },
305
309
  [
306
310
  "END_FUNCTION",
307
311
  ";",
@@ -347,6 +351,7 @@ module Expressir
347
351
  node.id,
348
352
  ]
349
353
  end,
354
+ *format_remark_items(node).map { |x| ["\n", x].join },
350
355
  ].join
351
356
  end
352
357
 
@@ -363,6 +368,7 @@ module Expressir
363
368
  ":",
364
369
  " ",
365
370
  format(node.type),
371
+ *format_remark_items(node).map { |x| ["\n", x].join },
366
372
  ].join
367
373
  end
368
374
 
@@ -426,6 +432,7 @@ module Expressir
426
432
  indent(node.statements.map { |x| format(x) }.join("\n"))
427
433
  end,
428
434
  *format_trailing_region_remarks(node, :statements).map { |x| indent(x) },
435
+ *format_remark_items(node).map { |x| indent(x) },
429
436
  [
430
437
  "END_PROCEDURE",
431
438
  ";",
@@ -529,6 +536,7 @@ module Expressir
529
536
  end,
530
537
  # A comment after the last where rule closes the WHERE section.
531
538
  *format_trailing_region_remarks(node, :where_rules).map { |x| indent(x) },
539
+ *format_remark_items(node).map { |x| indent(x) },
532
540
  [
533
541
  "END_RULE",
534
542
  ";",
@@ -611,6 +619,7 @@ module Expressir
611
619
  "",
612
620
  ]
613
621
  end,
622
+ *format_remark_items(node),
614
623
  [
615
624
  "END_SCHEMA",
616
625
  ";",
@@ -667,6 +676,7 @@ module Expressir
667
676
  ";",
668
677
  ].join)
669
678
  end,
679
+ *format_remark_items(node).map { |x| indent(x) },
670
680
  [
671
681
  "END_SUBTYPE_CONSTRAINT",
672
682
  ";",
@@ -693,6 +703,7 @@ module Expressir
693
703
  indent(node.where_rules.map { |x| format(x) }.join("\n")),
694
704
  ]
695
705
  end,
706
+ *format_remark_items(node).map { |x| indent(x) },
696
707
  [
697
708
  "END_TYPE",
698
709
  ";",
@@ -712,6 +723,7 @@ module Expressir
712
723
  end,
713
724
  Array(node.attributes).map { |x| format(x) }.join(", "),
714
725
  ";",
726
+ *format_remark_items(node).map { |x| ["\n", x].join },
715
727
  ].join
716
728
  end
717
729
 
@@ -745,6 +757,7 @@ module Expressir
745
757
  end,
746
758
  format(node.expression),
747
759
  ";",
760
+ *format_remark_items(node).map { |x| ["\n", x].join },
748
761
  ].join
749
762
  end
750
763
 
@@ -757,6 +770,7 @@ module Expressir
757
770
  " ",
758
771
  ].join
759
772
  end,
773
+ *format_remark_items(node).map { |x| ["\n", x].join },
760
774
  ].join
761
775
  end
762
776
  end
@@ -289,6 +289,15 @@ module Expressir
289
289
 
290
290
  remarks
291
291
  end
292
+
293
+ # The tagged remark-item blocks attached to this node
294
+ # (expressir#603: RemarkItem children render with their owners).
295
+ def format_remark_items(node)
296
+ return [] if @no_remarks
297
+ return [] unless node.respond_to?(:remark_items)
298
+
299
+ Array(node.remark_items).map { |item| format(item) }.reject(&:empty?)
300
+ end
292
301
  end
293
302
  end
294
303
  end
@@ -10,17 +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
-
16
- if has_newlines
17
- # Multi-line format: (*"path" remarks *)
18
- remarks_text = node.remarks.join("\n")
19
- "(*\"#{node.path}\"\n#{remarks_text}\n*)"
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
18
+ # (expressir#603).
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
20
24
  else
21
- # Single-line format: --"path"
22
- "--\"#{node.path}\""
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)
23
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")
24
43
  end
25
44
  end
26
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.58".freeze
6
+ VERSION = "2.4.60".freeze
7
7
  end
8
8
  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.58
4
+ version: 2.4.60
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-07 00:00:00.000000000 Z
11
+ date: 2026-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64