Skip to content

Commit

Permalink
style: fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AlansCodeLog committed May 27, 2024
1 parent dc27d0e commit 807b96d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Parser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isArray } from "@alanscodelog/utils/isArray"
import { isWhitespace } from "@alanscodelog/utils/isWhitespace"
import { last } from "@alanscodelog/utils/last"
import { mixin } from "@alanscodelog/utils/mixin"
import { setReadOnly } from "@alanscodelog/utils/setReadOnly"
import type { AddParameters, Mixin } from "@alanscodelog/utils/types"
Expand Down Expand Up @@ -345,12 +344,12 @@ export class Parser<T extends {} = {}> {
const pairs: any[][] = [] as any
let next = this.peek(1)

while (true) {
while (pairs.length < 1 || pairs[pairs.length - 1]?.[1] !== undefined) {
const exp = type === "AND" ? this.ruleCondition() : this.ruleBool("AND")
next = this.peek(1)
const canAttemptErrorRecovery = type === "AND"
? ["error", "and"].includes(this.options.onMissingBooleanOperator)
: this.options.onMissingBooleanOperator === "or"
? ["error", "and"].includes(this.options.onMissingBooleanOperator)
: this.options.onMissingBooleanOperator === "or"
const extras: any[] = []
if (
canAttemptErrorRecovery
Expand Down Expand Up @@ -404,9 +403,6 @@ export class Parser<T extends {} = {}> {
pairs[pairs.length - 1].splice(1, 1, extra[0])
pairs.push([extra[1]])
}
if (last(pairs)[1] === undefined) {
break
}
}

if (pairs.length === 0 && this.isType(this.peek(1), OP_TYPE)) {
Expand Down

0 comments on commit 807b96d

Please sign in to comment.