llvm.org GIT mirror llvm / f408f0f
[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<int n>; class Baz<int n>; class Doc<string desc> { 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 }]>; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201033 91177308-0d34-0410-b5e6-96231b3b80d8 Sean Silva 5 years ago
1 changed file(s) with 3 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
7272 .. productionlist::
7373 TokString: '"' '"'
7474 TokCodeFragment: "[{" "}]"
75
76 :token:`TokCodeFragment` is essentially a multiline string literal
77 delimited by ``[{`` and ``}]``.
7578
7679 .. note::
7780 The current implementation accepts the following C-like escapes::