From 5f2fc14b8b77fcfa5c0fb80ecb3469d2a4624638 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Wed, 14 Mar 2012 18:17:53 +0000 Subject: [PATCH] added more comments on how to construct a valid StringTemplate --- runtime/src/jet/StringTemplate.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/src/jet/StringTemplate.java b/runtime/src/jet/StringTemplate.java index 218216b005a..a3f5e9f9f26 100644 --- a/runtime/src/jet/StringTemplate.java +++ b/runtime/src/jet/StringTemplate.java @@ -18,7 +18,11 @@ package jet; /** * Represents a string template object; that is a string with $ expressions such as "Hello $user". * - * It is represented as an object that contains a Tuple + * It is represented as an object that contains a Tuple such that all the even items in the tuple are constant + * strings and the odd items are dynamic expressions which may need to be escaped. + * + * So the expression "Hello $foo$bar how are you?" would be represented as a tuple #("Hello ", foo, "", bar, " how are you?). + * i.e. we insert an empty string to ensure that the tuple starts with a constant string and every other value is a dynamic expression. */ public class StringTemplate { private final Tuple tuple;