Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
9814e588
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
9814e588
编写于
11月 19, 2012
作者:
P
Paul Stansifer
提交者:
Graydon Hoare
11月 29, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
No longer parse the delimiters of the RHS of a macro as part of the expansion.
上级
ba354b17
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
28 addition
and
21 deletion
+28
-21
src/libcore/hash.rs
src/libcore/hash.rs
+2
-2
src/libcore/pipes.rs
src/libcore/pipes.rs
+1
-1
src/libcore/task/spawn.rs
src/libcore/task/spawn.rs
+1
-1
src/librustc/middle/trans/alt.rs
src/librustc/middle/trans/alt.rs
+2
-2
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/ext/tt/macro_rules.rs
+10
-3
src/libsyntax/parse/parser.rs
src/libsyntax/parse/parser.rs
+12
-12
未找到文件。
src/libcore/hash.rs
浏览文件 @
9814e588
...
...
@@ -203,14 +203,14 @@ fn write(msg: &[const u8]) {
macro_rules!
compress
(
(
$v0:expr
,
$v1:expr
,
$v2:expr
,
$v3:expr
)
=>
{
(
{
$v0
+=
$v1
;
$v1
=
rotl!
(
$v1
,
13
);
$v1
^=
$v0
;
$v0
=
rotl!
(
$v0
,
32
);
$v2
+=
$v3
;
$v3
=
rotl!
(
$v3
,
16
);
$v3
^=
$v2
;
$v0
+=
$v3
;
$v3
=
rotl!
(
$v3
,
21
);
$v3
^=
$v0
;
$v2
+=
$v1
;
$v1
=
rotl!
(
$v1
,
17
);
$v1
^=
$v2
;
$v2
=
rotl!
(
$v2
,
32
);
}
}
)
);
let
length
=
msg
.len
();
...
...
src/libcore/pipes.rs
浏览文件 @
9814e588
...
...
@@ -86,7 +86,7 @@
const
SPIN_COUNT
:
uint
=
0
;
macro_rules!
move_it
(
{
$x:expr
}
=>
{
unsafe
{
let
y
=
move
*
ptr
::
addr_of
(
&
(
$x
));
move
y
}
}
{
$x:expr
}
=>
(
unsafe
{
let
y
=
move
*
ptr
::
addr_of
(
&
(
$x
));
move
y
}
)
)
#[doc(hidden)]
...
...
src/libcore/task/spawn.rs
浏览文件 @
9814e588
...
...
@@ -67,7 +67,7 @@
use
rt
::
rust_closure
;
macro_rules!
move_it
(
{
$x:expr
}
=>
{
unsafe
{
let
y
=
move
*
ptr
::
addr_of
(
&
(
$x
));
move
y
}
}
{
$x:expr
}
=>
(
unsafe
{
let
y
=
move
*
ptr
::
addr_of
(
&
(
$x
));
move
y
}
)
)
type
TaskSet
=
send_map
::
linear
::
LinearMap
<*
rust_task
,()
>
;
...
...
src/librustc/middle/trans/alt.rs
浏览文件 @
9814e588
...
...
@@ -831,14 +831,14 @@ fn root_pats_as_necessary(bcx: block, m: &[@Match],
// matches should fit that sort of pattern or NONE (however, some of the
// matches may be wildcards like _ or identifiers).
macro_rules!
any_pat
(
(
$m:expr
,
$pattern:pat
)
=>
{
(
$m:expr
,
$pattern:pat
)
=>
(
vec
::
any
(
$m
,
|
br
|
{
match
br
.pats
[
col
]
.node
{
$pattern
=>
true
,
_
=>
false
}
})
}
)
)
fn
any_box_pat
(
m
:
&
[
@
Match
],
col
:
uint
)
->
bool
{
...
...
src/libsyntax/ext/tt/macro_rules.rs
浏览文件 @
9814e588
...
...
@@ -81,12 +81,19 @@ fn generic_extension(cx: ext_ctxt, sp: span, name: ident,
success
(
named_matches
)
=>
{
let
rhs
=
match
rhses
[
i
]
{
// okay, what's your transcriber?
@
matched_nonterminal
(
nt_tt
(
@
tt
))
=>
tt
,
@
matched_nonterminal
(
nt_tt
(
@
tt
))
=>
{
match
tt
{
// cut off delimiters; don't parse 'em
tt_delim
(
tts
)
=>
tts
.slice
(
1u
,
tts
.len
()
-
1u
),
_
=>
cx
.span_fatal
(
sp
,
~
"macro rhs must be delimited"
)
}
},
_
=>
cx
.span_bug
(
sp
,
~
"bad thing in rhs"
)
};
// rhs has holes ( `$id` and `$(...)` that need filled)
let
trncbr
=
new_tt_reader
(
s_d
,
itr
,
Some
(
named_matches
),
~
[
rhs
]
);
rhs
);
let
p
=
@
Parser
(
cx
.parse_sess
(),
cx
.cfg
(),
trncbr
as
reader
);
...
...
src/libsyntax/parse/parser.rs
浏览文件 @
9814e588
...
...
@@ -120,7 +120,7 @@ enum view_item_parse_mode {
The important thing is to make sure that lookahead doesn't balk
at INTERPOLATED tokens */
macro_rules!
maybe_whole_expr
(
(
$p:expr
)
=>
{
match
copy
$p
.token
{
(
$p:expr
)
=>
(
match
copy
$p
.token
{
INTERPOLATED
(
token
::
nt_expr
(
e
))
=>
{
$p
.bump
();
return
e
;
...
...
@@ -131,33 +131,33 @@ enum view_item_parse_mode {
expr_path
(
pt
));
}
_
=>
()
}
}
}
)
)
macro_rules!
maybe_whole
(
(
$p:expr
,
$constructor:ident
)
=>
{
match
copy
$p
.token
{
(
$p:expr
,
$constructor:ident
)
=>
(
match
copy
$p
.token
{
INTERPOLATED
(
token
::
$constructor
(
x
))
=>
{
$p
.bump
();
return
x
;
}
_
=>
()
}
}
;
(
deref
$p:expr
,
$constructor:ident
)
=>
{
match
copy
$p
.token
{
}
)
;
(
deref
$p:expr
,
$constructor:ident
)
=>
(
match
copy
$p
.token
{
INTERPOLATED
(
token
::
$constructor
(
x
))
=>
{
$p
.bump
();
return
*
x
;
}
_
=>
()
}
}
;
(
Some
$p:expr
,
$constructor:ident
)
=>
{
match
copy
$p
.token
{
}
)
;
(
Some
$p:expr
,
$constructor:ident
)
=>
(
match
copy
$p
.token
{
INTERPOLATED
(
token
::
$constructor
(
x
))
=>
{
$p
.bump
();
return
Some
(
x
);
}
_
=>
()
}
}
;
(
iovi
$p:expr
,
$constructor:ident
)
=>
{
match
copy
$p
.token
{
}
)
;
(
iovi
$p:expr
,
$constructor:ident
)
=>
(
match
copy
$p
.token
{
INTERPOLATED
(
token
::
$constructor
(
x
))
=>
{
$p
.bump
();
return
iovi_item
(
x
);
}
_
=>
()
}
}
;
(
pair_empty
$p:expr
,
$constructor:ident
)
=>
{
match
copy
$p
.token
{
}
)
;
(
pair_empty
$p:expr
,
$constructor:ident
)
=>
(
match
copy
$p
.token
{
INTERPOLATED
(
token
::
$constructor
(
x
))
=>
{
$p
.bump
();
return
(
~
[],
x
);
}
_
=>
()
}
}
}
)
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录