@Test void shouldParseDisjunctionWithMixedExpressions() { final FeelExpression expression = FeelParser.PARSER.parse("10,[20..30],>10,42"); final FeelExpression expectedExpression = DisjunctionExpression( IntegerLiteral(10), DisjunctionExpression( RangeExpression(true, IntegerLiteral(20), IntegerLiteral(30), true), DisjunctionExpression( UnaryExpression(Operator.GT, IntegerLiteral(10)), IntegerLiteral(42)))); assertEquals(expectedExpression, expression); }
public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } }
FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } } }
FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } } private  FeelParser(); }
FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } } private  FeelParser(); static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence); }
FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } } private  FeelParser(); static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence);  }