From cc373354b863ca594875bf7355230fab2bab0f96 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Sun, 9 Feb 2014 02:43:50 +0000 Subject: [PATCH] [docs] TableGen easter egg: Multiline string literals They're called code fragments, but they are really multiline string literals. Just spotted this usage in a patch by Aaron using "code fragments" for holding documentation text. I remember someone bemoaning the lack of multiline string literals in TableGen, so I'm explicitly documenting that code fragments are multiline string literals. Let it be known that any use case needing multiline string literals in TableGen (such as descriptions of options, or whatnot) can use use code fragments (instead of C-style string concatenation or exceedingly long lines). E.g. class Bar; class Baz; class Doc { string Desc = desc; } def Foo : Bar<1>, Baz<3>, Doc<[{ This Foo is a Bar, and also a Baz. It can take 3 values: * Qux * Quux * Quuux }]>; llvm-svn: 201033 --- llvm/docs/TableGen/LangRef.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/docs/TableGen/LangRef.rst b/llvm/docs/TableGen/LangRef.rst index bd28a90..e3db3aa 100644 --- a/llvm/docs/TableGen/LangRef.rst +++ b/llvm/docs/TableGen/LangRef.rst @@ -74,6 +74,9 @@ TableGen also has two string-like literals: TokString: '"' '"' TokCodeFragment: "[{" "}]" +:token:`TokCodeFragment` is essentially a multiline string literal +delimited by ``[{`` and ``}]``. + .. note:: The current implementation accepts the following C-like escapes:: -- 2.7.4