Skip to content

Commit

Permalink
Deprecate byte order mark (modelica#2696)
Browse files Browse the repository at this point in the history
* Deprecate use of UTF-8 byte order mark
* Change 'whitespace' -> 'white-space' everywhere
  • Loading branch information
henrikt-ma committed Nov 6, 2020
1 parent 4775c21 commit 95517bc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions chapters/lexicalstructure.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ \section{Character Set}\label{character-set}
\section{Comments}\label{comments}

There are two kinds of comments in Modelica which are not lexical units
in the language and therefore are treated as whitespace by a Modelica
translator. The whitespace characters are space, tabulator, and line
separators (carriage return and line feed); and whitespace cannot occur
in the language and therefore are treated as white-space by a Modelica
translator. The white-space characters are space, tabulator, and line
separators (carriage return and line feed); and white-space cannot occur
inside tokens, e.g., \textless{}= must be written as two characters
without space or comments between them. The following comment variants are
available:
Expand Down
5 changes: 1 addition & 4 deletions chapters/packages.tex
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ \section{Mapping Package/Class Structures to a Hierarchical File System}\label{m
File in the file system.
\end{itemize}

Each Modelica file in the file-system is stored in UTF-8 format (defined
by The Unicode Consortium; \lstinline!http://www.unicode.org!) and may start with
the UTF-8 encoded byte order mark (\lstinline!0xef 0xbb 0xbf!); this is treated as
white-space in the grammar.
Each Modelica file in the file-system is stored in UTF-8 format (defined by The Unicode Consortium; \lstinline!http://www.unicode.org!). A deprecated feature is that the file may start with the UTF-8 encoded BOM (byte order mark; \lstinline!0xef 0xbb 0xbf!); this is treated as white-space in the grammar. Since the use of BOM is deprecated, tools can ignore any BOM when reading, and it is recommended to never write it.

\begin{nonnormative}
Tools may also store classes in data-base systems, but that is not standardized.
Expand Down
2 changes: 1 addition & 1 deletion chapters/revisions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ \subsection{Main changes in Modelica 3.2 Revision 1}\label{main-changes-in-model
Defined flipping more precisely.
\item
\cref{lexical-conventions} Lexical conventions\\
More precisely defined whitespace and comments.
More precisely defined white-space and comments.
\item
\cref{grammar} Grammar\\
Improved/corrected grammar definition
Expand Down
6 changes: 3 additions & 3 deletions chapters/syntax.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ \section{Lexical conventions}\label{lexical-conventions}
[ ] optional
{ } repeat zero or more times
| or
"text" The text is treated as a single token (no whitespace between any characters)
"text" The text is treated as a single token (no white-space between any characters)
\end{lstlisting}

The following lexical units are defined (the ones in boldface are the
Expand Down Expand Up @@ -41,9 +41,9 @@ \section{Lexical conventions}\label{lexical-conventions}
Note:
\begin{itemize}
\item
Whitespace and comments can be used between separate lexical units
White-space and comments can be used between separate lexical units
and/or symbols, and also separates them. Each lexical unit will consume the maximum number of characters from the input stream.
Whitespace and comments
White-space and comments
cannot be used inside other lexical units, except for STRING and
Q-IDENT where they are treated as part of the STRING or Q-IDENT
lexical unit.
Expand Down
2 changes: 1 addition & 1 deletion preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
\lstset{ %
backgroundcolor=\color{white}, % choose the background color
mathescape=true,
breaklines=true, % automatic line breaking only at whitespace
breaklines=true, % automatic line breaking only at white-space
keepspaces, % don't remove space such as those after closing parenthesis
captionpos=b, % sets the caption-position to bottom
commentstyle=\color[rgb]{0,0.4,0}\sffamily, % comment style
Expand Down

0 comments on commit 95517bc

Please sign in to comment.