interscript 3.7.4 → 3.8.0

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: 8b3bb518c4463978a9e9bcc83a5a7709dbbd14a82648af9b1ade95de034b3b12
4
- data.tar.gz: 3e050968f0440455132f8f72d3af6b0707331dfcd136060c5cef83d3e6174d50
3
+ metadata.gz: 8e29e350953744db7644161da73688c49bc14fce8910c7894a7284b3d18a2892
4
+ data.tar.gz: 950d08e95b931299d4da63afc2a859358e02d54df51708751c0b8056f3e84e7c
5
5
  SHA512:
6
- metadata.gz: 666ef49712f6fe03af0e5793e9f24da20f36b78e9e884215002028731271880bee4dd6c13ba04fed898fdd6b62244083bbdfe8cb1cbfb5709688c6e7ab60cf0a
7
- data.tar.gz: d1f40685705bd03fe91128ee082af6ec2d664197dcd48f88a5250b6d9eb49fefb6a9e5164bde95c5cb5c7433657b4dd2517cdef340958f50eb4d3b2f8a545b09
6
+ metadata.gz: 7cd674a33abcf0a865aa34fe4d9cd578a5d9f1da66553358b42ea7cbb8a65e16cb782c3c319a6721c9a4a424efc5f7063324c335eb7d960401e073c0237e452d
7
+ data.tar.gz: 16d2dce87b8e7f16acace9127e8b7b292ef7dd807fd4e8aaafa8fb053c47a021c363c7d57b558f61e1f6a37d357a4f163a9a2f57e28f39da84bb51311cdb07d1
@@ -27,7 +27,8 @@ class Interscript::Interpreter < Interscript::Compiler
27
27
  # standard:disable Style/GlobalVars (deliberate $DEBUG / -d-flag debug idiom)
28
28
  $select_nth_string = true
29
29
  # standard:enable Style/GlobalVars
30
- result = Stage.new(@map, str, language: language).execute_rule(stage)
30
+ result = Stage.new(@map, str, language: language,
31
+ run_chain: ["map.#{@map.name}.stage.#{stage_name}"]).execute_rule(stage)
31
32
  # standard:disable Style/GlobalVars (deliberate $DEBUG / -d-flag debug idiom)
32
33
  $select_nth_string = false
33
34
  # standard:enable Style/GlobalVars
@@ -73,7 +74,8 @@ class Interscript::Interpreter < Interscript::Compiler
73
74
  e
74
75
  end
75
76
  else
76
- Stage.new(@map, str, language: language).execute_rule(stage)
77
+ Stage.new(@map, str, language: language,
78
+ run_chain: ["map.#{@map.name}.stage.#{stage_name}"]).execute_rule(stage)
77
79
  end
78
80
  end
79
81
 
@@ -122,10 +124,14 @@ class Interscript::Interpreter < Interscript::Compiler
122
124
  class Stage
123
125
  attr_reader :language
124
126
 
125
- def initialize(map, str, language: nil)
127
+ def initialize(map, str, language: nil, run_chain: [])
126
128
  @str = str
127
129
  @map = map
128
130
  @language = Interscript::Interpreter.select_language(map, language)
131
+ # maps#294: stages currently in flight, keyed "map.<doc>.stage.<name>"
132
+ # (the resolved target, not the alias spelling). Seeded by
133
+ # Interpreter#call with the invoked stage; every nested run extends it.
134
+ @run_chain = run_chain
129
135
  end
130
136
 
131
137
  # ISC-WF-1 W3 guard applicability. Unguarded rules always apply; a
@@ -279,17 +285,39 @@ class Interscript::Interpreter < Interscript::Compiler
279
285
  doc = @map.dep_aliases[r.stage.map].document
280
286
  stage = doc.imported_stages[r.stage.name]
281
287
  raise Interscript::MapLogicError, %(stage "#{r.stage.name}" not found in #{doc.name}) unless stage
282
- @str = Stage.new(doc, @str, language: @language).execute_rule(stage)
288
+ @str = Stage.new(doc, @str, language: @language,
289
+ run_chain: enter_run(doc, r.stage.name)).execute_rule(stage)
283
290
  else
284
291
  stage = @map.imported_stages[r.stage.name]
285
292
  raise Interscript::MapLogicError, %(stage "#{r.stage.name}" not found in #{@map.name}) unless stage
286
- @str = Stage.new(@map, @str, language: @language).execute_rule(stage)
293
+ @str = Stage.new(@map, @str, language: @language,
294
+ run_chain: enter_run(@map, r.stage.name)).execute_rule(stage)
287
295
  end
288
296
  end
289
297
 
290
298
  @str
291
299
  end
292
300
 
301
+ # maps#294 (WO20 fuzz): a self- or mutual-recursive `run stage.<x>`
302
+ # recursed until SystemStackError — a crash-class death embedders
303
+ # cannot handle (rs aborted the process outright pre-0.3.3; ts
304
+ # overflowed its stack the same way). The run chain is threaded
305
+ # through nested stages; a revisited RESOLVED target (document +
306
+ # stage, not the alias spelling — a dependency chain may reuse one
307
+ # alias for different targets) is a named MapLogicError carrying the
308
+ # chain, in the directive's own syntax. Mirrors rs's shipped 0.3.3
309
+ # guard and the W1 `use cycle:` named errors; py's conversion-time
310
+ # guard fires earlier still. A NON-cyclic re-run (a diamond: two
311
+ # callers sharing one downstream run) stays legal — the chain holds
312
+ # only the stages in flight.
313
+ def enter_run(doc, stage_name)
314
+ entry = "map.#{doc.name}.stage.#{stage_name}"
315
+ if @run_chain.include?(entry)
316
+ raise Interscript::MapLogicError, "run cycle: #{(@run_chain + [entry]).join(" -> ")}"
317
+ end
318
+ @run_chain + [entry]
319
+ end
320
+
293
321
  def build_regexp(r)
294
322
  from = build_item(r.from, :re)
295
323
  before = build_item(r.before, :re) if r.before
@@ -14,7 +14,7 @@ module Interscript::ML
14
14
  EOS_ID = 1
15
15
  UNK_ID = 2
16
16
 
17
- DEFAULT_INDEX_URL = "https://github.com/interscript/interscript-models/releases/download/index-v15/models-index.yaml"
17
+ DEFAULT_INDEX_URL = "https://github.com/interscript/interscript-models/releases/download/index-v16/models-index.yaml"
18
18
 
19
19
  class FormatError < StandardError; end
20
20
  class RegistryError < StandardError; end
@@ -1,3 +1,3 @@
1
1
  module Interscript
2
- VERSION = "3.7.4"
2
+ VERSION = "3.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.4
4
+ version: 3.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-20 00:00:00.000000000 Z
11
+ date: 2026-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor