Skip to content

Commit 2a461b6

Browse files
committed
---
yaml --- r: 56511 b: refs/heads/auto c: 9968ccf h: refs/heads/master i: 56509: 8584beb 56507: c12eb3b 56503: 40a7805 56495: 17d36fd 56479: 447d045 56447: 0e10a78 v: v3
1 parent d7fe2ca commit 2a461b6

File tree

17 files changed

+557
-881
lines changed

17 files changed

+557
-881
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 41af2792333fe739abb899c6815005b08674ff21
17+
refs/heads/auto: 9968ccfc303f6cc6fed614118400faabcb9a6760
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub fn parse_input(sess: Session, cfg: ast::crate_cfg, input: &input)
149149
-> @ast::crate {
150150
match *input {
151151
file_input(ref file) => {
152-
parse::parse_crate_from_file(&(*file), cfg, sess.parse_sess)
152+
parse::parse_crate_from_file_using_tts(&(*file), cfg, sess.parse_sess)
153153
}
154154
str_input(ref src) => {
155155
// FIXME (#2319): Don't really want to box the source string

branches/auto/src/librustdoc/attr_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ mod test {
7979

8080
let parse_sess = syntax::parse::new_parse_sess(None);
8181
let parser = parse::new_parser_from_source_str(
82-
parse_sess, ~[], ~"-", @source);
82+
parse_sess, ~[], ~"-", codemap::FssNone, @source);
8383
8484
parser.parse_outer_attributes()
8585
}

branches/auto/src/libsyntax/ast_util.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,6 @@ pub fn operator_prec(op: ast::binop) -> uint {
355355
}
356356
}
357357
358-
/// Precedence of the `as` operator, which is a binary operator
359-
/// not appearing in the prior table.
360-
pub static as_prec: uint = 11u;
361-
362358
pub fn dtor_ty() -> @ast::Ty {
363359
@ast::Ty {id: 0, node: ty_nil, span: dummy_sp()}
364360
}
@@ -760,6 +756,7 @@ mod test {
760756
assert_eq!(refold_test_sc(3,&t),test_sc);
761757
}
762758
759+
763760
// extend a syntax context with a sequence of marks given
764761
// in a vector. v[0] will be the outermost mark.
765762
fn unfold_marks(mrks:~[Mrk],tail:SyntaxContext,table: &mut SCTable) -> SyntaxContext {

branches/auto/src/libsyntax/ext/base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
461461

462462
// ugh: can't get this to compile with mut because of the
463463
// lack of flow sensitivity.
464-
#[cfg(not(stage0))]
464+
#[cfg(stage1)]
465+
#[cfg(stage2)]
466+
#[cfg(stage3)]
465467
fn get_map<'a>(&'a self) -> &'a HashMap<K,@V> {
466468
match *self {
467469
BaseMapChain (~ref map) => map,

branches/auto/src/libsyntax/opt_vec.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ impl<T> OptVec<T> {
6868
}
6969
}
7070

71-
#[cfg(not(stage0))]
71+
#[cfg(stage1)]
72+
#[cfg(stage2)]
73+
#[cfg(stage3)]
7274
fn get<'a>(&'a self, i: uint) -> &'a T {
7375
match *self {
7476
Empty => fail!(fmt!("Invalid index %u", i)),

branches/auto/src/libsyntax/parse/attr.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,12 @@ impl parser_attr for Parser {
6262
return attrs;
6363
}
6464

65-
// matches attribute = # attribute_naked
6665
fn parse_attribute(&self, style: ast::attr_style) -> ast::attribute {
6766
let lo = self.span.lo;
6867
self.expect(&token::POUND);
6968
return self.parse_attribute_naked(style, lo);
7069
}
7170

72-
// matches attribute_naked = [ meta_item ]
7371
fn parse_attribute_naked(&self, style: ast::attr_style, lo: BytePos) ->
7472
ast::attribute {
7573
self.expect(&token::LBRACKET);
@@ -88,7 +86,6 @@ impl parser_attr for Parser {
8886
// is an inner attribute of the containing item or an outer attribute of
8987
// the first contained item until we see the semi).
9088

91-
// matches inner_attrs* outer_attr?
9289
// you can make the 'next' field an Option, but the result is going to be
9390
// more useful as a vector.
9491
fn parse_inner_attrs_and_next(&self) ->
@@ -137,9 +134,6 @@ impl parser_attr for Parser {
137134
(inner_attrs, next_outer_attrs)
138135
}
139136

140-
// matches meta_item = IDENT
141-
// | IDENT = lit
142-
// | IDENT meta_seq
143137
fn parse_meta_item(&self) -> @ast::meta_item {
144138
let lo = self.span.lo;
145139
let name = self.id_to_str(self.parse_ident());
@@ -162,7 +156,6 @@ impl parser_attr for Parser {
162156
}
163157
}
164158

165-
// matches meta_seq = ( COMMASEP(meta_item) )
166159
fn parse_meta_seq(&self) -> ~[@ast::meta_item] {
167160
copy self.parse_seq(
168161
&token::LPAREN,

branches/auto/src/libsyntax/parse/classify.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515
use ast;
1616
use codemap;
1717

18-
// does this expression require a semicolon to be treated
19-
// as a statement? The negation of this: 'can this expression
20-
// be used as a statement without a semicolon' -- is used
21-
// as an early-bail-out in the parser so that, for instance,
22-
// 'if true {...} else {...}
23-
// |x| 5 '
24-
// isn't parsed as (if true {...} else {...} | x) | 5
2518
pub fn expr_requires_semi_to_be_stmt(e: @ast::expr) -> bool {
2619
match e.node {
2720
ast::expr_if(*)
@@ -47,9 +40,6 @@ pub fn expr_is_simple_block(e: @ast::expr) -> bool {
4740
}
4841
}
4942

50-
// this statement requires a semicolon after it.
51-
// note that in one case (stmt_semi), we've already
52-
// seen the semicolon, and thus don't need another.
5343
pub fn stmt_ends_with_semi(stmt: &ast::stmt) -> bool {
5444
return match stmt.node {
5545
ast::stmt_decl(d, _) => {

branches/auto/src/libsyntax/parse/comments.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ pub struct lit {
309309
pos: BytePos
310310
}
311311
312-
// it appears this function is called only from pprust... that's
313-
// probably not a good thing.
314312
pub fn gather_comments_and_literals(span_diagnostic:
315313
@diagnostic::span_handler,
316314
path: ~str,

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,20 @@ pub fn is_whitespace(c: char) -> bool {
225225
return c == ' ' || c == '\t' || c == '\r' || c == '\n';
226226
}
227227

228+
fn may_begin_ident(c: char) -> bool { return is_alpha(c) || c == '_'; }
229+
228230
fn in_range(c: char, lo: char, hi: char) -> bool {
229231
return lo <= c && c <= hi
230232
}
231233

234+
fn is_alpha(c: char) -> bool {
235+
return in_range(c, 'a', 'z') || in_range(c, 'A', 'Z');
236+
}
237+
232238
fn is_dec_digit(c: char) -> bool { return in_range(c, '0', '9'); }
233239

240+
fn is_alnum(c: char) -> bool { return is_alpha(c) || is_dec_digit(c); }
241+
234242
fn is_hex_digit(c: char) -> bool {
235243
return in_range(c, '0', '9') || in_range(c, 'a', 'f') ||
236244
in_range(c, 'A', 'F');
@@ -286,8 +294,6 @@ fn consume_any_line_comment(rdr: @mut StringReader)
286294
}
287295
} else if rdr.curr == '#' {
288296
if nextch(rdr) == '!' {
289-
// I guess this is the only way to figure out if
290-
// we're at the beginning of the file...
291297
let cmap = @CodeMap::new();
292298
(*cmap).files.push(rdr.filemap);
293299
let loc = cmap.lookup_char_pos_adj(rdr.last_pos);
@@ -438,7 +444,8 @@ fn scan_number(c: char, rdr: @mut StringReader) -> token::Token {
438444
}
439445
}
440446
let mut is_float = false;
441-
if rdr.curr == '.' && !(ident_start(nextch(rdr)) || nextch(rdr) == '.') {
447+
if rdr.curr == '.' && !(is_alpha(nextch(rdr)) || nextch(rdr) == '_' ||
448+
nextch(rdr) == '.') {
442449
is_float = true;
443450
bump(rdr);
444451
let dec_part = scan_digits(rdr, 10u);

0 commit comments

Comments
 (0)