expressir 2.4.60-x86_64-linux → 2.4.62-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: c1842449a26993ce58d415dbc1f525ef65a2f04baabf723be60fba33fa5e4b0c
4
- data.tar.gz: d452b99ecb213b20a364f1317e97af8ed3061ebbace7a324cd19db95746e5c88
3
+ metadata.gz: 830afa636974a52efbae5fc4466c5f5352d922b6fcfe23abf652a9b47a2634a2
4
+ data.tar.gz: 89b3284e73f98d92a565b25f9530d047587f1cad4ac25f58cf60047d31b62199
5
5
  SHA512:
6
- metadata.gz: 2ac5a8573061ba2e6c9383ed7ff5a1a1711fce4488da5ac5c4fdaf7d6f5bf9e005fd16c44328a86a7ead4981faaca241552bcfa8f8b295932785f5c8e6a03f18
7
- data.tar.gz: 8ec14a01674464bacff9e7cc9cc3241d89044ac7842ba50e5843ba0756167e28b562eb0f09715b0b7ab2cdc0deb473543edf598c666edafc0868749c95c2e41f
6
+ metadata.gz: 17368dc0a11d176a80b4bc03a7ee4f43f44d42e42494786f591ec3752134e275a62eebcad6f274e632f4d0e2051a2fd59ef062ba37068ce133a2dc386c4b09d6
7
+ data.tar.gz: 632612a1d0abcae9d0f255a08903e44446991dbdc25c603c46af3f7ec97fcec7857742bc562860048362c51c1a0a7409b56f436cd6281c4ec15fa4c8af9801b6
Binary file
Binary file
Binary file
Binary file
@@ -619,7 +619,10 @@ module Expressir
619
619
  "",
620
620
  ]
621
621
  end,
622
- *format_remark_items(node),
622
+ # A blank line before each remark-item child, mirroring the
623
+ # core-lane schema emitter — the two lanes must render
624
+ # remark.exp byte-identically for the formatter golden.
625
+ *format_remark_items(node).flat_map { |x| ["", x] },
623
626
  [
624
627
  "END_SCHEMA",
625
628
  ";",
@@ -29,15 +29,22 @@ module Expressir
29
29
  tag = tag.delete_prefix(prefix) if prefix && tag.start_with?(prefix)
30
30
  end
31
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.
32
+ # Remark items are WG12 annotation blocks: the embedded form,
33
+ # a block per remark, matching the source convention of the
34
+ # annotated corpora (the conservation pairs are embedded, so
35
+ # tail-form emission reads as phantom gains). Rule-context
36
+ # owners keep the historic bare-tag tail form.
37
+ if rule_context
38
+ return node.remarks
39
+ .map { |remark| "--\"#{tag}\" #{remark}" }
40
+ .join("\n")
41
+ end
35
42
  node.remarks.map do |remark|
36
43
  remark = remark.to_s
37
44
  if remark.include?("\n")
38
45
  "(*\"#{tag}\"\n#{remark}\n*)"
39
46
  else
40
- "--\"#{tag}\" #{remark}"
47
+ "(*\"#{tag}\" #{remark} *)"
41
48
  end
42
49
  end.join("\n")
43
50
  end
@@ -69,12 +69,6 @@ module Expressir
69
69
  entries.sort_by { |n| node_order(n) }
70
70
  end
71
71
 
72
- # First node (in node order) that is_a?(type), memoized per type.
73
- def first_node_of_type(type)
74
- @first_of_type ||= {}
75
- @first_of_type[type] ||= @nodes.find { |n| n[:node].is_a?(type) }&.dig(:node)
76
- end
77
-
78
72
  def semantic_entries
79
73
  @semantic_entries ||=
80
74
  @nodes.select { |n| n[:line] && semantic?(n[:node]) }
@@ -200,7 +194,19 @@ module Expressir
200
194
  end
201
195
 
202
196
  candidates.min_by { |n| node_order(n) }&.dig(:node) ||
203
- first_node_of_type(node_type)
197
+ containing_node_of_type(node_type, remark_line)
198
+ end
199
+
200
+ # A comment on an END_XXX line whose scope's recorded end sits past
201
+ # the line — remark items live between declarations, and their spans
202
+ # push the owner's end_line beyond END_XXX — resolves by span
203
+ # containment. Falls back to nil, not the first node of the type:
204
+ # handing an unresolvable END_FUNCTION comment to the first function
205
+ # piled every stray tail onto one owner (#609).
206
+ def containing_node_of_type(type, line)
207
+ semantic_entries
208
+ .select { |n| n[:node].is_a?(type) && n[:end_line] && line.between?(n[:line], n[:end_line]) }
209
+ .min_by { |n| node_order(n) }&.dig(:node)
204
210
  end
205
211
 
206
212
  private
@@ -163,7 +163,13 @@ module Expressir
163
163
 
164
164
  # Strategy 3: Create implicit item for qualified paths only
165
165
  if target.nil? && tag.include?(".")
166
- if containing_scope && function_rule_procedure?(containing_scope)
166
+ # A tag whose first segment is a schema id is already
167
+ # absolute: prepending the containing scope's path would
168
+ # double-count it, and the implicit walk would then name
169
+ # the item after the schema (#609 — `(*"s.f.lv"` inside f
170
+ # must create `lv`, not `s`).
171
+ absolute_tag = get_schema_ids(@model).include?(tag.split(".").first)
172
+ if containing_scope && function_rule_procedure?(containing_scope) && !absolute_tag
167
173
  scope_path = build_scope_path(containing_scope)
168
174
  if scope_path
169
175
  target = create_implicit_remark_item(@model, "#{scope_path}.#{tag}",
@@ -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.60".freeze
6
+ VERSION = "2.4.62".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.60
4
+ version: 2.4.62
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Ribose Inc.