]> git.lizzy.rs Git - rust.git/commit
Split up `pretty_print` and `print`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 29 Nov 2018 02:58:58 +0000 (13:58 +1100)
committerNicholas Nethercote <nnethercote@mozilla.com>
Thu, 29 Nov 2018 06:14:57 +0000 (17:14 +1100)
commit64cd645d14407d312c7ed3a10efd9b3a99271884
tree7212ca102c08c5332d9ea59bd931525e442d32d4
parent787959c20d062d396b97a5566e0a766d963af022
Split up `pretty_print` and `print`.

`pretty_print` takes a `Token` and `match`es on it. But the particular
`Token` kind is known at each call site, so this commit splits it into
five functions: `pretty_print_eof`, `pretty_print_begin`, etc.

This commit also does likewise with `print`, though there is one
callsite for `print` where the `Token` kind isn't known, so a generic
`print` has to stay (but it now just calls out to the various `print_*`
functions).
src/libsyntax/print/pp.rs