about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorKang Seonghoon <public+git@mearie.org>2013-02-06 16:49:24 +0900
committerKang Seonghoon <public+git@mearie.org>2013-02-06 16:49:24 +0900
commit01cc9ecafeb235ad3c12aa2222c3911b2b450052 (patch)
treef4497f2db50be9e81d83f8632279376ce10da7fd /src/libsyntax
parent801f3225b24a796402b83f660f80e62ac504befe (diff)
downloadrust-01cc9ecafeb235ad3c12aa2222c3911b2b450052.tar.gz
rust-01cc9ecafeb235ad3c12aa2222c3911b2b450052.zip
libsyntax: no binary/hex float literals
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/parse/lexer.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index 381183e736c..0f672d1de81 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -431,6 +431,13 @@ fn scan_number(c: char, rdr: string_reader) -> token::Token {
         let dec_part = scan_digits(rdr, 10u);
         num_str += ~"." + dec_part;
     }
+    if is_float {
+        match base {
+          16u => rdr.fatal(~"hexadecimal float literal is not supported"),
+          2u => rdr.fatal(~"binary float literal is not supported"),
+          _ => ()
+        }
+    }
     match scan_exponent(rdr) {
       Some(ref s) => {
         is_float = true;