Fix the issue of BREAK tokenization error

修复BREAK分词错误的问题
This commit is contained in:
Physton
2023-08-04 11:19:21 +08:00
parent 2cbbcf953b
commit ddd41b2ea8
4 changed files with 25 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -710,6 +710,10 @@ export default {
}
}
if (tag.value === 'BREAK') {
splitSymbol = ' '
}
if (this.autoRemoveLastComma && index + 1 === length) {
// 如果是最后一个,那么就不需要加逗号
splitSymbol = ''

View File

@@ -64,7 +64,24 @@ export default (tags) => {
endBracketChar = brackets[char]
temp += char
} else {
temp += char
if (char === " " && temp.trim() === 'BREAK') {
result.push(temp.trim())
bracketCount = 0
startBracketChar = ''
endBracketChar = ''
temp = ''
} else {
temp += char
if (temp.endsWith(' BREAK')) {
temp = temp.substring(0, temp.length - ' BREAK'.length)
result.push(temp.trim())
result.push('BREAK')
bracketCount = 0
startBracketChar = ''
endBracketChar = ''
temp = ''
}
}
}
} else {
// 前面有括号