File: input.tex

package info (click to toggle)
cadabra2 2.4.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,796 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (32 lines) | stat: -rw-r--r-- 1,249 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
\section{Input format}

The input format of Cadabra~II follows the Python language
specification, with the following additional rules:
\begin{enumerate}
\item A line containing a \verb|:=| token is interpreted as a Cadabra
  expression declaration. If the line does not end with a semi-colon
  \verb|;| following lines are added until a line is found which does
  end with a semi-colon. The newlines between these lines are replaced
  with a single space character.

  [example]

  This is translated to the following expression before it is being
  handed to the Python interpreter.

  [translation]

\item A line containing a \verb|::| token is interpreted as a Cadabra
  property declaration. The same rule for line continuation is used.

\item Anything inbetween two dollar symbols is interpreted as a
  Cadabra expression (just like \TeX{} handles mathematical
  expressions).

\item A line ending with a semi-colon \verb|;| will lead to the output
  of the last-used expression being printed. To be precise, it will
  insert a \verb|print(latex(_))| into the input.
\end{enumerate}
The interactive shell \verb|cadabra2| will indicate Cadabra line
continuations by showing a `|' symbol as prompt (instead of the
`\verb|>|' shown for new lines.