Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format binary expressions with the new back-end. #1267

Merged
merged 4 commits into from
Sep 15, 2023
Merged

Commits on Sep 12, 2023

  1. Start building the new Piece internal representation and new style.

    This gets the foundation in place for the new IR, the new visitor that
    produces it, the new line splitter that consumes it, the new style, and
    new tests for it.
    
    It also adds support for formatting library, import, and export
    directives to make sure everything is wired up together and working.
    
    Existing formatting behavior is unchanged. You have to opt in to the
    new stuff by passing "tall-style" as an experiment flag.
    
    This PR doesn't support comments, but it does leave some unused code
    in a few places that will be used to handle comments in future PRs.
    
    It has many UnimplementedError throws. Those will get filled in as more
    of the language is implemented in the new style.
    
    There are also two new kinds of TODO comments:
    
      TODO(tall): ...
    
    These comments describe that work that needs to be done before the new
    style is fully working.
    
      TODO(perf): ...
    
    These describe potential areas for optimization. Once more of the
    language is supported with the new IR and I can run some larger
    benchmark samples through it, I can start exploring where the actual
    performance problems are. For now, I'm just leaving breadcrumbs.
    munificent committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    1f7a188 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2023

  1. Format configurations in imports and exports.

    This also brings in InfixPiece which will be used for other infix
    operators and infix-like constructs.
    munificent committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    baaa940 View commit details
    Browse the repository at this point in the history
  2. Format binary expressions with the new back-end.

    This includes all arithmetic, logic, comparison, relational, type test,
    and bitwise operators.
    
    It doesn't include assignment operators, because those are right
    associative and need some special handling for how the RHS is indented.
    munificent committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    6b9b05c View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2023

  1. Merge branch 'main' into format-binary

    # Conflicts:
    #	example/format.dart
    #	lib/src/back_end/code_writer.dart
    #	lib/src/back_end/solution.dart
    #	lib/src/back_end/solver.dart
    #	lib/src/dart_formatter.dart
    #	lib/src/front_end/ast_node_visitor.dart
    #	lib/src/front_end/piece_factory.dart
    #	lib/src/front_end/piece_writer.dart
    #	lib/src/piece/import.dart
    #	lib/src/piece/piece.dart
    #	test/tall_format_test.dart
    #	test/utils.dart
    munificent committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    4c547e8 View commit details
    Browse the repository at this point in the history