From f8e0f9810b7b24e78823e039d2bb77b7d1be9154 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Tue, 4 Feb 2014 19:29:16 -0800 Subject: SI-8092 Refactor f-interp A denshish refactor makes the FormatInterpolator a nice bundle that destructures its input and flattens out the classes to give the code some elbow room. Everything shifts left. The `checkType` method is refolded and renamed `pickAcceptable`. An additional test case captures the leading edge test, that a % should follow a hole, and which is the most basic requirement. --- test/files/neg/stringinterpolation_macro-neg.check | 5 ++++- test/files/neg/stringinterpolation_macro-neg.scala | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/files/neg/stringinterpolation_macro-neg.check b/test/files/neg/stringinterpolation_macro-neg.check index 00002f5a4b..703846ad62 100644 --- a/test/files/neg/stringinterpolation_macro-neg.check +++ b/test/files/neg/stringinterpolation_macro-neg.check @@ -165,5 +165,8 @@ stringinterpolation_macro-neg.scala:71: error: Date/time conversion must have tw stringinterpolation_macro-neg.scala:72: error: Missing conversion operator in '%10.5'; use %% for literal %, %n for newline f"$s%10.5" ^ +stringinterpolation_macro-neg.scala:75: error: conversions must follow a splice; use %% for literal %, %n for newline + f"${d}random-leading-junk%d" + ^ three warnings found -44 errors found +45 errors found diff --git a/test/files/neg/stringinterpolation_macro-neg.scala b/test/files/neg/stringinterpolation_macro-neg.scala index c5ae708f21..3869d42d66 100644 --- a/test/files/neg/stringinterpolation_macro-neg.scala +++ b/test/files/neg/stringinterpolation_macro-neg.scala @@ -70,4 +70,7 @@ object Test extends App { f"$t%tG" f"$t%t" f"$s%10.5" + + // 8) other brain failures + f"${d}random-leading-junk%d" } -- cgit v1.2.3