mirror of
https://github.com/neovim/neovim.git
synced 2025-12-17 11:55:34 +00:00
test/formatc: improve 'inline' function handling
Apple seems to define some functions as `inline` but not `static` in headers. The ghetto parser wasn't unbelievably happy with this.
This commit is contained in:
committed by
Thiago de Arruda
parent
115b165bfa
commit
10479fd233
@@ -176,9 +176,10 @@ local function formatc(str)
|
|||||||
end_at_brace = false
|
end_at_brace = false
|
||||||
end
|
end
|
||||||
elseif typ == 'identifier' then
|
elseif typ == 'identifier' then
|
||||||
-- static usually indicates an inline header function, which has no
|
-- static and/or inline usually indicate an inline header function,
|
||||||
-- trailing ';', so we have to add a newline after the '}' ourselves.
|
-- which has no trailing ';', so we have to add a newline after the
|
||||||
if token[1] == 'static' then
|
-- '}' ourselves.
|
||||||
|
if token[1] == 'static' or token[1] == 'inline' then
|
||||||
end_at_brace = true
|
end_at_brace = true
|
||||||
end
|
end
|
||||||
elseif typ == 'preprocessor' then
|
elseif typ == 'preprocessor' then
|
||||||
|
|||||||
Reference in New Issue
Block a user