summaryrefslogtreecommitdiff
path: root/usr.bin/indent
AgeCommit message (Collapse)Author
2023-06-27indent: fix 'blank line above first statement in function body'rillig
2023-06-26indent: improve heuristics for '*' as pointer in for loopsrillig
2023-06-26indent: improve heuristics for '*' as a pointer typerillig
2023-06-26indent: implement 'blank line above first statement in function body'rillig
2023-06-26indent: in -bad mode, don't add a blank line above a comment or '}'rillig
2023-06-26indent: clean up indentationrillig
2023-06-25indent: move cast detection from the lexer to the main processorrillig
It is not the job of the lexer to modify the parser state.
2023-06-25indent: treat 'complex' and 'imaginary' as type modifiers, not as typesrillig
2023-06-25indent: fix formatting of parenthesized name in function definitionrillig
2023-06-25indent: don't use strspn on inp_p, as it is not null-terminatedrillig
No functional change.
2023-06-23indent: fix scanning of no-wrap comments (since 2021.11.07.10.34.03)rillig
The "refactoring" back then tried to be too clever.
2023-06-23indent: properly store parser state in debug moderillig
The stacks in the parser state are allocated now and need to be copied individually. The test whether two paren stacks are equal was broken since 2023-06-14 14:11:28.
2023-06-18indent: only add blank lines before actual block commentsrillig
2023-06-18indent: remove support for backspace in code and commentsrillig
The C code in the whole tree does not contain a single literal backspace.
2023-06-18indent: untangle code for handling the statement indentationrillig
The expression 'psyms.level-- - 2' did too much in a single line, so extract the '--' to a separate statement, to highlight the symmetry between the 'sym' and 'ind_level' code. No functional change.
2023-06-17indent: clean uprillig
Extract duplicate code for handling line continuations. Prevent theoretic undefined behavior in strspn, as inp.s is not null-terminated. Remove adding extra space characters when processing comments, as these are not necessary to force a line of output. No functional change.
2023-06-17indent: miscellaneous cleanupsrillig
No binary change.
2023-06-16indent: merge lexer symbols for type in/outside parenthesesrillig
2023-06-16indent: add debug output for typedef declarationsrillig
2023-06-16indent: fix spacing between postfix operator and left parenthesisrillig
2023-06-16indent: improve heuristics for cast expressionsrillig
2023-06-16indent: improve heuristics for cast expressionsrillig
2023-06-16indent: improve heuristics for castsrillig
2023-06-16indent: fix indentation and linebreaks in typedef declarationsrillig
2023-06-16indent: don't force a blank line between '}' and preprocessing linerillig
2023-06-16indent: rename a field of the parser staterillig
The previous name 'comment_in_first_line' was misleading, as it could mean that there was a comment in the first line of the file. No functional change.
2023-06-15indent: consolidate handling of statement continuationsrillig
2023-06-15indent: rename state variable to be more accuraterillig
No binary change.
2023-06-15indent: fix indentation of multi-line enum constant initializersrillig
2023-06-15indent: miscellaneous cleanups, more tests for edge casesrillig
2023-06-15indent: fix alignment of multi-line declarationsrillig
2023-06-14indent: reduce number of relocationsrillig
Since all command line options modify a member of struct options, there is no need to encode that relocation 38 times. No functional change.
2023-06-14indent: clean up the code, add a few testsrillig
2023-06-14indent: allow more than 128 brace levelsrillig
2023-06-14indent: fix out-of-bounds read when reducing a statementrillig
Since parse.c 1.73 from today. The parser symbol psym_stmt_list that was removed in that commit acted as a stop symbol, so that psyms_reduce_stmt would save a memory access.
2023-06-14indent: clean up array indexing for parser symbolsrillig
With 'top' pointing to the actual top element, the array was indexed in the closed range from 0 to top. All other arrays are indexed by the usual half-open interval from 0 to len. No functional change.
2023-06-14indent: allow more than 20 nested parentheses or bracketsrillig
2023-06-14indent: merge duplicate coderillig
2023-06-14indent: fix formatting of comment after 'switch (expr)'rillig
2023-06-14indent: use correct preprocessing directive in error messagerillig
2023-06-14indent: allow more than 5 levels of #if/#endifrillig
2023-06-14indent: clean up debugging coderillig
2023-06-14indent: clean up handling of commentsrillig
One less moving part in the parser state. No functional change.
2023-06-14indent: remove another flag from parser staterillig
When processing a comment, the flag ps.next_col_1 was not used for the next token, but for a line within a comment. As its scope was limited to a single comment, there is no need to store it any longer than that No functional change.
2023-06-14indent: remove a redundant flag from the parser staterillig
No functional change.
2023-06-14indent: merge parser symbols for stmt and stmt_listrillig
They were handled in exactly the same way.
2023-06-10indent: rename misleading variablerillig
The name started with 'line_start', but the value is not always the value from the beginning of the line. No functional change.
2023-06-10indent: fix debug outputrillig
When the parser state was first printed, there were unintended diff markers. Treat the previous lexer symbol like the other parts of the parser state, as omitting it from the diff output is confusing.
2023-06-10indent: fix line break between semicolon and bracerillig
2023-06-10indent: fix stack overflow, add more testsrillig
For several parser symbols, 2 symbols are pushed in a row, which led to an out-of-bounds write.