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

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

ERROR_MESSAGE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"mutated source has syntax errors"

Instance Method Summary collapse

Instance Method Details

#call(source) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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