Class: Mutest::Expression::Parser Private
- Inherits:
-
Object
- Object
- Mutest::Expression::Parser
- Defined in:
- lib/mutest/expression/parser.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.
Defined Under Namespace
Classes: AmbiguousExpressionError, InvalidExpressionError, ParserError
Instance Method Summary collapse
-
#call(input) ⇒ Expression
private
Parse input into expression or raise.
-
#try_parse(input) ⇒ Expression?
private
Try to parse input into expression.
Instance Method Details
#call(input) ⇒ Expression
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.
Parse input into expression or raise
25 26 27 |
# File 'lib/mutest/expression/parser.rb', line 25 def call(input) try_parse(input) or raise InvalidExpressionError, "Expression: #{input.inspect} is not valid" end |
#try_parse(input) ⇒ Expression?
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.
Try to parse input into expression
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/mutest/expression/parser.rb', line 38 def try_parse(input) expressions = expressions(input) case expressions.length when 0 # rubocop:disable Lint/EmptyWhen when 1 Util.one(expressions) else raise AmbiguousExpressionError, "Ambiguous expression: #{input.inspect}" end end |