Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4b12f700
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4b12f700
编写于
8月 22, 2018
作者:
V
varkor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove Node* prefix from AnnNode
上级
befc4b11
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
65 addition
and
69 deletion
+65
-69
src/librustc/hir/print.rs
src/librustc/hir/print.rs
+19
-21
src/librustc_borrowck/dataflow.rs
src/librustc_borrowck/dataflow.rs
+6
-6
src/librustc_driver/pretty.rs
src/librustc_driver/pretty.rs
+19
-19
src/libsyntax/print/pprust.rs
src/libsyntax/print/pprust.rs
+21
-23
未找到文件。
src/librustc/hir/print.rs
浏览文件 @
4b12f700
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub
use
self
::
AnnNode
::
*
;
use
rustc_target
::
spec
::
abi
::
Abi
;
use
syntax
::
ast
;
use
syntax
::
source_map
::{
SourceMap
,
Spanned
};
...
...
@@ -33,12 +31,12 @@
use
std
::
vec
;
pub
enum
AnnNode
<
'a
>
{
N
odeN
ame
(
&
'a
ast
::
Name
),
Node
Block
(
&
'a
hir
::
Block
),
Node
Item
(
&
'a
hir
::
Item
),
Node
SubItem
(
ast
::
NodeId
),
Node
Expr
(
&
'a
hir
::
Expr
),
Node
Pat
(
&
'a
hir
::
Pat
),
Name
(
&
'a
ast
::
Name
),
Block
(
&
'a
hir
::
Block
),
Item
(
&
'a
hir
::
Item
),
SubItem
(
ast
::
NodeId
),
Expr
(
&
'a
hir
::
Expr
),
Pat
(
&
'a
hir
::
Pat
),
}
pub
enum
Nested
{
...
...
@@ -529,7 +527,7 @@ pub fn print_item(&mut self, item: &hir::Item) -> io::Result<()> {
self
.hardbreak_if_not_bol
()
?
;
self
.maybe_print_comment
(
item
.span
.lo
())
?
;
self
.print_outer_attributes
(
&
item
.attrs
)
?
;
self
.ann
.pre
(
self
,
Node
Item
(
item
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
Item
(
item
))
?
;
match
item
.node
{
hir
::
ItemKind
::
ExternCrate
(
orig_name
)
=>
{
self
.head
(
&
visibility_qualified
(
&
item
.vis
,
"extern crate"
))
?
;
...
...
@@ -768,7 +766,7 @@ pub fn print_item(&mut self, item: &hir::Item) -> io::Result<()> {
self
.s
.word
(
";"
)
?
;
}
}
self
.ann
.post
(
self
,
Node
Item
(
item
))
self
.ann
.post
(
self
,
AnnNode
::
Item
(
item
))
}
pub
fn
print_trait_ref
(
&
mut
self
,
t
:
&
hir
::
TraitRef
)
->
io
::
Result
<
()
>
{
...
...
@@ -933,7 +931,7 @@ pub fn print_method_sig(&mut self,
}
pub
fn
print_trait_item
(
&
mut
self
,
ti
:
&
hir
::
TraitItem
)
->
io
::
Result
<
()
>
{
self
.ann
.pre
(
self
,
Node
SubItem
(
ti
.id
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
SubItem
(
ti
.id
))
?
;
self
.hardbreak_if_not_bol
()
?
;
self
.maybe_print_comment
(
ti
.span
.lo
())
?
;
self
.print_outer_attributes
(
&
ti
.attrs
)
?
;
...
...
@@ -965,11 +963,11 @@ pub fn print_trait_item(&mut self, ti: &hir::TraitItem) -> io::Result<()> {
default
.as_ref
()
.map
(|
ty
|
&**
ty
))
?
;
}
}
self
.ann
.post
(
self
,
Node
SubItem
(
ti
.id
))
self
.ann
.post
(
self
,
AnnNode
::
SubItem
(
ti
.id
))
}
pub
fn
print_impl_item
(
&
mut
self
,
ii
:
&
hir
::
ImplItem
)
->
io
::
Result
<
()
>
{
self
.ann
.pre
(
self
,
Node
SubItem
(
ii
.id
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
SubItem
(
ii
.id
))
?
;
self
.hardbreak_if_not_bol
()
?
;
self
.maybe_print_comment
(
ii
.span
.lo
())
?
;
self
.print_outer_attributes
(
&
ii
.attrs
)
?
;
...
...
@@ -995,7 +993,7 @@ pub fn print_impl_item(&mut self, ii: &hir::ImplItem) -> io::Result<()> {
self
.print_associated_type
(
ii
.ident
,
Some
(
bounds
),
None
)
?
;
}
}
self
.ann
.post
(
self
,
Node
SubItem
(
ii
.id
))
self
.ann
.post
(
self
,
AnnNode
::
SubItem
(
ii
.id
))
}
pub
fn
print_stmt
(
&
mut
self
,
st
:
&
hir
::
Stmt
)
->
io
::
Result
<
()
>
{
...
...
@@ -1055,7 +1053,7 @@ pub fn print_block_maybe_unclosed(&mut self,
hir
::
DefaultBlock
=>
(),
}
self
.maybe_print_comment
(
blk
.span
.lo
())
?
;
self
.ann
.pre
(
self
,
Node
Block
(
blk
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
Block
(
blk
))
?
;
self
.bopen
()
?
;
self
.print_inner_attributes
(
attrs
)
?
;
...
...
@@ -1072,7 +1070,7 @@ pub fn print_block_maybe_unclosed(&mut self,
_
=>
(),
}
self
.bclose_maybe_open
(
blk
.span
,
indented
,
close_box
)
?
;
self
.ann
.post
(
self
,
Node
Block
(
blk
))
self
.ann
.post
(
self
,
AnnNode
::
Block
(
blk
))
}
fn
print_else
(
&
mut
self
,
els
:
Option
<&
hir
::
Expr
>
)
->
io
::
Result
<
()
>
{
...
...
@@ -1321,7 +1319,7 @@ pub fn print_expr(&mut self, expr: &hir::Expr) -> io::Result<()> {
self
.maybe_print_comment
(
expr
.span
.lo
())
?
;
self
.print_outer_attributes
(
&
expr
.attrs
)
?
;
self
.ibox
(
indent_unit
)
?
;
self
.ann
.pre
(
self
,
Node
Expr
(
expr
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
Expr
(
expr
))
?
;
match
expr
.node
{
hir
::
ExprKind
::
Box
(
ref
expr
)
=>
{
self
.word_space
(
"box"
)
?
;
...
...
@@ -1559,7 +1557,7 @@ pub fn print_expr(&mut self, expr: &hir::Expr) -> io::Result<()> {
self
.print_expr_maybe_paren
(
&
expr
,
parser
::
PREC_JUMP
)
?
;
}
}
self
.ann
.post
(
self
,
Node
Expr
(
expr
))
?
;
self
.ann
.post
(
self
,
AnnNode
::
Expr
(
expr
))
?
;
self
.end
()
}
...
...
@@ -1606,7 +1604,7 @@ pub fn print_ident(&mut self, ident: ast::Ident) -> io::Result<()> {
}
else
{
self
.s
.word
(
&
ident
.as_str
())
?
;
}
self
.ann
.post
(
self
,
Node
Name
(
&
ident
.name
))
self
.ann
.post
(
self
,
AnnNode
::
Name
(
&
ident
.name
))
}
pub
fn
print_name
(
&
mut
self
,
name
:
ast
::
Name
)
->
io
::
Result
<
()
>
{
...
...
@@ -1774,7 +1772,7 @@ fn print_generic_args(&mut self,
pub
fn
print_pat
(
&
mut
self
,
pat
:
&
hir
::
Pat
)
->
io
::
Result
<
()
>
{
self
.maybe_print_comment
(
pat
.span
.lo
())
?
;
self
.ann
.pre
(
self
,
Node
Pat
(
pat
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
Pat
(
pat
))
?
;
// Pat isn't normalized, but the beauty of it
// is that it doesn't matter
match
pat
.node
{
...
...
@@ -1928,7 +1926,7 @@ pub fn print_pat(&mut self, pat: &hir::Pat) -> io::Result<()> {
self
.s
.word
(
"]"
)
?
;
}
}
self
.ann
.post
(
self
,
Node
Pat
(
pat
))
self
.ann
.post
(
self
,
AnnNode
::
Pat
(
pat
))
}
fn
print_arm
(
&
mut
self
,
arm
:
&
hir
::
Arm
)
->
io
::
Result
<
()
>
{
...
...
src/librustc_borrowck/dataflow.rs
浏览文件 @
4b12f700
...
...
@@ -117,12 +117,12 @@ fn pre(&self,
ps
:
&
mut
pprust
::
State
,
node
:
pprust
::
AnnNode
)
->
io
::
Result
<
()
>
{
let
id
=
match
node
{
pprust
::
Node
Name
(
_
)
=>
return
Ok
(()),
pprust
::
Node
Expr
(
expr
)
=>
expr
.hir_id.local_id
,
pprust
::
Node
Block
(
blk
)
=>
blk
.hir_id.local_id
,
pprust
::
Node
Item
(
_
)
|
pprust
::
Node
SubItem
(
_
)
=>
return
Ok
(()),
pprust
::
Node
Pat
(
pat
)
=>
pat
.hir_id.local_id
pprust
::
AnnNode
::
Name
(
_
)
=>
return
Ok
(()),
pprust
::
AnnNode
::
Expr
(
expr
)
=>
expr
.hir_id.local_id
,
pprust
::
AnnNode
::
Block
(
blk
)
=>
blk
.hir_id.local_id
,
pprust
::
AnnNode
::
Item
(
_
)
|
pprust
::
AnnNode
::
SubItem
(
_
)
=>
return
Ok
(()),
pprust
::
AnnNode
::
Pat
(
pat
)
=>
pat
.hir_id.local_id
};
if
!
self
.has_bitset_for_local_id
(
id
)
{
...
...
src/librustc_driver/pretty.rs
浏览文件 @
4b12f700
...
...
@@ -355,33 +355,33 @@ fn pp_ann<'a>(&'a self) -> &'a dyn pprust::PpAnn {
impl
<
'hir
>
pprust
::
PpAnn
for
IdentifiedAnnotation
<
'hir
>
{
fn
pre
(
&
self
,
s
:
&
mut
pprust
::
State
,
node
:
pprust
::
AnnNode
)
->
io
::
Result
<
()
>
{
match
node
{
pprust
::
Node
Expr
(
_
)
=>
s
.popen
(),
pprust
::
AnnNode
::
Expr
(
_
)
=>
s
.popen
(),
_
=>
Ok
(()),
}
}
fn
post
(
&
self
,
s
:
&
mut
pprust
::
State
,
node
:
pprust
::
AnnNode
)
->
io
::
Result
<
()
>
{
match
node
{
pprust
::
Node
Ident
(
_
)
|
pprust
::
Node
Name
(
_
)
=>
Ok
(()),
pprust
::
AnnNode
::
Ident
(
_
)
|
pprust
::
AnnNode
::
Name
(
_
)
=>
Ok
(()),
pprust
::
Node
Item
(
item
)
=>
{
pprust
::
AnnNode
::
Item
(
item
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
item
.id
.to_string
())
}
pprust
::
Node
SubItem
(
id
)
=>
{
pprust
::
AnnNode
::
SubItem
(
id
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
id
.to_string
())
}
pprust
::
Node
Block
(
blk
)
=>
{
pprust
::
AnnNode
::
Block
(
blk
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
format!
(
"block {}"
,
blk
.id
))
}
pprust
::
Node
Expr
(
expr
)
=>
{
pprust
::
AnnNode
::
Expr
(
expr
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
expr
.id
.to_string
())
?
;
s
.pclose
()
}
pprust
::
Node
Pat
(
pat
)
=>
{
pprust
::
AnnNode
::
Pat
(
pat
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
format!
(
"pat {}"
,
pat
.id
))
}
...
...
@@ -414,34 +414,34 @@ fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
}
fn
pre
(
&
self
,
s
:
&
mut
pprust_hir
::
State
,
node
:
pprust_hir
::
AnnNode
)
->
io
::
Result
<
()
>
{
match
node
{
pprust_hir
::
Node
Expr
(
_
)
=>
s
.popen
(),
pprust_hir
::
AnnNode
::
Expr
(
_
)
=>
s
.popen
(),
_
=>
Ok
(()),
}
}
fn
post
(
&
self
,
s
:
&
mut
pprust_hir
::
State
,
node
:
pprust_hir
::
AnnNode
)
->
io
::
Result
<
()
>
{
match
node
{
pprust_hir
::
Node
Name
(
_
)
=>
Ok
(()),
pprust_hir
::
Node
Item
(
item
)
=>
{
pprust_hir
::
AnnNode
::
Name
(
_
)
=>
Ok
(()),
pprust_hir
::
AnnNode
::
Item
(
item
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
format!
(
"node_id: {} hir local_id: {}"
,
item
.id
,
item
.hir_id.local_id
.0
))
}
pprust_hir
::
Node
SubItem
(
id
)
=>
{
pprust_hir
::
AnnNode
::
SubItem
(
id
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
id
.to_string
())
}
pprust_hir
::
Node
Block
(
blk
)
=>
{
pprust_hir
::
AnnNode
::
Block
(
blk
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
format!
(
"block node_id: {} hir local_id: {}"
,
blk
.id
,
blk
.hir_id.local_id
.0
))
}
pprust_hir
::
Node
Expr
(
expr
)
=>
{
pprust_hir
::
AnnNode
::
Expr
(
expr
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
format!
(
"node_id: {} hir local_id: {}"
,
expr
.id
,
expr
.hir_id.local_id
.0
))
?
;
s
.pclose
()
}
pprust_hir
::
Node
Pat
(
pat
)
=>
{
pprust_hir
::
AnnNode
::
Pat
(
pat
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
format!
(
"pat node_id: {} hir local_id: {}"
,
pat
.id
,
pat
.hir_id.local_id
.0
))
...
...
@@ -467,13 +467,13 @@ fn pp_ann(&self) -> &dyn pprust::PpAnn {
impl
<
'a
>
pprust
::
PpAnn
for
HygieneAnnotation
<
'a
>
{
fn
post
(
&
self
,
s
:
&
mut
pprust
::
State
,
node
:
pprust
::
AnnNode
)
->
io
::
Result
<
()
>
{
match
node
{
pprust
::
Node
Ident
(
&
ast
::
Ident
{
name
,
span
})
=>
{
pprust
::
AnnNode
::
Ident
(
&
ast
::
Ident
{
name
,
span
})
=>
{
s
.s
.space
()
?
;
// FIXME #16420: this doesn't display the connections
// between syntax contexts
s
.synth_comment
(
format!
(
"{}{:?}"
,
name
.as_u32
(),
span
.ctxt
()))
}
pprust
::
Node
Name
(
&
name
)
=>
{
pprust
::
AnnNode
::
Name
(
&
name
)
=>
{
s
.s
.space
()
?
;
s
.synth_comment
(
name
.as_u32
()
.to_string
())
}
...
...
@@ -519,13 +519,13 @@ fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
}
fn
pre
(
&
self
,
s
:
&
mut
pprust_hir
::
State
,
node
:
pprust_hir
::
AnnNode
)
->
io
::
Result
<
()
>
{
match
node
{
pprust_hir
::
Node
Expr
(
_
)
=>
s
.popen
(),
pprust_hir
::
AnnNode
::
Expr
(
_
)
=>
s
.popen
(),
_
=>
Ok
(()),
}
}
fn
post
(
&
self
,
s
:
&
mut
pprust_hir
::
State
,
node
:
pprust_hir
::
AnnNode
)
->
io
::
Result
<
()
>
{
match
node
{
pprust_hir
::
Node
Expr
(
expr
)
=>
{
pprust_hir
::
AnnNode
::
Expr
(
expr
)
=>
{
s
.s
.space
()
?
;
s
.s
.word
(
"as"
)
?
;
s
.s
.space
()
?
;
...
...
src/libsyntax/print/pprust.rs
浏览文件 @
4b12f700
...
...
@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub
use
self
::
AnnNode
::
*
;
use
rustc_target
::
spec
::
abi
::{
self
,
Abi
};
use
ast
::{
self
,
BlockCheckMode
,
PatKind
,
RangeEnd
,
RangeSyntax
};
use
ast
::{
SelfKind
,
GenericBound
,
TraitBoundModifier
};
...
...
@@ -36,13 +34,13 @@
use
std
::
vec
;
pub
enum
AnnNode
<
'a
>
{
Node
Ident
(
&
'a
ast
::
Ident
),
N
odeN
ame
(
&
'a
ast
::
Name
),
Node
Block
(
&
'a
ast
::
Block
),
Node
Item
(
&
'a
ast
::
Item
),
Node
SubItem
(
ast
::
NodeId
),
Node
Expr
(
&
'a
ast
::
Expr
),
Node
Pat
(
&
'a
ast
::
Pat
),
Ident
(
&
'a
ast
::
Ident
),
Name
(
&
'a
ast
::
Name
),
Block
(
&
'a
ast
::
Block
),
Item
(
&
'a
ast
::
Item
),
SubItem
(
ast
::
NodeId
),
Expr
(
&
'a
ast
::
Expr
),
Pat
(
&
'a
ast
::
Pat
),
}
pub
trait
PpAnn
{
...
...
@@ -1196,7 +1194,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
self
.hardbreak_if_not_bol
()
?
;
self
.maybe_print_comment
(
item
.span
.lo
())
?
;
self
.print_outer_attributes
(
&
item
.attrs
)
?
;
self
.ann
.pre
(
self
,
Node
Item
(
item
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
Item
(
item
))
?
;
match
item
.node
{
ast
::
ItemKind
::
ExternCrate
(
orig_name
)
=>
{
self
.head
(
&
visibility_qualified
(
&
item
.vis
,
"extern crate"
))
?
;
...
...
@@ -1439,7 +1437,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
self
.end
()
?
;
}
}
self
.ann
.post
(
self
,
Node
Item
(
item
))
self
.ann
.post
(
self
,
AnnNode
::
Item
(
item
))
}
fn
print_trait_ref
(
&
mut
self
,
t
:
&
ast
::
TraitRef
)
->
io
::
Result
<
()
>
{
...
...
@@ -1596,7 +1594,7 @@ pub fn print_method_sig(&mut self,
pub
fn
print_trait_item
(
&
mut
self
,
ti
:
&
ast
::
TraitItem
)
->
io
::
Result
<
()
>
{
self
.ann
.pre
(
self
,
Node
SubItem
(
ti
.id
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
SubItem
(
ti
.id
))
?
;
self
.hardbreak_if_not_bol
()
?
;
self
.maybe_print_comment
(
ti
.span
.lo
())
?
;
self
.print_outer_attributes
(
&
ti
.attrs
)
?
;
...
...
@@ -1638,11 +1636,11 @@ pub fn print_trait_item(&mut self, ti: &ast::TraitItem)
}
}
}
self
.ann
.post
(
self
,
Node
SubItem
(
ti
.id
))
self
.ann
.post
(
self
,
AnnNode
::
SubItem
(
ti
.id
))
}
pub
fn
print_impl_item
(
&
mut
self
,
ii
:
&
ast
::
ImplItem
)
->
io
::
Result
<
()
>
{
self
.ann
.pre
(
self
,
Node
SubItem
(
ii
.id
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
SubItem
(
ii
.id
))
?
;
self
.hardbreak_if_not_bol
()
?
;
self
.maybe_print_comment
(
ii
.span
.lo
())
?
;
self
.print_outer_attributes
(
&
ii
.attrs
)
?
;
...
...
@@ -1672,7 +1670,7 @@ pub fn print_impl_item(&mut self, ii: &ast::ImplItem) -> io::Result<()> {
}
}
}
self
.ann
.post
(
self
,
Node
SubItem
(
ii
.id
))
self
.ann
.post
(
self
,
AnnNode
::
SubItem
(
ii
.id
))
}
pub
fn
print_stmt
(
&
mut
self
,
st
:
&
ast
::
Stmt
)
->
io
::
Result
<
()
>
{
...
...
@@ -1756,7 +1754,7 @@ pub fn print_block_maybe_unclosed(&mut self,
BlockCheckMode
::
Default
=>
()
}
self
.maybe_print_comment
(
blk
.span
.lo
())
?
;
self
.ann
.pre
(
self
,
Node
Block
(
blk
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
Block
(
blk
))
?
;
self
.bopen
()
?
;
self
.print_inner_attributes
(
attrs
)
?
;
...
...
@@ -1774,7 +1772,7 @@ pub fn print_block_maybe_unclosed(&mut self,
}
self
.bclose_maybe_open
(
blk
.span
,
indented
,
close_box
)
?
;
self
.ann
.post
(
self
,
Node
Block
(
blk
))
self
.ann
.post
(
self
,
AnnNode
::
Block
(
blk
))
}
fn
print_else
(
&
mut
self
,
els
:
Option
<&
ast
::
Expr
>
)
->
io
::
Result
<
()
>
{
...
...
@@ -2065,7 +2063,7 @@ fn print_expr_outer_attr_style(&mut self,
}
self
.ibox
(
INDENT_UNIT
)
?
;
self
.ann
.pre
(
self
,
Node
Expr
(
expr
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
Expr
(
expr
))
?
;
match
expr
.node
{
ast
::
ExprKind
::
Box
(
ref
expr
)
=>
{
self
.word_space
(
"box"
)
?
;
...
...
@@ -2385,7 +2383,7 @@ fn print_expr_outer_attr_style(&mut self,
self
.print_block_with_attrs
(
blk
,
attrs
)
?
}
}
self
.ann
.post
(
self
,
Node
Expr
(
expr
))
?
;
self
.ann
.post
(
self
,
AnnNode
::
Expr
(
expr
))
?
;
self
.end
()
}
...
...
@@ -2404,7 +2402,7 @@ pub fn print_ident(&mut self, ident: ast::Ident) -> io::Result<()> {
}
else
{
self
.s
.word
(
&
ident
.as_str
())
?
;
}
self
.ann
.post
(
self
,
Node
Ident
(
&
ident
))
self
.ann
.post
(
self
,
AnnNode
::
Ident
(
&
ident
))
}
pub
fn
print_usize
(
&
mut
self
,
i
:
usize
)
->
io
::
Result
<
()
>
{
...
...
@@ -2413,7 +2411,7 @@ pub fn print_usize(&mut self, i: usize) -> io::Result<()> {
pub
fn
print_name
(
&
mut
self
,
name
:
ast
::
Name
)
->
io
::
Result
<
()
>
{
self
.s
.word
(
&
name
.as_str
())
?
;
self
.ann
.post
(
self
,
Node
Name
(
&
name
))
self
.ann
.post
(
self
,
AnnNode
::
Name
(
&
name
))
}
pub
fn
print_for_decl
(
&
mut
self
,
loc
:
&
ast
::
Local
,
...
...
@@ -2537,7 +2535,7 @@ fn print_generic_args(&mut self,
pub
fn
print_pat
(
&
mut
self
,
pat
:
&
ast
::
Pat
)
->
io
::
Result
<
()
>
{
self
.maybe_print_comment
(
pat
.span
.lo
())
?
;
self
.ann
.pre
(
self
,
Node
Pat
(
pat
))
?
;
self
.ann
.pre
(
self
,
AnnNode
::
Pat
(
pat
))
?
;
/* Pat isn't normalized, but the beauty of it
is that it doesn't matter */
match
pat
.node
{
...
...
@@ -2675,7 +2673,7 @@ pub fn print_pat(&mut self, pat: &ast::Pat) -> io::Result<()> {
}
PatKind
::
Mac
(
ref
m
)
=>
self
.print_mac
(
m
)
?
,
}
self
.ann
.post
(
self
,
Node
Pat
(
pat
))
self
.ann
.post
(
self
,
AnnNode
::
Pat
(
pat
))
}
fn
print_pats
(
&
mut
self
,
pats
:
&
[
P
<
ast
::
Pat
>
])
->
io
::
Result
<
()
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录