expressir 2.4.67-aarch64-linux → 2.4.68-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 +4 -4
- data/ENGINE-COMPAT.json +4 -4
- data/lib/expressir/3.2/expressir_core.so +0 -0
- data/lib/expressir/3.3/expressir_core.so +0 -0
- data/lib/expressir/3.4/expressir_core.so +0 -0
- data/lib/expressir/4.0/expressir_core.so +0 -0
- data/lib/expressir/express/formatter.rb +3 -0
- data/lib/expressir/express/formatters/expressions_formatter.rb +22 -4
- data/lib/expressir/express/formatters/supertype_expressions_formatter.rb +4 -1
- data/lib/expressir/p21/parser.rb +6 -12
- data/lib/expressir/p21.rb +0 -1
- data/lib/expressir/version.rb +1 -1
- data/lib/tasks/verify_remarks.rake +1 -1
- data/rakelib/fuzz.rake +2 -2
- data/rakelib/verify_remarks.rake +1 -1
- metadata +2 -3
- data/lib/expressir/p21/grammar.rb +0 -149
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 521e50c2073bfc5f9ad137736b66393d7d2f16cc74e5fb3bca18f89100d11cea
|
|
4
|
+
data.tar.gz: eda5ce133aa7a9d012068b19d82fbfb22fe0b566dfcaa96be621093599b881d9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9909357488895656a08dbc27a629dd0f8bfa64727c73763acef1fdc325054a3b0929bb8c05970876405f5092243c4a625434c446fb9e69c46c29c4beefd2416
|
|
7
|
+
data.tar.gz: 90ba0536bd3a289fbc90883c22d0f6db0d16e6bf17e38882843905556226cac723fdb094d1f61cd13273ef0ddca13a794e377bf1e697e6fda1c7dde6839c6270
|
data/ENGINE-COMPAT.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"engine_commit": "
|
|
3
|
-
"rubygems": "2.4.
|
|
4
|
-
"ext": "v0.1.
|
|
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-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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]
|
|
20
|
+
(supertype_precedence[node.operand2.operator] >= supertype_precedence[node.operator])
|
|
18
21
|
|
|
19
22
|
[
|
|
20
23
|
*if op1_higher_precedence
|
data/lib/expressir/p21/parser.rb
CHANGED
|
@@ -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)
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
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
|
-
|
|
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"
|
data/lib/expressir/version.rb
CHANGED
|
@@ -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
|
data/rakelib/verify_remarks.rake
CHANGED
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.
|
|
4
|
+
version: 2.4.68
|
|
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-11-
|
|
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
|