This commit is contained in:
2026-01-18 13:20:51 +00:00
parent d0e811904c
commit c8db7b14a3
4 changed files with 9 additions and 8 deletions

View File

@@ -65,7 +65,6 @@ std::shared_ptr<void> bash_parse(std::vector<Token> *tokens,
len--;
if (len == 0)
return state;
bool heredoc_first = false;
while (i < len) {
i += utf8_codepoint_width(text[i]);
}

View File

@@ -800,14 +800,16 @@ std::shared_ptr<void> ruby_parse(std::vector<Token> *tokens,
continue;
} else {
uint32_t start = i;
if (i + 4 < len && text[i] == 't' && text[i + 1] == 'r' &&
text[i + 2] == 'u' && text[i + 3] == 'e') {
if (i + 3 < len && text[i] == 't' && text[i + 1] == 'r' &&
text[i + 2] == 'u' && text[i + 3] == 'e' && i + 4 < len &&
!identifier_char(text[i + 4])) {
i += 4;
tokens->push_back({start, i, TokenKind::True});
continue;
}
if (i + 5 < len && text[i] == 'f' && text[i + 1] == 'a' &&
text[i + 2] == 'l' && text[i + 3] == 's' && text[i + 4] == 'e') {
if (i + 4 < len && text[i] == 'f' && text[i + 1] == 'a' &&
text[i + 2] == 'l' && text[i + 3] == 's' && text[i + 4] == 'e' &&
i + 5 < len && !identifier_char(text[i + 5])) {
i += 5;
tokens->push_back({start, i, TokenKind::False});
continue;