]> git.lizzy.rs Git - rust.git/commit
Format lazy_static! macro
authortopecongiro <seuchida@gmail.com>
Fri, 23 Feb 2018 16:05:19 +0000 (01:05 +0900)
committertopecongiro <seuchida@gmail.com>
Fri, 23 Feb 2018 16:05:19 +0000 (01:05 +0900)
commitf310b924ea6a26d6122ffe96b9d36327aa542be7
tree31d89efcf1030d0c9ef23f42a62203f202d6eda0
parentebfc3af92a33b2eeed543a55fbf4929946fbe3a2
Format lazy_static! macro

Some macros like `lazy_static!` cannot be parsed as a valid AST. Therefore, we
need to parse them manually to be able to format them. Obviously this method
will not scale, we will never be able to cover every macro in the entire
ecosystem. That being said, I think it will not hurt to be able to format macros
that are popular (such as `lazy_static!`) as long as rustfmt will not produce
broken code when the macro has syntax that is not expected.
rustfmt-core/src/macros.rs