Skip to content

Commit e65d034

Browse files
committed
---
yaml --- r: 28376 b: refs/heads/try c: e9f5a09 h: refs/heads/master v: v3
1 parent 42ccde0 commit e65d034

File tree

7 files changed

+27
-29
lines changed

7 files changed

+27
-29
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: 249668f22396bde43523207117b3869e63b49c4f
5+
refs/heads/try: e9f5a099dfcb42c7f2bb38974b57bbde7042ee9c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/src/libcore/dvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,13 @@ impl<A: copy> DVec<A> {
235235
}
236236
}
237237
238-
/*
239238
/**
240239
* Append all elements of an iterable.
241240
*
242241
* Failure will occur if the iterable's `each()` method
243242
* attempts to access this vector.
244243
*/
244+
/*
245245
fn append_iter<A, I:iter::base_iter<A>>(ts: I) {
246246
do self.swap |v| {
247247
let mut v = match ts.size_hint() {

branches/try/src/libsyntax/ext/expand.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ fn new_span(cx: ext_ctxt, sp: span) -> span {
243243
fn core_macros() -> ~str {
244244
return
245245
~"{
246+
macro_rules! ignore (($($x:tt)*) => (()))
246247
#macro[[#error[f, ...], log(core::error, #fmt[f, ...])]];
247248
#macro[[#warn[f, ...], log(core::warn, #fmt[f, ...])]];
248249
#macro[[#info[f, ...], log(core::info, #fmt[f, ...])]];

branches/try/src/libsyntax/parse/lexer.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,21 +267,16 @@ fn consume_block_comment(rdr: string_reader)
267267
sp: ast_util::mk_sp(start_chpos, rdr.chpos)
268268
});
269269
}
270-
}
271-
272-
let mut level: int = 1;
273-
while level > 0 {
274-
if is_eof(rdr) { rdr.fatal(~"unterminated block comment"); }
275-
if rdr.curr == '/' && nextch(rdr) == '*' {
276-
bump(rdr);
277-
bump(rdr);
278-
level += 1;
279-
} else {
270+
} else {
271+
loop {
272+
if is_eof(rdr) { rdr.fatal(~"unterminated block comment"); }
280273
if rdr.curr == '*' && nextch(rdr) == '/' {
281274
bump(rdr);
282275
bump(rdr);
283-
level -= 1;
284-
} else { bump(rdr); }
276+
break;
277+
} else {
278+
bump(rdr);
279+
}
285280
}
286281
}
287282
// restart whitespace munch.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// error-pattern:
2+
3+
/* This is a test to ensure that we do _not_ support nested/balanced comments. I know you might be
4+
thinking "but nested comments are cool", and that would be a valid point, but they are also a
5+
thing that would make our lexical syntax non-regular, and we do not want that to be true.
6+
7+
omitting-things at a higher level (tokens) should be done via token-trees / macros,
8+
not comments.
9+
10+
/*
11+
fail here
12+
*/
13+
*/
14+
15+
fn main() {
16+
}

branches/try/src/test/compile-fail/unbalanced-comment.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
2-
3-
41
// -*- rust -*-
52

63
/*
7-
* This is a /* depth-balanced */ multi-line comment.
4+
* This is a multi-line comment.
85
*/
96
fn main() { }

0 commit comments

Comments
 (0)