Class: Evilution::Integration::Loading::SyntaxValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/integration/loading/syntax_validator.rb

Constant Summary collapse

ERROR_MESSAGE =
"mutated source has syntax errors"

Instance Method Summary collapse

Instance Method Details

#call(source) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/evilution/integration/loading/syntax_validator.rb', line 9

def call(source)
  return nil if Prism.parse(source).success?

  {
    passed: false,
    error: ERROR_MESSAGE,
    error_class: "SyntaxError",
    error_backtrace: []
  }
end