Skip to content

Commit

Permalink
fix: stops at numbers in camelCase (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Nov 2, 2023
1 parent 2fe8ced commit 331bb16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/spider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ end
local function getNextPosition(line, col, key, opts)
-- `%f[set]` is roughly lua's equivalent of `\b`
local patterns = {
lowerWord = "%u?[%l%d]+", -- first char may be uppercase for CamelCase
upperWord = "%f[%w][%u%d]+%f[^%w]", -- solely uppercase for SCREAMING_SNAKE_CASE
lowerWord = "%u?[%l]+", -- first char may be uppercase for CamelCase
upperWord = "%f[%w][%u]+%f[^%w]", -- solely uppercase for SCREAMING_SNAKE_CASE
number = "%d+", -- see issue #31 divisibleBy10Test
punctuation = "%f[^%s]%p+%f[%s]", -- punctuation surrounded by whitespace
punctAtStart = "^%p+%f[%s]", -- needed since lua does not allow for logical OR
punctAtEnd = "%f[^%s]%p+$",
Expand Down

0 comments on commit 331bb16

Please sign in to comment.