fix: LogicalOperator parse error

This commit is contained in:
lisonge 2023-09-11 18:05:22 +08:00
parent ba3550e1bb
commit 7bc1dfe9d9

View File

@ -328,7 +328,7 @@ internal object ParserSet {
when (source[i]) { when (source[i]) {
'(' -> { '(' -> {
if (parserResults.isNotEmpty()) { if (parserResults.isNotEmpty()) {
val lastToken = parserResults.first() val lastToken = parserResults.last()
if (lastToken.data !is LogicalOperator) { if (lastToken.data !is LogicalOperator) {
var count = 0 var count = 0
while (i - 1 >= count && source[i - 1 - count] in whiteCharParser.prefix) { while (i - 1 >= count && source[i - 1 - count] in whiteCharParser.prefix) {