about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-04-08 18:08:08 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-04-22 20:47:28 -0400
commitdc7d7d2698139d9d9b0887481c4f50773daa392b (patch)
treecd48dd32d932cb90c80c536783c4955f5883b068 /src/libsyntax/parse
parent09bfb92fdc3ccff42dfcf91b0af368f88dc3e446 (diff)
downloadrust-dc7d7d2698139d9d9b0887481c4f50773daa392b.tar.gz
rust-dc7d7d2698139d9d9b0887481c4f50773daa392b.zip
add support for quadruple precision floating point
This currently requires linking against a library like libquadmath (or
libgcc), because compiler-rt barely has any support for this and most
hardware does not yet have 128-bit precision floating point. For this
reason, it's currently hidden behind a feature gate.

When compiler-rt is updated to trunk, some tests can be added for
constant evaluation since there will be support for the comparison
operators.

Closes #13381
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index ff087d95e50..992d289b4e9 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -593,10 +593,15 @@ fn scan_number(c: char, rdr: &mut StringReader) -> token::Token {
             /* FIXME (#2252): if this is out of range for either a
             32-bit or 64-bit float, it won't be noticed till the
             back-end.  */
-        } else {
-            fatal_span(rdr, start_bpos, rdr.last_pos,
-                       "expected `f32` or `f64` suffix".to_owned());
+        } else if c == '1' && n == '2' && nextnextch(rdr).unwrap_or('\x00') == '8' {
+            bump(rdr);
+            bump(rdr);
+            bump(rdr);
+            check_float_base(rdr, start_bpos, rdr.last_pos, base);
+            return token::LIT_FLOAT(str_to_ident(num_str.as_slice()), ast::TyF128);
         }
+        fatal_span(rdr, start_bpos, rdr.last_pos,
+                   "expected `f32`, `f64` or `f128` suffix".to_owned());
     }
     if is_float {
         check_float_base(rdr, start_bpos, rdr.last_pos, base);