Skip to content

Commit acd47d9

Browse files
committed
---
yaml --- r: 42346 b: refs/heads/master c: d9a61f2 h: refs/heads/master v: v3
1 parent 4eaeb95 commit acd47d9

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 951ad11d68521e3f99b73f5c1328cf8e3c98c943
2+
refs/heads/master: d9a61f2a1962c1ed0aaa2b7beac3a0daae40a162
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/libsyntax/parse/lexer.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,13 @@ fn scan_number(c: char, rdr: string_reader) -> token::Token {
431431
let dec_part = scan_digits(rdr, 10u);
432432
num_str += ~"." + dec_part;
433433
}
434+
if is_float {
435+
match base {
436+
16u => rdr.fatal(~"hexadecimal float literal is not supported"),
437+
2u => rdr.fatal(~"binary float literal is not supported"),
438+
_ => ()
439+
}
440+
}
434441
match scan_exponent(rdr) {
435442
Some(ref s) => {
436443
is_float = true;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// error-pattern:binary float literal is not supported
12+
13+
fn main() {
14+
0b101010f;
15+
0b101.010;
16+
0b101p4f;
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// error-pattern:hexadecimal float literal is not supported
12+
13+
fn main() {
14+
0xABC.Df;
15+
0x567.89;
16+
0xDEAD.BEEFp-2f;
17+
}

0 commit comments

Comments
 (0)