Skip to content

Commit

Permalink
Use new table style for string escape sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Sep 20, 2020
1 parent ac73345 commit 3e67ce8
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions chapters/lexicalstructure.tex
Expand Up @@ -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:
Expand Down

0 comments on commit 3e67ce8

Please sign in to comment.