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

Conversation

munificent
Copy link
Member

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.

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.
This also brings in InfixPiece which will be used for other infix
operators and infix-like constructs.
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.
Base automatically changed from format-configurations to main September 14, 2023 22:41
# 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 munificent merged commit cf8aef9 into main Sep 15, 2023
7 checks passed
@munificent munificent deleted the format-binary branch September 15, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants