neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 9eb0426002696fba4a7c5b9cadd8799a8ae18e6a
parent f2083bd55cafe861e9dffb1c1658e5b0983c5ef6
Author: Ilia Choly <ilia.choly@gmail.com>
Date:   Fri, 31 May 2024 11:47:32 -0400

fix(luacats): allow all types inside tuples

Diffstat:
Mscripts/luacats_grammar.lua | 2+-
Mtest/functional/script/luacats_grammar_spec.lua | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/luacats_grammar.lua b/scripts/luacats_grammar.lua @@ -180,7 +180,7 @@ local grammar = P { fun_param = lname * opt(colon * v.ltype), ty_fun = Pf('fun') * paren(comma(lname * opt(colon * v.ltype))) * opt(colon * comma1(v.ltype)), ty_generic = P('`') * letter * P('`'), - ty_tuple = Pf('[') * comma(v.ty_opt) * fill * P(']'), + ty_tuple = Pf('[') * comma(v.ltype) * fill * P(']'), } return grammar --[[@as nvim.luacats.grammar]] diff --git a/test/functional/script/luacats_grammar_spec.lua b/test/functional/script/luacats_grammar_spec.lua @@ -160,10 +160,10 @@ describe('luacats grammar', function() type = '`T`', }) - test('@param type [number,string] this is a tuple type', { + test('@param type [number,string,"good"|"bad"] this is a tuple type', { desc = 'this is a tuple type', kind = 'param', name = 'type', - type = '[number,string]', + type = '[number,string,"good"|"bad"]', }) end)