diff options
Diffstat (limited to 'macros/luatex/optex/base/hisyntax-c.opm')
-rw-r--r-- | macros/luatex/optex/base/hisyntax-c.opm | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/macros/luatex/optex/base/hisyntax-c.opm b/macros/luatex/optex/base/hisyntax-c.opm index 8e8ccf0920..3c1f228f88 100644 --- a/macros/luatex/optex/base/hisyntax-c.opm +++ b/macros/luatex/optex/base/hisyntax-c.opm @@ -1,11 +1,11 @@ -%% This is part of OpTeX project, see http://petr.olsak.net/optex +%% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \_hisyntaxc {Syntax highlighting for C sources <2020-04-03>} +\_codedecl \_hisyntaxc {Syntax highlighting for C sources <2020-04-03>} \_newtoks \_hisyntaxc \_newtoks \_hicolorsc \_global\_hicolorsc={% colors for C language - \_hicolor K \Red % Keywords + \_hicolor K \Red % Keywords \_hicolor S \Magenta % Strings \_hicolor C \Green % Comments \_hicolor N \Cyan % Numbers @@ -25,19 +25,19 @@ \_ea \_foreach \_tmpa \_do {\_replthis{#1}{\n\o#1\n}} \_foreach % keywords - {auto}{break}{case}{char}{continue}{default}{do}{double}% - {else}{entry}{enum}{extern}{float}{for}{goto}{if}{int}{long}{register}% - {return}{short}{sizeof}{static}{struct}{switch}{typedef}{union}% + {auto}{break}{case}{char}{continue}{default}{do}{double}% + {else}{entry}{enum}{extern}{float}{for}{goto}{if}{int}{long}{register}% + {return}{short}{sizeof}{static}{struct}{switch}{typedef}{union}% {unsigned}{void}{while} \_do {\_replthis{\n#1\n}{\z K{#1}}} \_replthis{.}{\n.\n} % numbers - \_foreach 0123456789 + \_foreach 0123456789 \_do {\_replfromto{\n#1}{\n}{\c#1##1\e}} \_replthis{\e.\c}{.} \_replthis{\e.\n}{.\e} \_replthis{\n.\c}{\c.} - \_replthis{e\e\o+\c}{e+}\_replthis{e\e\o-\c}{e-} - \_replthis{E\e\o+\c}{E+}\_replthis{E\e\o-\c}{E-} + \_replthis{e\e\o+\c}{e+}\_replthis{e\e\o-\c}{e-} + \_replthis{E\e\o+\c}{E+}\_replthis{E\e\o-\c}{E-} \_def\o#1{\z O{#1}} \_def\c#1\e{\z N{#1}} } @@ -47,20 +47,20 @@ Each `hisyntax-<name>.opm` file must declare the token list `\_hisyntax<name>` using `\newtoks` and must declare the syntax declaration -in it. The second cotken list `\_hicolors<name>` is optional but recommended. +in it. The second token list `\_hicolors<name>` is optional but recommended. User can re-declare his/her own colors by `\hicolors` which has precedence before `\_hicolors<name>`. The public variants can be declared if you want to give these token lists to -the user name space. But it is not explicitly needed. +the user namespace. But it is not explicitly needed. -All settings must be global here, because the file is typically read inside -a group and we need not to read it repeatedly in before each code chunk +All settings must be global here because the file is typically read inside +a group and we need not read it repeatedly before each code chunk again and again. -Note that `\foreach` is used to each non-letters (expanded via \string -because we needn't to treate with active or special TeX characters). The -keyword are applied in the `\foreach` loop too. +Note that `\foreach` is used for each non-letters (expanded via \string +because we needn't treat with active or special TeX characters). The +keyword is applied in the `\foreach` loop too. See `hi-sytax.opm` for more information about `\hicolor`, `\replfromto` and `\replthis` macros. |