summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2014-02-09 02:43:50 +0000
committerSean Silva <silvas@purdue.edu>2014-02-09 02:43:50 +0000
commitf408f0f0d7854aabd839f1bea57aace940aadfe4 (patch)
tree1caa35e6c6da5ed3339979307d7b7288c61ba7c7 /docs
parent8e616d32bd6a2ef4fb3326b4d4664b426369def9 (diff)
downloadllvm-f408f0f0d7854aabd839f1bea57aace940aadfe4.tar.gz
llvm-f408f0f0d7854aabd839f1bea57aace940aadfe4.tar.bz2
llvm-f408f0f0d7854aabd839f1bea57aace940aadfe4.tar.xz
[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
Diffstat (limited to 'docs')
-rw-r--r--docs/TableGen/LangRef.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/TableGen/LangRef.rst b/docs/TableGen/LangRef.rst
index bd28a9031d..e3db3aa627 100644
--- a/docs/TableGen/LangRef.rst
+++ b/docs/TableGen/LangRef.rst
@@ -74,6 +74,9 @@ TableGen also has two string-like literals:
TokString: '"' <non-'"' characters and C-like escapes> '"'
TokCodeFragment: "[{" <shortest text not containing "}]"> "}]"
+:token:`TokCodeFragment` is essentially a multiline string literal
+delimited by ``[{`` and ``}]``.
+
.. note::
The current implementation accepts the following C-like escapes::