aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/viml/parser/parser.h
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2021-10-09 14:20:16 +0200
committerGitHub <noreply@github.com>2021-10-09 05:20:16 -0700
commit0fc8597f011e0927e529abd11bf0ddd8d0d1eaab (patch)
tree2339570a059d7ebb41f26db32b032440d1505ee7 /src/nvim/viml/parser/parser.h
parenta36c6e5df959867ff4041405f4098b7833281517 (diff)
downloadrneovim-0fc8597f011e0927e529abd11bf0ddd8d0d1eaab.tar.gz
rneovim-0fc8597f011e0927e529abd11bf0ddd8d0d1eaab.tar.bz2
rneovim-0fc8597f011e0927e529abd11bf0ddd8d0d1eaab.zip
refactor: format header files with uncrustify #15877
* refactor: format header files with uncrustify * fixup(justin): skip formatting of terminfo_defs.h * fixup: force winsock2 to be included first * fixup: simplify disable/enable directive to "uncrustify:off/on"
Diffstat (limited to 'src/nvim/viml/parser/parser.h')
-rw-r--r--src/nvim/viml/parser/parser.h31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/nvim/viml/parser/parser.h b/src/nvim/viml/parser/parser.h
index 7ac49709d8..b2933c3781 100644
--- a/src/nvim/viml/parser/parser.h
+++ b/src/nvim/viml/parser/parser.h
@@ -1,12 +1,12 @@
#ifndef NVIM_VIML_PARSER_PARSER_H
#define NVIM_VIML_PARSER_PARSER_H
+#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
-#include <assert.h>
-#include "nvim/lib/kvec.h"
#include "nvim/func_attr.h"
+#include "nvim/lib/kvec.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
@@ -82,9 +82,9 @@ typedef struct {
} ParserState;
static inline void viml_parser_init(
- ParserState *const ret_pstate,
- const ParserLineGetter get_line, void *const cookie,
- ParserHighlight *const colors)
+ ParserState *const ret_pstate,
+ const ParserLineGetter get_line, void *const cookie,
+ ParserHighlight *const colors)
REAL_FATTR_ALWAYS_INLINE REAL_FATTR_NONNULL_ARG(1, 2);
/// Initialize a new parser state instance
@@ -94,10 +94,8 @@ static inline void viml_parser_init(
/// @param[in] cookie Argument for the get_line function.
/// @param[in] colors Where to save highlighting. May be NULL if it is not
/// needed.
-static inline void viml_parser_init(
- ParserState *const ret_pstate,
- const ParserLineGetter get_line, void *const cookie,
- ParserHighlight *const colors)
+static inline void viml_parser_init(ParserState *const ret_pstate, const ParserLineGetter get_line,
+ void *const cookie, ParserHighlight *const colors)
{
*ret_pstate = (ParserState) {
.reader = {
@@ -194,8 +192,7 @@ static inline void viml_parser_advance(ParserState *const pstate,
///
/// @param pstate Parser state to advance.
/// @param[in] len Number of bytes to advance.
-static inline void viml_parser_advance(ParserState *const pstate,
- const size_t len)
+static inline void viml_parser_advance(ParserState *const pstate, const size_t len)
{
assert(pstate->pos.line == kv_size(pstate->reader.lines) - 1);
const ParserLine pline = kv_last(pstate->reader.lines);
@@ -219,10 +216,8 @@ static inline void viml_parser_highlight(ParserState *const pstate,
/// @param[in] start Start position of the highlight.
/// @param[in] len Highlighting chunk length.
/// @param[in] group Highlight group.
-static inline void viml_parser_highlight(ParserState *const pstate,
- const ParserPosition start,
- const size_t len,
- const char *const group)
+static inline void viml_parser_highlight(ParserState *const pstate, const ParserPosition start,
+ const size_t len, const char *const group)
{
if (pstate->colors == NULL || len == 0) {
return;
@@ -231,9 +226,9 @@ static inline void viml_parser_highlight(ParserState *const pstate,
|| kv_Z(*pstate->colors, 0).start.line < start.line
|| kv_Z(*pstate->colors, 0).end_col <= start.col);
kvi_push(*pstate->colors, ((ParserHighlightChunk) {
- .start = start,
- .end_col = start.col + len,
- .group = group,
+ .start = start,
+ .end_col = start.col + len,
+ .group = group,
}));
}