expressir 2.4.42-aarch64-linux → 2.4.44-aarch64-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: 7a47d0c804171e6fe5af58b9ff3119e11badd614be85838721fe696728128a90
4
- data.tar.gz: 4c4bc588071c2cf4958275de7577fcaa0ee1246ba7362cc749e1883682acfae4
3
+ metadata.gz: b2e8ce607e5fa2946b49afb8d07b609511f4770626f0514171af4dbd4d040dd0
4
+ data.tar.gz: 976e6be43a837062cfcbcf578efa60a632453aab7fe18c7b5947ad9c873a6ed3
5
5
  SHA512:
6
- metadata.gz: 784d1aa3fd0b41141399013a74362cae3e8f70ba05e4044be32e75e341a3c3241acda9995c4a5d410b326ea085cf2242f810d74db92ee61db544de68889815fd
7
- data.tar.gz: 732e4adb23e65814463f468bc0a22549986b9cc695955b4a5f672e74c07e7ad5c876d68d41944d0bde2e3ae80342e24e07bbf32e844028d868e2875b73c56cf0
6
+ metadata.gz: 7e09b4de4e9a12fd5d2630dbd89bb94bbef08cf1cd2435f4a285f211d66622e64cef8591bc637ed9b8432408235ee787776ac58f32a6afd7a567152d6b66a8af
7
+ data.tar.gz: b2bb917e9717771de8a3259b2a7dc5b830f9d34708bdb4d1608fc5982e46f28119f1b71bca0ceb9e833457a5c2e69cb2a77bc46841bdb398926cab97384f9934
Binary file
Binary file
Binary file
Binary file
@@ -54,9 +54,16 @@ module Expressir
54
54
  private
55
55
 
56
56
  def build_parameters(head)
57
- return [] unless head && head[:list_of_formal_parameter]
57
+ # nil = no parameter parentheses in the source; [] = explicit
58
+ # `f()` (the list is optional within the parens, syntax 253)
59
+ group = head && head[:function_head_parameter_group]
60
+ # the parslet-compatible transform carries a failed .maybe as []
61
+ return nil if group.nil? || (group.respond_to?(:empty?) && group.empty?)
58
62
 
59
- params_data = head[:list_of_formal_parameter]
63
+ params_data = group[:list_of_formal_parameter]
64
+ return [] unless params_data
65
+
66
+ params_data = head[:list_of_formal_parameter] if params_data.nil?
60
67
  if params_data.is_a?(Hash) && params_data[:formal_parameter]
61
68
  params_data = [params_data[:formal_parameter]]
62
69
  elsif params_data.is_a?(Array)
@@ -52,9 +52,16 @@ module Expressir
52
52
  private
53
53
 
54
54
  def build_parameters(head)
55
- return [] unless head && head[:list_of_procedure_head_parameter]
55
+ # nil = no parameter parentheses in the source; [] = explicit
56
+ # `p()` (the list is optional within the parens, syntax 316)
57
+ group = head && head[:function_head_parameter_group]
58
+ # the parslet-compatible transform carries a failed .maybe as []
59
+ return nil if group.nil? || (group.respond_to?(:empty?) && group.empty?)
56
60
 
57
- params_data = head[:list_of_procedure_head_parameter]
61
+ params_data = group[:list_of_procedure_head_parameter]
62
+ return [] unless params_data
63
+
64
+ params_data = head[:list_of_procedure_head_parameter] if params_data.nil?
58
65
  if params_data.is_a?(Hash)
59
66
  param_values = params_data[:procedure_head_parameter]
60
67
  params_data = param_values.is_a?(Array) ? param_values : [param_values]
@@ -245,7 +245,9 @@ module Expressir
245
245
  "FUNCTION",
246
246
  " ",
247
247
  node.id,
248
- *if node.parameters&.length&.positive?
248
+ # nil parameters = the source had no parentheses;
249
+ # [] = an explicit `f()` — the parens are written back
250
+ *if node.parameters
249
251
  parameter_indent = indent_char * "FUNCTION #{node.id}(".length
250
252
  [
251
253
  "(",
@@ -371,7 +373,9 @@ module Expressir
371
373
  "PROCEDURE",
372
374
  " ",
373
375
  node.id,
374
- *if node.parameters&.length&.positive?
376
+ # see format_declarations_function: nil = no parens,
377
+ # [] = explicit `p()`
378
+ *if node.parameters
375
379
  parameter_indent = indent_char * "PROCEDURE #{node.id}(".length
376
380
  [
377
381
  "(",
@@ -360,7 +360,9 @@ module Expressir
360
360
  end
361
361
  rule(:functionHead) do
362
362
  (tFUNCTION >> functionId >>
363
- (op_leftparen >> (formalParameter >> (op_delim >> formalParameter).repeat).as(:listOf_formalParameter) >> op_rightparen).maybe >>
363
+ # syntax 253: the parameter list is optional within the
364
+ # parentheses, so FUNCTION f() is legal (#558)
365
+ (op_leftparen >> (formalParameter >> (op_delim >> formalParameter).repeat).as(:listOf_formalParameter).maybe >> op_rightparen).maybe.as(:function_head_parameter_group) >>
364
366
  op_colon >> parameterType >> op_delim.as(:op_delim2)).as(:functionHead)
365
367
  end
366
368
  rule(:functionId) { simpleId.as(:functionId) }
@@ -527,8 +529,10 @@ module Expressir
527
529
  end
528
530
  rule(:procedureHead) do
529
531
  (tPROCEDURE >> procedureId >>
532
+ # syntax 316: the parameter list is optional within the
533
+ # parentheses, so PROCEDURE p() is legal (#558)
530
534
  (op_leftparen >> (procedureHeadParameter >>
531
- (op_delim >> procedureHeadParameter).repeat).as(:listOf_procedureHeadParameter) >> op_rightparen).maybe >> op_delim.as(:op_delim2)).as(:procedureHead)
535
+ (op_delim >> procedureHeadParameter).repeat).as(:listOf_procedureHeadParameter).maybe >> op_rightparen).maybe.as(:function_head_parameter_group) >> op_delim.as(:op_delim2)).as(:procedureHead)
532
536
  end
533
537
  rule(:procedureId) { simpleId.as(:procedureId) }
534
538
  rule(:procedureRef) { procedureId.as(:procedureRef) }
@@ -889,6 +889,20 @@ module Expressir
889
889
  end
890
890
  end
891
891
 
892
+ # A prefixed intermediate segment (wr:WR1.ip:IP2.__note) splits
893
+ # wrong under the generic prefix-normalized walk below, so the
894
+ # segment-aware resolution handles that class: resolve the
895
+ # longest owned prefix (honoring the wr:/ip:/ur: prefixes
896
+ # find() strips) and attach the first unresolved segment as the
897
+ # remark item id on that node — `<rule>.wr:WR1.__note` lands a
898
+ # `__note` item on WR1 (#562), not a `wr` item on the rule.
899
+ segments = path.split(".")
900
+ if segments.length > 2 &&
901
+ segments[0..-2].any? { |segment| segment.include?(":") } && (owned = resolve_longest_owned_prefix(model, path, schema_ids))
902
+ parent, item_id = owned
903
+ return create_item_at_parent(parent, item_id)
904
+ end
905
+
892
906
  clean_path = normalize_path(path)
893
907
  parts = clean_path.split(".")
894
908
  return nil if parts.length < 2
@@ -921,6 +935,41 @@ module Expressir
921
935
  "#{path_part}.#{item_suffix}"
922
936
  end
923
937
 
938
+ # Walks the tag's segments from a schema root, honoring the
939
+ # prefix forms find() strips (wr:WR1, ip:IP1, ur:UR1), and
940
+ # returns [node, first_unresolved_segment] for the deepest node
941
+ # the model owns. Nil when nothing resolves.
942
+ def resolve_longest_owned_prefix(model, path, schema_ids)
943
+ candidate_paths = [path]
944
+ schema_ids.each do |schema_id|
945
+ candidate_paths << "#{schema_id}.#{path}"
946
+ end
947
+
948
+ candidate_paths.each do |candidate|
949
+ segments = candidate.split(".")
950
+ next if segments.empty?
951
+
952
+ owned_path = segments.first
953
+ node = safe_find(model, owned_path)
954
+ next unless node
955
+
956
+ segments[1..].each_with_index do |segment, index|
957
+ stepped = safe_find(model, "#{owned_path}.#{segment}")
958
+ # a lazily created remark item is never a path owner
959
+ stepped = nil if stepped.is_a?(Model::Declarations::RemarkItem)
960
+ if stepped.nil?
961
+ return [node, segment] if index.positive?
962
+
963
+ break
964
+ end
965
+ owned_path = "#{owned_path}.#{segment}"
966
+ node = stepped
967
+ end
968
+ end
969
+
970
+ nil
971
+ end
972
+
924
973
  def create_item_at_parent(parent, item_id)
925
974
  # Strip "wr:" prefix convention (e.g. "wr:IP1" → "IP1")
926
975
  ip_id = extract_ip_id(item_id)
@@ -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.42".freeze
6
+ VERSION = "2.4.44".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.42
4
+ version: 2.4.44
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-25 00:00:00.000000000 Z
11
+ date: 2026-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64