]> git.lizzy.rs Git - rust.git/commit
visitor: Handle specified line ranges in visit_stmt
authorKamal Marhubi <kamal@marhubi.com>
Sat, 12 Mar 2016 00:19:16 +0000 (19:19 -0500)
committerKamal Marhubi <kamal@marhubi.com>
Mon, 30 May 2016 23:33:11 +0000 (01:33 +0200)
commit9fa5a91fc50a5b7a7c2980e36e1bf63df3179500
tree93c220c34757b122f8ae888605af0b4a8b3d8524
parentc311b30cacf91e8bfc4b6fb586dc3ec843140e26
visitor: Handle specified line ranges in visit_stmt

This commit adds a very rough implementation of handling the specified
line ranges in `config.file_lines_map` for statements. It reformats a
statement if its span is fully contained in the set of lines specified
for the file.

The implementation here is intended as a proof of concept, and
demonstration that the machinery added in the preceding commits is
functional. A final implementation would likely hook in via the
`Rewrite` trait.

Refs #434
src/visitor.rs
tests/source/file-lines-1.rs [new file with mode: 0644]
tests/source/file-lines-2.rs [new file with mode: 0644]
tests/source/file-lines-3.rs [new file with mode: 0644]
tests/source/file-lines-4.rs [new file with mode: 0644]
tests/target/file-lines-1.rs [new file with mode: 0644]
tests/target/file-lines-2.rs [new file with mode: 0644]
tests/target/file-lines-3.rs [new file with mode: 0644]
tests/target/file-lines-4.rs [new file with mode: 0644]