From 3e67ce8473121649785559cd8b360fa2328402cb Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Sun, 20 Sep 2020 23:51:13 +0200 Subject: [PATCH] Use new table style for string escape sequences --- chapters/lexicalstructure.tex | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/chapters/lexicalstructure.tex b/chapters/lexicalstructure.tex index bb1733091..193dd7455 100644 --- a/chapters/lexicalstructure.tex +++ b/chapters/lexicalstructure.tex @@ -181,19 +181,26 @@ \subsection{Strings}\label{strings} literals can be represented using escape codes, i.e., the character is preceded by a backslash (\lstinline!\!) within the string. Those characters are: -\begin{longtable}[c]{@{}ll@{}} -\lstinline!\'! & single quote -- may also appear without backslash in string constants.\\ -\lstinline!\"! & double quote\\ -\lstinline!\?! & question-mark -- may also appear without backslash in string constants.\\ -\lstinline!\\! & backslash itself\\ -\lstinline!\a! & alert (bell, code 7, ctrl-G)\\ -\lstinline!\b! & backspace (code 8, ctrl-H)\\ -\lstinline!\f! & form feed (code 12, ctrl-L)\\ -\lstinline!\n! & newline (code 10, ctrl-J), same as literal newline\\ -\lstinline!\r! & carriage return (code 13, ctrl-M)\\ -\lstinline!\t! & horizontal tab (code 9, ctrl-I)\\ -\lstinline!\v! & vertical tab (code 11, ctrl-K)\\ -\end{longtable} +\begin{center} +\begin{tabular}{c l} +\hline +\tablehead{Character} & \tablehead{Description}\\ +\hline +\hline +\lstinline!\'! & Single quote, may also appear without backslash in string constants\\ +\lstinline!\"! & Double quote\\ +\lstinline!\?! & Question-mark, may also appear without backslash in string constants\\ +\lstinline!\\! & Backslash itself\\ +\lstinline!\a! & Alert (bell, code 7, ctrl-G)\\ +\lstinline!\b! & Backspace (code 8, ctrl-H)\\ +\lstinline!\f! & Form feed (code 12, ctrl-L)\\ +\lstinline!\n! & Newline (code 10, ctrl-J), same as literal newline\\ +\lstinline!\r! & Carriage return (code 13, ctrl-M)\\ +\lstinline!\t! & Horizontal tab (code 9, ctrl-I)\\ +\lstinline!\v! & Vertical tab (code 11, ctrl-K)\\ +\hline +\end{tabular} +\end{center} For example, a string literal containing a tab, the words: \emph{This is}, double quote, space, the word: \emph{between}, double quote, space, the word: