expressir 2.4.67-arm-linux → 2.4.68-arm-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: 18a49a8ba3f40d261a99a77bf6f80a842ca29b1168c81bf0d9aa1ffca124222c
4
- data.tar.gz: a34a2cb3103d9c2f731fe81d02e1c62aca63451756cc6df0616fbd76ed2f23c8
3
+ metadata.gz: 0d6f34d2edad548cead4203943edcdb922d1707a18c6abc85c5515e4163339f3
4
+ data.tar.gz: b865c0894e145b332cd4f8c05b8ce54908853a4dcf703d006221ccf4059142d6
5
5
  SHA512:
6
- metadata.gz: 92f6b8dd4bf2eff9e4bd6372df31a418f1fee00dd03050d4372d104baa55f9cee793bf849d4a89081d19a82bdf64fee08cc029c9a7530b869d99412eadd277e1
7
- data.tar.gz: dc3a5184f6908a3de4a7fb5ad3aaf1e9753033baa3a24f599254e726fa53261c051cb4326b7e564ad79a22eb8e24cd16acc63d21731b0847e2ddbc03bab6cc47
6
+ metadata.gz: 5769c0702c3066c92da08a3f5b4ffec03198ec4e8a8e5dd079baa56c6c00fdd30c458539bf27e8248f8087c3aec1904acc7f82b185f4b1b88a80147820dc4995
7
+ data.tar.gz: 6a03e87064ca32f53350ef5d117b11d7418f332b78ca37ae88fb598fc742a0767ef6eadff8eb7fa39cc5cb9981e2d9b4bcfc2068522cc71e4416bdaab7ce3799
data/ENGINE-COMPAT.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
- "engine_commit": "7a3fb54319a47b96ec07b9324066f98099bb2f8a",
3
- "rubygems": "2.4.65",
4
- "ext": "v0.1.35",
2
+ "engine_commit": "0fb900f7f1",
3
+ "rubygems": "2.4.67",
4
+ "ext": "v0.1.37",
5
5
  "crates": null,
6
6
  "npm": null,
7
7
  "pypi": null,
8
- "released_at": "2026-11-11T02:02:03Z",
8
+ "released_at": "2026-11-12T08:30:00Z",
9
9
  "_comment": "expressir#618 — the engine-compat manifest, mirroring parsanol-rs#423. Maps the expressir gem train to the expressir-rs ext tag and its engine commit; the null fields fill as the crates/npm/pypi tiers land (expressir#619/#622/#621). tools/check_engine_compat.rb verifies the pairings in CI; every release train updates this file."
10
10
  }
Binary file
Binary file
Binary file
Binary file
@@ -35,6 +35,9 @@ module Expressir
35
35
  INDENT_CHAR = " ".freeze
36
36
  INDENT_WIDTH = 2
37
37
  INDENT = INDENT_CHAR * INDENT_WIDTH
