Skip to content

Commit

Permalink
Revert "[DROOLS-7591] Experiment branch : migrate a new drools-lsp pa…
Browse files Browse the repository at this point in the history
…rser int…" (apache#5689)

This reverts commit 3699d67.
  • Loading branch information
mariofusco authored and tkobayas committed Jun 11, 2024
1 parent 9f48f0f commit 4d20c37
Show file tree
Hide file tree
Showing 131 changed files with 63 additions and 11,957 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public KnowledgeBuilderRulesConfigurationImpl(CompositeConfiguration<KnowledgeBu
}

private void init() {

setProperty( TrimCellsInDTableOption.PROPERTY_NAME,
getPropertyValue(TrimCellsInDTableOption.PROPERTY_NAME,
"true"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.drools.drl.ast.descr.OperatorDescr;
import org.drools.drl.ast.descr.RelationalExprDescr;
import org.drools.drl.parser.DrlExprParser;
import org.drools.drl.parser.DrlExprParserFactory;
import org.drools.drl.parser.impl.Operator;
import org.kie.internal.builder.conf.LanguageLevelOption;

Expand Down Expand Up @@ -138,7 +137,7 @@ public StringBuilder dump( StringBuilder sbuilder,
}

private void processConstraint(StringBuilder sbuilder, ExprConstraintDescr base, boolean isInsideRelCons, DumperContext context) {
DrlExprParser expr = DrlExprParserFactory.getDrlExrParser(context.getRuleContext().getConfiguration().getOption(LanguageLevelOption.KEY));
DrlExprParser expr = new DrlExprParser( context.getRuleContext().getConfiguration().getOption(LanguageLevelOption.KEY));
ConstraintConnectiveDescr result = expr.parse( base.getExpression() );
if ( result.getDescrs().size() == 1 ) {
dump( sbuilder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
import org.drools.drl.ast.descr.ReturnValueRestrictionDescr;
import org.drools.drl.ast.descr.RuleDescr;
import org.drools.drl.parser.DrlExprParser;
import org.drools.drl.parser.DrlExprParserFactory;
import org.drools.drl.parser.DroolsParserException;
import org.drools.util.ClassUtils;
import org.drools.util.StringUtils;
Expand Down Expand Up @@ -1804,7 +1803,7 @@ protected ConstraintConnectiveDescr parseExpression(final RuleBuildContext conte
final PatternDescr patternDescr,
final BaseDescr original,
final String expression) {
DrlExprParser parser = DrlExprParserFactory.getDrlExrParser(context.getConfiguration().getOption(LanguageLevelOption.KEY));
DrlExprParser parser = new DrlExprParser(context.getConfiguration().getOption(LanguageLevelOption.KEY));
ConstraintConnectiveDescr result = parser.parse(normalizeEval(expression));
result.setResource(patternDescr.getResource());
result.copyLocation(original);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.drools.drl.ast.descr.ExprConstraintDescr;
import org.drools.drl.ast.descr.PatternDescr;
import org.drools.drl.parser.DrlExprParser;
import org.drools.drl.parser.DrlExprParserFactory;
import org.drools.drl.parser.DroolsParserException;
import org.drools.util.ClassUtils;
import org.drools.util.StringUtils;
Expand Down Expand Up @@ -265,7 +264,7 @@ private void processBinding( RuleBuildContext context,
} else {
// it must be a literal/expression
// it's an expression and thus an input
DrlExprParser parser = DrlExprParserFactory.getDrlExrParser(context.getConfiguration().getOption(LanguageLevelOption.KEY));
DrlExprParser parser = new DrlExprParser( context.getConfiguration().getOption(LanguageLevelOption.KEY));
ConstraintConnectiveDescr bresult = parser.parse( bind.getExpression() );
if ( parser.hasErrors() ) {
for ( DroolsParserException error : parser.getErrors() ) {
Expand Down Expand Up @@ -396,7 +395,7 @@ private static int getPos( String identifier,
private ConstraintConnectiveDescr parseExpression( final RuleBuildContext context,
final PatternDescr patternDescr,
final String expression ) {
DrlExprParser parser = DrlExprParserFactory.getDrlExrParser( context.getConfiguration().getOption(LanguageLevelOption.KEY));
DrlExprParser parser = new DrlExprParser( context.getConfiguration().getOption(LanguageLevelOption.KEY));
ConstraintConnectiveDescr result = parser.parse( expression );
if ( result == null || parser.hasErrors() ) {
for ( DroolsParserException error : parser.getErrors() ) {
Expand Down
81 changes: 0 additions & 81 deletions drools-drl/drools-drl-parser-tests/pom.xml

This file was deleted.

Loading

0 comments on commit 4d20c37

Please sign in to comment.