diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-01-18 04:35:19 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-19 08:19:43 +0100 |
commit | fc7a06af9d3fd3631be773708fccaa0fc1d46907 (patch) | |
tree | d264a9f6858a2175bbb6c49eeb8d69d86d3ee0a6 /Userland/Shell | |
parent | 8cfda86a459db42e5c361fdc84880f2b2248aab8 (diff) | |
download | serenity-fc7a06af9d3fd3631be773708fccaa0fc1d46907.zip |
Shell: Consider numbers as word characters too
Otherwise `foobar2` wouldn't be a valid identifier
Diffstat (limited to 'Userland/Shell')
-rw-r--r-- | Userland/Shell/Shell.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Shell/Shell.h b/Userland/Shell/Shell.h index b86923e445..1aa65b343f 100644 --- a/Userland/Shell/Shell.h +++ b/Userland/Shell/Shell.h @@ -330,9 +330,9 @@ private: 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) |