Skip to content

Commit

Permalink
Do not highlight variable pattern expansion as comments in Bash lexer.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitalquark committed Aug 14, 2023
1 parent 9569188 commit 0a8c23d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lexers/bash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ local builtin_var = lex:tag(lexer.OPERATOR, '$') * lex:tag(lexer.VARIABLE_BUILTI
lexer.VARIABLE_BUILTIN) + S('!#?*@$-') + lexer.digit^1)
local var_ref = lex:tag(lexer.OPERATOR, '$' * ('{' * S('!#')^-1)^-1) *
lex:tag(lexer.VARIABLE, lexer.word)
lex:add_rule('variable', builtin_var + var_ref)
local patt_expansion = lex:tag(lexer.DEFAULT, '/#' + '#' * P('#')^-1)
lex:add_rule('variable', builtin_var + var_ref * patt_expansion^-1)

-- Operators.
local op = S('!<>&|;$()[]{}') + lpeg.B(lexer.space) * S('.:') * #lexer.space
Expand Down

0 comments on commit 0a8c23d

Please sign in to comment.