Class: Ibex::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/ibex/diff.rb

Overview

Deterministic grammar and automaton change classification.

Instance Method Summary collapse

Constructor Details

#initialize(before, after) ⇒ Diff

Returns a new instance of Diff.



8
9
10
11
# File 'lib/ibex/diff.rb', line 8

def initialize(before, after)
  @before = before
  @after = after
end

Instance Method Details

#to_hObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/ibex/diff.rb', line 14

def to_h
  {
    ibex_report: "diff", schema_version: 1,
    symbols: classify(symbol_records(@before.grammar), symbol_records(@after.grammar)),
    rules: classify(rule_records(@before.grammar), rule_records(@after.grammar)),
    conflicts: classify(conflict_records(@before), conflict_records(@after)),
    warnings: classify(warning_records(@before.grammar), warning_records(@after.grammar)),
    metrics: numeric_metrics
  }
end