mame/quine-relay · error · RuntimeError

parse error at app

Error message

parse error at app

What it means

Error "parse error at app" thrown in mame/quine-relay.

Source

Thrown at vendor/grass.rb:179

    raise IllegalState, "illegal final machine state" unless m.env.size == 1
    m.env.first
  end

  InitialEnv = [In.new, CharFn.new(?w.ord), Succ.new, Out.new]
  InitialDump = [[[], []], [[App.new(1, 1)], []]]

  def start(code)
    eval Machine.new(code, InitialEnv, InitialDump)
  end

  def parse(src)
    code = []
    src = src.sub(/\A[^ww]*/, '').gsub(/[^wwWWvv]/, '')
    src.split(/[vv]+/).each { |s|
      a = s.scan(/[ww]+|[WW]+/).map { |i| i.split(//).size }
      arity = 0
      arity = a.shift if /\A[ww]/ =~ s
      raise "parse error at app" unless a.size % 2 == 0
      body = []
      0.step(a.size - 1, 2) { |i| body.push App.new(a[i], a[i+1]) }
      insn = (0...arity).inject(body) { |body,| [Abs.new(body)] }
      code.concat insn
    }
    code
  end

  public

  def run(src)
    start parse(src)
  end

end

if $0 == __FILE__ then
  $stderr.puts "Grass #{Grass::RELEASE_DATE}" if $VERBOSE

View on GitHub (pinned to c2aa5098d3)

When it happens

Trigger: Thrown at vendor/grass.rb:179 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of mame/quine-relay@c2aa5098d3 (2026-08-21). Data as JSON: /api/errors/3e284d897228a3fe. Report an issue: GitHub.