Skip to content

Commit ecdb25d

Browse files
committed
Committee has decided not to elide excess brackets in character classes
This affects the existing [[:rname:^*=]]... and the new [[:print:]].
1 parent 3b4e874 commit ecdb25d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

SAMv1.tex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
\newcommand*{\firstbytebox}[2]{\byteboxAux{#1}{#2}{\put(0,0){\line(0,1){\bytetotalheight}}}}
3434
\newcommand*{\bytebox}[2]{\byteboxAux{#1}{#2}{}}
3535

36-
\newcommand*{\cclass}[1]{{\rm\sf :#1:}}
36+
\newcommand*{\cclass}[1]{[{\rm\sf :#1:}]}
37+
\newcommand*{\cclassexcept}[2]{[{\rm\sf :#1:}\caret #2]}
3738
\newcommand*{\caret}{\textsuperscript{$\wedge$}}
3839

3940
\newcommand*{\memlimited}{\textcolor{gray}{\footnotesize\it limited}}
@@ -77,7 +78,6 @@ \section{The SAM Format Specification}
7778
For example, floating-point values in SAM always use `{\tt .}' for the decimal-point character.
7879

7980
The regular expressions in this specification are written using the POSIX\,/\,IEEE Std 1003.1 extended syntax.
80-
For brevity, named character classes are written as~{\tt [\cclass{class}]} without an additional pair of brackets.
8181

8282
\subsection{An example}\label{sec:example}
8383
Suppose we have the following alignment with bases in lowercase
@@ -209,9 +209,7 @@ \subsubsection{Character set restrictions}\label{sec:charset}
209209
{\tt [\verb"0-9A-Za-z!#$%&+./:;?@^_|~-"][\verb"0-9A-Za-z!#$%&*+./:;=?@^_|~-"]*}
210210
\end{center}
211211
212-
% Pedantically this should be [[:rname:]^*=][[:rname:]]*, but we take advantage
213-
% of POSIX (Issue 7) section 9.3.5/8 to elide the excess brackets for clarity.
214-
\newcommand*{\rnameRegexp}{[\cclass{rname}\caret*=][\cclass{rname}]*}
212+
\newcommand*{\rnameRegexp}{[\cclassexcept{rname}{*=}][\cclass{rname}]*}
215213
216214
\noindent
217215
For clarity, elsewhere in this specification we write this set of allowed characters as a character class~{\tt [\cclass{rname}]} and extend the POSIX regular expression notation to use {\tt\caret *=} to indicate the omission of `{\tt *}' and `{\tt =}' from the character class.
@@ -301,6 +299,7 @@ \subsection{The header section}
301299
These alternative names are not used elsewhere within the SAM file;
302300
in particular, they must not appear in alignment records' {\sf RNAME}
303301
or~{\sf RNEXT} fields.
302+
\newline
304303
\emph{Regular expression}: \emph{name}{\tt (,}\emph{name}{\tt )*}
305304
where \emph{name} is {\tt\rnameRegexp}\\\cline{2-3}
306305
& {\tt AS} & Genome assembly identifier. \\\cline{2-3}

0 commit comments

Comments
 (0)