Major updates

- Improve ruby block detection heuristics
- Add block information storage and block aware movements.
- Other minor fixes
This commit is contained in:
2026-08-21 18:34:22 +01:00
parent 739d2e450e
commit 3e3fb6c39d
13 changed files with 298 additions and 133 deletions
+1
View File
@@ -33,6 +33,7 @@ struct alignas(2) RubyState {
DEF_NAME = 0b10,
MODULE_NAME = 0b11
};
static constexpr uint8_t NEWLINE = 1 << 5;
static constexpr uint8_t ALLOW_INTERPOLATION = 1 << 6;
static constexpr uint8_t EXPECTING_EXPRESSION = 1 << 7;
uint8_t flags = 0;
+3 -1
View File
@@ -11,6 +11,8 @@ struct RubyParser {
uint32_t i = 0;
bool heredoc_start_line = false;
bool ending = true;
bool op_last = false;
bool set_op_last = false;
RubyParser(void **v_state, std::string_view line)
: v_state(v_state), state((RubyState *)*v_state), line(line) {}
@@ -58,7 +60,7 @@ struct RubyParser {
.brace_level = 1,
.lit_brace_level = 0,
.state = RubyState::RubyInternalState::NONE,
.flags = RubyState::RubyInternalState::EXPECTING_EXPRESSION,
.flags = RubyState::RubyInternalState::EXPECTING_EXPRESSION | RubyState::RubyInternalState::NEWLINE,
.delim_start = '\0',
.delim_end = '\0'
};
-1
View File
@@ -189,7 +189,6 @@ const static std::vector<std::string> methods = {
"respond_to?",
"equal?",
"object_id",
"class",
"singleton_class",
"clone",
"freeze",