Skip to content

Commit

Permalink
fix: highlight & in identifier as error
Browse files Browse the repository at this point in the history
  • Loading branch information
mnacamura committed Feb 6, 2024
1 parent fa77cad commit 1c0e427
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
- `\u{..}` is supported by Lua>=5.3, highlighted as error otherwise.
- Support `accumulate` macro.

### Fixed

- `&` in identifier is now highlighted as error (Fennel 1.0.0).

## [0.2][v0.2] (2021-06-20)

### Added
Expand Down
8 changes: 4 additions & 4 deletions syntax/fennel.vim
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ syn keyword fennelConstant nil
" Identifier, symbol, and keyword {{{2
"
" <identifier> -> <initial> <subsequent> *
" where <initial> -> [^#:0-9[:space:]\n"'(),;@\[\]\\`{}~]
" <subsequent> -> [^[:space:]\n"'(),;@\[\]\\`{}~]
syn match fennelIdentifier /[^#:0-9[:space:]\n"'(),;@\[\]\\`{}~][^[:space:]\n"'(),;@\[\]\\`{}~]*/
" where <initial> -> [^#&:0-9[:space:]\n"'(),;@\[\]\\`{}~]
" <subsequent> -> [^&[:space:]\n"'(),;@\[\]\\`{}~]
syn match fennelIdentifier /[^#&:0-9[:space:]\n"'(),;@\[\]\\`{}~][^&[:space:]\n"'(),;@\[\]\\`{}~]*/
syn match fennelLuaTableItemAccessor /\./ contained containedin=fennelIdentifier
syn match fennelLuaMethodCall /:/ contained containedin=fennelIdentifier
syn match fennelSymbol /[^#:0-9[:space:]\n"'(),;@\[\]\\`{}~][^[:space:]\n"'(),;@\[\]\\`{}~]*/ contained
syn match fennelSymbol /[^#&:0-9[:space:]\n"'(),;@\[\]\\`{}~][^&[:space:]\n"'(),;@\[\]\\`{}~]*/ contained
" <keyword> -> : <subsequent> +
" Keyword such as ::: is accepted by Fennel!
syn match fennelKeyword /:[^[:space:]\n"'(),;@\[\]\\`{}~]\+/
Expand Down

0 comments on commit 1c0e427

Please sign in to comment.