expressir 2.4.46-x86_64-linux → 2.4.48-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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -1
  3. data/expressir.gemspec +6 -3
  4. data/grammar-parg/CONVENTIONS.md +90 -0
  5. data/grammar-parg/RULE-INVENTORY.txt +252 -0
  6. data/grammar-parg/atoms_to_parg.rb +232 -0
  7. data/grammar-parg/bisect.sh +37 -0
  8. data/grammar-parg/ddmin.sh +39 -0
  9. data/grammar-parg/dsl-dump.json +1 -0
  10. data/grammar-parg/entries.parg.frag +12 -0
  11. data/grammar-parg/express-grammar.artifact.json +1 -0
  12. data/grammar-parg/express-grammar.parg +380 -0
  13. data/grammar-parg/express.json +1 -0
  14. data/grammar-parg/express.parg +57 -0
  15. data/grammar-parg/express_keywords.parg +132 -0
  16. data/grammar-parg/express_literals.parg +14 -0
  17. data/grammar-parg/express_operators.parg +34 -0
  18. data/grammar-parg/express_remarks.parg +19 -0
  19. data/grammar-parg/express_structure.parg +11 -0
  20. data/grammar-parg/generate-terminals.rb +55 -0
  21. data/grammar-parg/keywords.parg.frag +130 -0
  22. data/grammar-parg/literals.parg.frag +9 -0
  23. data/grammar-parg/operators.parg.frag +34 -0
  24. data/grammar-parg/parity-model.rb +68 -0
  25. data/grammar-parg/parity-vm.rb +60 -0
  26. data/grammar-parg/parity.sh +66 -0
  27. data/grammar-parg/parser-dsl-reference.rb.txt +757 -0
  28. data/grammar-parg/splice.rb +16 -0
  29. data/grammar-parg/tree_diff.rb +62 -0
  30. data/lib/expressir/express/grammar/express-grammar.artifact.json +1 -0
  31. data/lib/expressir/express/grammar/parser.rb +38 -0
  32. data/lib/expressir/express/parser.rb +3 -3
  33. data/lib/expressir/express/remark_attacher.rb +4 -2
  34. data/lib/expressir/model/exp_file.rb +1 -1
  35. data/lib/expressir/model/model_element.rb +3 -0
  36. data/lib/expressir/p28/configuration.rb +3 -1
  37. data/lib/expressir/version.rb +1 -1
  38. metadata +37 -16
@@ -126,6 +126,44 @@ module Expressir
126
126
  end
127
127
  end
128
128
 
129
+ # The compiled edition-2 PARG artifact: the DSL grammar's
130
+ # serialized twin (grammar-parg/express-grammar.parg, built by
131
+ # grammar-parg/atoms_to_parg.rb from the live atom tree). The
132
+ # artifact lane parses through parsanol's artifact VM and
133
+ # yields the same named trees the DSL path produces.
134
+ ARTIFACT_PATH = File.join(__dir__, "express-grammar.artifact.json")
135
+
136
+ def self.artifact_available?
137
+ return @artifact_available unless @artifact_available.nil?
138
+
139
+ @artifact_available = begin
140
+ require "parsanol/parg/artifact"
141
+ Parsanol::PARG::Artifact.respond_to?(:from_json) && File.exist?(ARTIFACT_PATH)
142
+ rescue LoadError
143
+ false
144
+ end
145
+ end
146
+
147
+ def self.parse_artifact(source)
148
+ raise LoadError, "Edition-2 artifact not available" unless artifact_available?
149
+
150
+ @parser_mutex.synchronize do
151
+ @artifact ||= Parsanol::PARG::Artifact.from_json(File.read(ARTIFACT_PATH))
152
+ end
153
+ # mode: :native rides the rs VM when the parsanol native ext
154
+ # is present and falls back to the ruby atom evaluation
155
+ # otherwise (Artifact#parse's own lane logic).
156
+ @artifact.parse("syntax", source)
157
+ end
158
+
159
+ # The Ruby-lane parse: the edition-2 artifact first, the DSL
160
+ # parser as fallback (issue #578 STEP 4).
161
+ def self.parse_ruby(source)
162
+ parse_artifact(source)
163
+ rescue StandardError, NotImplementedError
164
+ cached_parser.parse(source)
165
+ end
166
+
129
167
  def cts(atom)
130
168
  spaces >> atom
131
169
  end
@@ -79,10 +79,10 @@ module Expressir
79
79
  begin
80
80
  Grammar::Parser.parse_native(source)
81
81
  rescue StandardError
82
- Grammar::Parser.cached_parser.parse source
82
+ Grammar::Parser.parse_ruby(source)
83
83
  end
84
84
  else
85
- Grammar::Parser.cached_parser.parse source
85
+ Grammar::Parser.parse_ruby(source)
86
86
  end
87
87
  rescue Parsanol::ParseFailed => e
88
88
  raise Error::SchemaParseFailure.new(schema_file, e)
@@ -483,7 +483,7 @@ include_source: nil, root_path: nil, use_native: nil, &block)
483
483
  ast = if use_native && Grammar::Parser.native_available?
484
484
  Grammar::Parser.parse_native(content)
485
485
  else
486
- Grammar::Parser.cached_parser.parse(content)
486
+ Grammar::Parser.parse_ruby(content)
487
487
  end
488
488
  rescue Parsanol::ParseFailed, StandardError => e
489
489
  raise Error::SchemaParseFailure.new("(from string)", e)
@@ -930,6 +930,9 @@ module Expressir
930
930
 
931
931
  def normalize_path(path)
932
932
  return path unless path.include?(":")
933
+ # `__note:two` is one item id (a referable note/example), not a
934
+ # prefix:name pair to split into two path segments.
935
+ return path if path.split(".").last.start_with?("__")
933
936
 
934
937
  path_part, _, item_suffix = path.rpartition(":")
935
938
  "#{path_part}.#{item_suffix}"
@@ -1126,8 +1129,7 @@ module Expressir
1126
1129
  end
1127
1130
 
1128
1131
  def safe_reset_children_by_id(obj)
1129
- return unless obj
1130
- return unless obj.is_a?(Model::ScopeContainer)
1132
+ return unless obj.respond_to?(:reset_children_by_id)
1131
1133
 
1132
1134
  obj.reset_children_by_id
1133
1135
  end
@@ -17,7 +17,7 @@ module Expressir
17
17
  collection_attributes :schemas
18
18
 
19
19
  attribute :path, :string
20
- attribute :schemas, Declarations::Schema, collection: true, initialize_empty: true,
20
+ attribute :schemas, Declarations::Schema, collection: true,
21
21
  initialize_empty: true
22
22
  attribute :_class, :string, default: -> { self.class.name }
23
23
 
@@ -210,6 +210,9 @@ module Expressir
210
210
  return self if path.nil? || path.empty?
211
211
 
212
212
  path_parts = path.safe_downcase.split(".").map do |current_path|
213
+ # `__note:two` is a remark item id, not a prefixed name
214
+ next current_path if current_path.start_with?("__")
215
+
213
216
  _, _, current_path = current_path.rpartition(":") # ignore prefix
214
217
  current_path
215
218
  end
@@ -114,7 +114,9 @@ module Expressir
114
114
  return parent.attribute("select").value if parent.element? &&
115
115
  parent.name == "entity"
116
116
 
117
- parent = parent.parent
117
+ # The walk stops at the document node: moxml 0.6 adapters do
118
+ # not answer #parent on it.
119
+ parent = parent.is_a?(Moxml::Document) ? nil : parent.parent
118
120
  end
119
121
  nil
120
122
  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.46".freeze
6
+ VERSION = "2.4.48".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.46
4
+ version: 2.4.48
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-10-30 00:00:00.000000000 Z
11
+ date: 2026-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.8.114
89
+ version: 0.8.156
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.8.114
96
+ version: 0.8.156
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: moxml
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.5.154
103
+ version: 0.6.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.5.154
110
+ version: 0.6.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: paint
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,20 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.3.9
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: 1.3.89
131
+ version: 1.3.123
135
132
  type: :runtime
136
133
  prerelease: false
137
134
  version_requirements: !ruby/object:Gem::Requirement
138
135
  requirements:
139
136
  - - "~>"
140
137
  - !ruby/object:Gem::Version
141
- version: 1.3.9
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- version: 1.3.89
138
+ version: 1.3.123
145
139
  - !ruby/object:Gem::Dependency
146
140
  name: ruby-progressbar
147
141
  requirement: !ruby/object:Gem::Requirement
@@ -455,6 +449,32 @@ files:
455
449
  - exe/expressir-format-test
456
450
  - exe/expressir-lsp
457
451
  - expressir.gemspec
452
+ - grammar-parg/CONVENTIONS.md
453
+ - grammar-parg/RULE-INVENTORY.txt
454
+ - grammar-parg/atoms_to_parg.rb
455
+ - grammar-parg/bisect.sh
456
+ - grammar-parg/ddmin.sh
457
+ - grammar-parg/dsl-dump.json
458
+ - grammar-parg/entries.parg.frag
459
+ - grammar-parg/express-grammar.artifact.json
460
+ - grammar-parg/express-grammar.parg
461
+ - grammar-parg/express.json
462
+ - grammar-parg/express.parg
463
+ - grammar-parg/express_keywords.parg
464
+ - grammar-parg/express_literals.parg
465
+ - grammar-parg/express_operators.parg
466
+ - grammar-parg/express_remarks.parg
467
+ - grammar-parg/express_structure.parg
468
+ - grammar-parg/generate-terminals.rb
469
+ - grammar-parg/keywords.parg.frag
470
+ - grammar-parg/literals.parg.frag
471
+ - grammar-parg/operators.parg.frag
472
+ - grammar-parg/parity-model.rb
473
+ - grammar-parg/parity-vm.rb
474
+ - grammar-parg/parity.sh
475
+ - grammar-parg/parser-dsl-reference.rb.txt
476
+ - grammar-parg/splice.rb
477
+ - grammar-parg/tree_diff.rb
458
478
  - lib/expressir.rb
459
479
  - lib/expressir/3.2/expressir_core.so
460
480
  - lib/expressir/3.3/expressir_core.so
@@ -580,6 +600,7 @@ files:
580
600
  - lib/expressir/express/formatters/statements_formatter.rb
581
601
  - lib/expressir/express/formatters/supertype_expressions_formatter.rb
582
602
  - lib/expressir/express/grammar.rb
603
+ - lib/expressir/express/grammar/express-grammar.artifact.json
583
604
  - lib/expressir/express/grammar/parser.rb
584
605
  - lib/expressir/express/hyperlink_formatter.rb
585
606
  - lib/expressir/express/interface_dot.rb