Skip to content

馃暣馃従 Our pre-commit/clang-format config is not great 馃暣馃従#212

Description

@BaseMax

As you see in some file for example lexer.test.c file I want to implement items of tokens in several lines..
https://github.com/One-Language/One/blob/master/test/lexer.test.c#L82

for example:

lexer_tests[lexer_tests_count++] = (LexerTest){"1\r\n    2\n3\n4", {token_make(TOKEN_VALUE_NUMBER), token_make(TOKEN_SKIP_WHITESPACE_LINE), token_make(TOKEN_VALUE_NUMBER), token_make(TOKEN_SKIP_WHITESPACE_LINE), token_make(TOKEN_VALUE_NUMBER), token_make(TOKEN_SKIP_WHITESPACE_LINE), token_make(TOKEN_VALUE_NUMBER), token_make(TOKEN_EOF)}, 7};

This is VERY BAD and not readable, we want some better syntax format.

This is much better:

lexer_tests[lexer_tests_count++] = (LexerTest){"1\r\n    2\n3\n4", {
	token_make(TOKEN_VALUE_NUMBER),
	token_make(TOKEN_SKIP_WHITESPACE_LINE),
	token_make(TOKEN_VALUE_NUMBER),
	token_make(TOKEN_SKIP_WHITESPACE_LINE),
	token_make(TOKEN_VALUE_NUMBER),
	token_make(TOKEN_SKIP_WHITESPACE_LINE),
	token_make(TOKEN_VALUE_NUMBER),
	token_make(TOKEN_EOF)
}, 7};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions