瀏覽代碼

Shell: Consider numbers as word characters too

Otherwise `foobar2` wouldn't be a valid identifier
AnotherTest 4 年之前
父節點
當前提交
fc7a06af9d
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Userland/Shell/Shell.h

+ 2 - 2
Userland/Shell/Shell.h

@@ -330,9 +330,9 @@ private:
     mutable bool m_last_continuation_state { false }; // false == not needed.
     mutable bool m_last_continuation_state { false }; // false == not needed.
 };
 };
 
 
-static constexpr bool is_word_character(char c)
+[[maybe_unused]] static constexpr bool is_word_character(char c)
 {
 {
-    return c == '_' || (c <= 'Z' && c >= 'A') || (c <= 'z' && c >= 'a');
+    return c == '_' || (c <= 'Z' && c >= 'A') || (c <= 'z' && c >= 'a') || (c <= '9' && c >= '0');
 }
 }
 
 
 inline size_t find_offset_into_node(const String& unescaped_text, size_t escaped_offset)
 inline size_t find_offset_into_node(const String& unescaped_text, size_t escaped_offset)