doc-src/IsarRef/syntax.tex
changeset 12879 8e1cae1de136
parent 12637 4d43b06a81e1
child 12976 5cfe2941a5db
equal deleted inserted replaced
12878:2896f88180b9 12879:8e1cae1de136
   100 escapes.
   100 escapes.
   101 
   101 
   102 Comments take the form \texttt{(*~\dots~*)} and may in principle be nested,
   102 Comments take the form \texttt{(*~\dots~*)} and may in principle be nested,
   103 just as in ML.  Note that these are \emph{source} comments only, which are
   103 just as in ML.  Note that these are \emph{source} comments only, which are
   104 stripped after lexical analysis of the input.  The Isar document syntax also
   104 stripped after lexical analysis of the input.  The Isar document syntax also
   105 provides \emph{formal comments} that are actually part of the text (see
   105 provides \emph{formal comments} that are considered as part of the text (see
   106 \S\ref{sec:comments}).
   106 \S\ref{sec:comments}).
   107 
   107 
   108 \begin{warn}
   108 \begin{warn}
   109   Proof~General does not handle nested comments properly; it is also unable to
   109   Proof~General does not handle nested comments properly; it is also unable to
   110   keep \verb,(*,\,/\,\verb,{*, and \verb,*),\,/\,\verb,*}, apart, despite
   110   keep \verb,(*,\,/\,\verb,{*, and \verb,*),\,/\,\verb,*}, apart, despite
   163 \subsection{Comments}\label{sec:comments}
   163 \subsection{Comments}\label{sec:comments}
   164 
   164 
   165 Large chunks of plain \railqtoken{text} are usually given
   165 Large chunks of plain \railqtoken{text} are usually given
   166 \railtoken{verbatim}, i.e.\ enclosed in \verb|{*|~\dots~\verb|*}|.  For
   166 \railtoken{verbatim}, i.e.\ enclosed in \verb|{*|~\dots~\verb|*}|.  For
   167 convenience, any of the smaller text units conforming to \railqtoken{nameref}
   167 convenience, any of the smaller text units conforming to \railqtoken{nameref}
   168 are admitted as well.  Almost any of the Isar commands may be annotated by a
   168 are admitted as well.  A marginal \railnonterm{comment} is of the form
   169 marginal \railnonterm{comment} of the form \texttt{--} \railqtoken{text}.
   169 \texttt{--} \railqtoken{text}.  Any number of these may occur within
   170 Note that the latter kind of comment is actually part of the language, while
   170 Isabelle/Isar commands.
   171 source level comments \verb|(*|~\dots~\verb|*)| are stripped at the lexical
   171 
   172 level.
   172 \indexoutertoken{text}\indexouternonterm{comment}
   173 
       
   174 A few commands such as $\PROOFNAME$ admit additional markup with a ``level of
       
   175 interest'': \texttt{\%} followed by an optional number $n$ (default $n = 1$)
       
   176 indicates that the respective part of the document becomes $n$ levels more
       
   177 obscure; \texttt{\%\%} means that interest drops by $\infty$ --- abandon every
       
   178 hope, who enter here.  So far the Isabelle tool-chain (for document output
       
   179 etc.) does not yet treat interest levels specifically.
       
   180 
       
   181 \indexoutertoken{text}\indexouternonterm{comment}\indexouternonterm{interest}
       
   182 \begin{rail}
   173 \begin{rail}
   183   text: verbatim | nameref
   174   text: verbatim | nameref
   184   ;
   175   ;
   185   comment: ('--' text +)
   176   comment: '--' text
   186   ;
       
   187   interest: percent nat? | ppercent
       
   188   ;
   177   ;
   189 \end{rail}
   178 \end{rail}
   190 
   179 
   191 
   180 
   192 \subsection{Type classes, sorts and arities}
   181 \subsection{Type classes, sorts and arities}