Skip to content

Commit

Permalink
Reverted validator result returning null instead of an empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
Elscrux authored and schweikart committed Jan 22, 2024
1 parent f5833ba commit 893f999
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/converter/dimacs/LogicalExpressionValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ export class LogicalExpressionValidator {
wasNegate = token.name == TokenName.negate;
}

if (errors.length > 0) {
return errors;
} else {
return null;
}
return errors;
}
}
4 changes: 2 additions & 2 deletions src/pages/solve/SAT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TextArea } from "../../components/solvers/SAT/TextArea";
import { LogicalExpressionValidator } from "../../converter/dimacs/LogicalExpressionValidator";

const SAT: NextPage = () => {
const logicalExpressionParser = new LogicalExpressionValidator();
const logicalExpressionValidator = new LogicalExpressionValidator();

const [logicalExpressionString, setLogicalExpressionString] = useState("");
const [errorString, setErrorString] = useState("");
Expand Down Expand Up @@ -46,7 +46,7 @@ const SAT: NextPage = () => {
setProblemString={(value) => {
setLogicalExpressionString(value);

let errors = logicalExpressionParser.validateLogicalExpression(
let errors = logicalExpressionValidator.validateLogicalExpression(
value.toString()
);

Expand Down

0 comments on commit 893f999

Please sign in to comment.