38
+ # The relational tier is non-associative: its same-precedence
39
+ # children keep parentheses on both sides (expressir#651).
40
+ RELATIONAL_PRECEDENCE = 4
38
41
  OPERATOR_PRECEDENCE = {
39
42
  Model::Expressions::BinaryExpression::EXPONENTIATION => 1,
40
43
  Model::Expressions::BinaryExpression::MULTIPLICATION => 2,
@@ -39,10 +39,28 @@ module Expressir
39
39
 
40
40
  def format_expressions_binary_expression(node)
41
41
  operator_precedence = self.class.const_get(:OPERATOR_PRECEDENCE)
42
- op1_bin_exp = node.operand1.is_a?(Model::Expressions::BinaryExpression) &&
43
- (operator_precedence[node.operand1.operator] >= operator_precedence[node.operator])
44
- op2_bin_exp = node.operand2.is_a?(Model::Expressions::BinaryExpression) &&
45
- (operator_precedence[node.operand2.operator] >= operator_precedence[node.operator])
42
+ relational_precedence = self.class.const_get(:RELATIONAL_PRECEDENCE)
43
+ # The minimal-paren policy (expressir#651 — SC4UTILITI-199):
44
+ # EXPRESS's arithmetic and logical operators are left-associative,
45
+ # so a same-precedence child needs no parentheses on the left
46
+ # (`(a+b)+c` == `a+b+c`) and same-or-looser children need them on
47
+ # the right (`a+(b+c)` keeps its parens). The relational tier
48
+ # (=, <>, <, >, <=, >=, :=:, :<>:, IN, LIKE) is NON-associative —
49
+ # a chain re-parses to a different tree or not at all — so
50
+ # same-precedence children keep parentheses on BOTH sides.
51
+ # Higher number = looser binding.
52
+ parent_precedence = operator_precedence[node.operator]
53
+ relational = parent_precedence == relational_precedence
54
+ child_needs_parens = lambda do |operand, min_precedence, same_side|
55
+ operand.is_a?(Model::Expressions::BinaryExpression) &&
56
+ (
57
+ operator_precedence[operand.operator] >= min_precedence ||
58
+ (relational && same_side &&
59
+ operator_precedence[operand.operator] == parent_precedence)
60
+ )
61
+ end
62
+ op1_bin_exp = child_needs_parens.call(node.operand1, parent_precedence + 1, true)
63
+ op2_bin_exp = child_needs_parens.call(node.operand2, parent_precedence, true)
46
64
 
47
65
  [
48
66
  *if op1_bin_exp
@@ -11,10 +11,13 @@ module Expressir
11
11
 
12
12
  def format_supertype_expressions_binary_supertype_expression(node)
13
13
  supertype_precedence = self.class.const_get(:SUPERTYPE_OPERATOR_PRECEDENCE)
14
+ # The minimal-paren policy (expressir#651): left child needs
15
+ # parens only when strictly looser; right child when
16
+ # same-or-looser (left-associative operators).
14
17
  op1_higher_precedence = node.operand1.is_a?(Model::SupertypeExpressions::BinarySupertypeExpression) &&
15
18
  (supertype_precedence[node.operand1.operator] > supertype_precedence[node.operator])
16
19
  op2_higher_precedence = node.operand2.is_a?(Model::SupertypeExpressions::BinarySupertypeExpression) &&
17
- (supertype_precedence[node.operand2.operator] > supertype_precedence[node.operator])
20
+ (supertype_precedence[node.operand2.operator] >= supertype_precedence[node.operator])
18
21
 
19
22
  [
20
23
  *if op1_higher_precedence
@@ -7,26 +7,20 @@ module Expressir
7
7
  #
8
8
  # The grammar ships as a compiled PARG artifact
9
9
  # (+iso-10303-21.artifact.json+, the checksummed single source of
10
- # truth shared with expressir-rs; issue #625): parsing runs through
11
- # the artifact when it loads, with the DSL grammar as the fallback
12
- # lane. The parity spec pins the two lanes byte-identically on the
13
- # annex corpus.
10
+ # truth shared with expressir-rs; issue #625). The artifact is the
11
+ # only lane: the ruby DSL grammar retired once the artifact lane
12
+ # had a release cycle behind it (2.4.66/2.4.67), and the baked
13
+ # DSL trees (spec/fixtures/p21/conformance/*.tree.json) pin the
14
+ # replay byte-for-byte.
14
15
  module Parser
15
16
  module_function
16
17
 
17
18
  def parse(source)
18
- tree = artifact_tree(source) || Grammar.new.parse(source)
19
- Builder.build(tree)
19
+ Builder.build(artifact_tree(source))
20
20
  end
21
21
 
22
22
  def artifact_tree(source)
23
23
  artifact.parse("exchange_structure", source)
24
- rescue Parsanol::PARG::ArtifactError
25
- # The artifact itself is unusable (shape/edition/binding drift):
26
- # fall back to the DSL grammar lane. A genuine ParseFailed from
27
- # a valid artifact propagates — malformed input fails loudly on
28
- # both lanes.
29
- nil
30
24
  end
31
25
 
32
26
  def artifact
data/lib/expressir/p21.rb CHANGED
@@ -9,7 +9,6 @@ module Expressir
9
9
  autoload :TypedValue, "#{__dir__}/p21/population"
10
10
  autoload :Enumeration, "#{__dir__}/p21/population"
11
11
  autoload :Binary, "#{__dir__}/p21/population"
12
- autoload :Grammar, "#{__dir__}/p21/grammar"
13
12
  autoload :Builder, "#{__dir__}/p21/builder"
14
13
  autoload :Validator, "#{__dir__}/p21/validator"
15
14
  autoload :Typing, "#{__dir__}/p21/typing"
@@ -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.67".freeze
6
+ VERSION = "2.4.68".freeze
7
7
  end
8
8
  end
@@ -9,7 +9,7 @@
9
9
  # only, and cross-gem rake invocations must still load the task files.
10
10
  if defined?(RSpec)
11
11
  RSpec::Core::RakeTask.new(:"verify:remarks") do |task|
12
- task.rspec_opts = "--tag production_scale"
12
+ task.rspec_opts = "--tag production_scale --tag ~quarantined"
13
13
  end
14
14
  else
15
15
  warn "verify_remarks: rspec not available — task not defined"
data/rakelib/fuzz.rake CHANGED
@@ -43,8 +43,8 @@ namespace :fuzz do
43
43
  end
44
44
  when :rename_identifier
45
45
  lines.map! { |l| l.sub(/\b(part|compatible)\b/) { "#{Regexp.last_match(0)}_#{rng.rand(100)}" } }
46
- when :splice_comment then lines.insert(rng.rand(lines.size + 1), "(* a spliced fuzz comment *)\n")
47
- when :duplicate_line then lines.insert(rng.rand(lines.size + 1), lines[rng.rand(lines.size)].to_s)
46
+ when :splice_comment then lines.insert(rng.rand(lines.size + 1), +"(* a spliced fuzz comment *)\n")
47
+ when :duplicate_line then lines.insert(rng.rand(lines.size + 1), lines[rng.rand(lines.size)].to_s.dup)
48
48
  end
49
49
  end
50
50
  lines.join
@@ -11,6 +11,6 @@ namespace :verify do
11
11
  ]
12
12
 
13
13
  sh({ "EXPRESSIR_PRODUCTION_SCALE" => "1" },
14
- "bundle", "exec", "rspec", *specs)
14
+ "bundle", "exec", "rspec", "--tag", "~quarantined", *specs)
15
15
  end
16
16
  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.67
4
+ version: 2.4.68
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-11 00:00:00.000000000 Z
11
+ date: 2026-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -754,7 +754,6 @@ files:
754
754
  - lib/expressir/p21/builder.rb
755
755
  - lib/expressir/p21/dataset_manifest.rb
756
756
  - lib/expressir/p21/diff.rb
757
- - lib/expressir/p21/grammar.rb
758
757
  - lib/expressir/p21/iso-10303-21.artifact.json
759
758
  - lib/expressir/p21/json.rb
760
759
  - lib/expressir/p21/parser.rb
@@ -1,149 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "parsanol"
4
-
5
- module Expressir
6
- module P21
7
- # ISO 10303-21 exchange-structure grammar (TODO.eengine/06 step 1).
8
- # Parses the HEADER section and the DATA section's instance list
9
- # into a capture tree; {Expressir::P21::PopulationBuilder} turns
10
- # the tree into a {Expressir::P21::Population}.
11
- #
12
- # Reference: ISO 10303-21 exchange structure grammar
13
- # (`~/src/mn/iso-10303-detached-docs/sources/iso-10303-21*/`);
14
- # scope ladder in TODO.eengine/06 — the supported subset is the
15
- # header FILE_* entities plus simple/complex data instances with
16
- # lists, typed parameters, references, enumerations, binaries,
17
- # strings, unset ($) and derived (*).
18
- class Grammar < Parsanol::Parser
19
- root(:exchange_structure)
20
-
21
- rule(:comment) { str("/*") >> (str("*/").absent? >> any).repeat >> str("*/") }
22
- rule(:ws?) { (match[" \t\r\n"] | comment).repeat }
23
- rule(:ws1) { (match[" \t\r\n"] | comment).repeat(1) }
24
- rule(:keyword) { match["!"].maybe >> match["A-Za-z0-9_"].repeat(1) }
25
- rule(:entity_instance_name) { str("#") >> match["0-9"].repeat(1) }
26
- rule(:constant_reference) do
27
- str("#") >> match["A-Za-z_"] >> match["A-Za-z0-9_"].repeat
28
- end
29
- rule(:external_anchor) do
30
- str("<") >> (str(">").absent? >> any).repeat >> str(">")
31
- end
32
-
33
- rule(:string_literal) do
34
- # ISO 10303-21: doubled quotes are escaped quotes
35
- str("'") >> ((str("'").absent? >> any) | str("''")).repeat >> str("'")
36
- end
37
- rule(:binary_literal) { str('"') >> match["0-9A-Fa-f"].repeat >> str('"') }
38
- rule(:enumeration) { str(".") >> match["A-Za-z0-9_"].repeat(1) >> str(".") }
39
- rule(:unset) { str("$") }
40
- rule(:derived) { str("*") }
41
-
42
- rule(:parameter_list) do
43
- str("(") >> ws? >>
44
- (parameter.as(:parameter) >>
45
- (str(",") >> ws? >> parameter.as(:parameter)).repeat).maybe >>
46
- str(")") >> ws?
47
- end
48
-
49
- rule(:typed_parameter) do
50
- keyword.as(:keyword) >> ws? >> parameter_list.as(:parameter_list)
51
- end
52
- rule(:list_parameter) { parameter_list }
53
-
54
- rule(:number_literal) do
55
- match["+-"].maybe >> match["0-9"].repeat(1) >>
56
- (str(".") >> match["0-9"].repeat(1)).maybe >>
57
- (match["Ee"] >> match["+-"].maybe >> match["0-9"].repeat(1)).maybe
58
- end
59
-
60
- rule(:parameter) do
61
- typed_parameter.as(:typed_parameter) |
62
- list_parameter.as(:parameter_list) |
63
- entity_instance_name.as(:entity_instance_name) |
64
- constant_reference.as(:constant_reference) |
65
- external_anchor.as(:external_anchor) |
66
- number_literal.as(:number_literal) |
67
- enumeration.as(:enumeration) |
68
- binary_literal.as(:binary_literal) |
69
- string_literal.as(:string_literal) |
70
- unset.as(:unset) | derived.as(:derived)
71
- end
72
-
73
- rule(:simple_record) do
74
- keyword.as(:keyword) >> ws? >> parameter_list.as(:parameter_list)
75
- end
76
-
77
- rule(:subsuper_record) do
78
- str("(") >> ws? >> simple_record.as(:simple_record).repeat(1) >>
79
- str(")") >> ws?
80
- end
81
-
82
- rule(:simple_entity_instance) do
83
- (entity_instance_name.as(:entity_instance_name) >> ws? >>
84
- str("=") >> ws? >> simple_record.as(:simple_record) >>
85
- str(";") >> ws?).as(:simple_entity_instance)
86
- end
87
- rule(:complex_entity_instance) do
88
- (entity_instance_name.as(:entity_instance_name) >> ws? >>
89
- str("=") >> ws? >> subsuper_record.as(:subsuper_record) >>
90
- str(";") >> ws?).as(:complex_entity_instance)
91
- end
92
- rule(:external_reference_instance) do
93
- (entity_instance_name.as(:entity_instance_name) >> ws? >>
94
- str("=") >> ws? >> external_anchor.as(:external_anchor) >>
95
- str(";") >> ws?).as(:external_reference_instance)
96
- end
97
- rule(:entity_instance) do
98
- complex_entity_instance | simple_entity_instance |
99
- external_reference_instance
100
- end
101
-
102
- rule(:header_entity) do
103
- simple_record.as(:simple_record) >> str(";") >> ws?
104
- end
105
- # ISO 10303-21:2016 clause 14: two signature lines open the
106
- # header of a signed exchange structure.
107
- rule(:signature_lines) { (str("..") >> ws?).repeat }
108
- rule(:header_section) do
109
- str("HEADER;") >> ws? >> signature_lines >>
110
- header_entity.repeat(1).as(:header_entity) >>
111
- str("ENDSEC;") >> ws?
112
- end
113
- rule(:data_section) do
114
- (str("DATA") >> ws? >>
115
- parameter_list.as(:section_tag).maybe >> str(";") >> ws? >>
116
- entity_instance.repeat.as(:instance_list) >>
117
- str("ENDSEC;") >> ws?).as(:data_section)
118
- end
119
- # ISO 10303-21:2016 clause 9: the anchor section binds labels to
120
- # local instances (a promissory anchor binds the unset value).
121
- rule(:anchor_entry) do
122
- ((str("<") >> str(">").absent? >>
123
- match["A-Za-z0-9_./:#?=&%-"].repeat.as(:anchor_label) >>
124
- str(">") >> ws? >> str("=") >> ws? >>
125
- (entity_instance_name.as(:entity_instance_name) |
126
- unset.as(:unset))) >> str(";") >> ws?).as(:anchor_entry)
127
- end
128
- rule(:anchor_section) do
129
- (str("ANCHOR;") >> ws? >> anchor_entry.repeat.as(:anchor_entry) >>
130
- str("ENDSEC;") >> ws?).as(:anchor_section)
131
- end
132
- # ISO 10303-21:2016 clause 10: the reference section binds a
133
- # local instance name to an external anchor.
134
- rule(:reference_section) do
135
- (str("REFERENCE;") >> ws? >>
136
- entity_instance.repeat.as(:instance_list) >>
137
- str("ENDSEC;") >> ws?).as(:reference_section)
138
- end
139
- rule(:exchange_structure) do
140
- ws? >> str("ISO-10303-21;") >> ws? >>
141
- header_section.as(:header_section) >>
142
- anchor_section.maybe >>
143
- reference_section.maybe >>
144
- data_section.repeat(1).as(:data_section) >>
145
- str("END-ISO-10303-21;") >> ws?
146
- end
147
- end
148
- end
149
- end