Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] Refactor doc comment processing like a state machine
As suggested in https://dart-review.googlesource.com/c/sdk/+/317446. This introduces a new class CharacterSequence, an abstraction over the two different doc comment types, and the two remarkably different ways they need to be walked. One good example of the complexities is that a line starting with `// ` must be completely ignored when processing a single-line doc comment, but must not be ignored when processing the lines of a multi-line doc comment. Implementing the logic of the two styles in one body was too ugly and complex. This also fixes a bug in offsets, as can be seen in the ast_builder_test. Work towards #50702 Change-Id: Ife5f17a88268e5cda1ac89d4c14fa1f1cad1333f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321360 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
- Loading branch information