summaryrefslogtreecommitdiff
path: root/usr.bin/indent/debug.c
AgeCommit message (Collapse)Author
2023-06-27indent: fix 'blank line above first statement in function body'rillig
2023-06-26indent: implement 'blank line above first statement in function body'rillig
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-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: 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: rename state variable to be more accuraterillig
No binary change.
2023-06-14indent: clean up the code, add a few testsrillig
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: 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: miscellaneous cleanupsrillig
2023-06-10indent: clean up function names, fix blank lines in debug outputrillig
2023-06-10indent: distinguish blank lines from newline charactersrillig
2023-06-10indent: clean up debug outputrillig
In diff mode, don't print a diff of the very first parser state, instead print its full state. Don't print headings for empty sections of the parser state.
2023-06-10indent: clean up function and variable namesrillig
2023-06-10indent: explain right-aligned coderillig
2023-06-10indent: rename and sort variables in parser staterillig
No functional change.
2023-06-09indent: sync debug information for lexer symbolsrillig
2023-06-09indent: don't treat function call expressions as cast expressionsrillig
2023-06-09indent: when an indentation is ambiguous, indent one level furtherrillig
The '-eei' mode now applies whenever the indentation from a multi-line expression could be confused with a following statement.
2023-06-08indent: remove fragile heuristic for detecting cast expressionsrillig
The assumption that in an expression of the form '(a * anything)', the '*' marks a pointer type was too simple-minded. For now, fix the obvious cases and leave the others for later. If needed, they can be worked around using the '-T' option.
2023-06-07indent: extract the stack of parser symbols to a separate structrillig
No functional change.
2023-06-07indent: send all debug output to the same streamrillig
2023-06-06indent: sort functions in call orderrillig
No functional change.
2023-06-05indent: improve layout of debug outputrillig
2023-06-05indent: sync debug output with parser staterillig
2023-06-04indent: remove read pointer from buffers that don't need itrillig
The only buffer that needs a read pointer is the current input line in 'inp'. No functional change.
2023-06-04indent: track the kind of '{' on the parser stackrillig
2023-06-04indent: fix debug output of the parser symbol stackrillig
Even though the stack always contains a stmt_list as first element, print it nevertheless to avoid confusion about starting at index 1, and to provide the full picture.
2023-06-04indent: rename struct field, for better symmetryrillig
No binary change outside debug mode.
2023-06-04lint: use separate lexer symbols for 'case' and 'default'rillig
It's not strictly necessary since these tokens behave in the same way, still, the code is more straight-forward when there are separate tokens.
2023-06-04indent: classify 'inline' as a modifier rather than a wordrillig
2023-06-04indent: use separate lexer symbols for the different kinds of ':'rillig
2023-06-04indent: handle the indentation of 'case' in a simpler wayrillig
2023-06-04indent: separate code for handling parentheses and bracketsrillig
Handling parentheses is more complicated than for brackets.
2023-06-02indent: clean uprillig
Only print the 'token' buffer in debug mode if it is interesting, group the blocks in handling of '(' tokens by topic, remove obsolete comment from test.
2023-06-02indent: fix formatting of declarations with preprocessing linesrillig
2023-05-23indent: fix indentation of struct declarationsrillig
2023-05-23indent: split debug output into paragraphsrillig
The paragraphs separate the different processing steps: getting a token from the lexer, processing the token, updating the parser state, sending a finished line to the output.
2023-05-23indent: fix spacing in declarations in for loopsrillig