summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/strc-syn.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/strc-syn.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/strc-syn.mkiv62
1 files changed, 42 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/context/base/strc-syn.mkiv b/Master/texmf-dist/tex/context/base/strc-syn.mkiv
index 65f5174372a..f063ef087d6 100644
--- a/Master/texmf-dist/tex/context/base/strc-syn.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-syn.mkiv
@@ -20,6 +20,9 @@
\unprotect
+\let\dotagsynonym\relax
+\let\dotagsorting\relax
+
% general help, can be shared
% simplifiedcommands -> flag in lua
@@ -96,6 +99,7 @@
%\c!after=,
\c!indentnext=\v!no,
%\c!expansion=,
+ \c!method=,
\s!language=\currentmainlanguage]
\unexpanded\def\definesynonyms
@@ -114,9 +118,9 @@
\fi
\setuvalue{#1}{\definesynonym[\v!yes][#1]}% \name
\fi
- \getparameters[\??sm#1][\s!parent=\??sm,\s!multi={#2}]%
+ \getparameters[\??sm#1][\s!parent=\??sm,\s!single={#1},\s!multi={#2}]%
\presetheadtext[#2=\Word{#2}]% changes the \if...argument
- %\ctxlua{joblists.define('#1')}%
+ %\ctxlua{structures.synonyms.define('#1')}%
\setvalue{\e!setup #2\e!endsetup}{\dodoubleargument\getparameters[\??sm#1]}% to be obsolete
\setvalue{\e!place \e!listof#2}{\placelistofsynonyms[#1]}% accepts extra argument
\setvalue{\e!complete\e!listof#2}{\completelistofsynonyms[#1]}}
@@ -137,7 +141,7 @@
\edef\currentsynonymexpansion{\synonymparameter\c!expansion}%
\preprocessexpansion\currentsynonymexpansion\currentsynonymtext \currentsynonymcoding{#4}%
\preprocessexpansion\currentsynonymexpansion\currentsynonymmeaning\currentsynonymcoding{#5}%
- \ctxlua{joblists.register("\currentsynonym", "synonym", {
+ \ctxlua{structures.synonyms.register("\currentsynonym", "synonym", {
metadata = {
catcodes = \the\catcodetable,
coding = "\currentsynonymcoding",
@@ -158,20 +162,24 @@
{\dodoubleargument\doregistersynonym}
\def\registersynonym[#1][#2]%
- {\ctxlua{joblists.registerused("#1","#2")}}
+ {\ctxlua{structures.synonyms.registerused("#1","#2")}}
\unexpanded\def\doinsertsynonymmeaning#1#2% name tag
{\begingroup
\def\currentsynonym{#1}%
\dosetsynonymattributes\c!textstyle\c!textcolor
- \synonymparameter\c!textcommand{\ctxlua{joblists.meaning("#1","#2")}}%
+ \synonymparameter\c!textcommand{\ctxlua{structures.synonyms.meaning("#1","#2")}}%
\endgroup}
\unexpanded\def\doinsertsynonym#1#2% name tag
{\begingroup
\def\currentsynonym{#1}%
+ \def\currentsynonymtag{#2}%
+ \dotagsynonym
+ \dostarttagged\t!synonym\currentsynonym
\dosetsynonymattributes\c!synonymstyle\c!synonymcolor
- \synonymparameter\c!synonymcommand{\ctxlua{joblists.synonym("#1","#2")}}%
+ \synonymparameter\c!synonymcommand{\ctxlua{structures.synonyms.synonym("#1","#2")}}%
+ \dostoptagged
\normalexpanded{\endgroup\synonymparameter\c!next}}
\unexpanded\def\placelistofsynonyms
@@ -200,15 +208,20 @@
\c!color=.
#2]%
\startpacked
- \ctxlua{joblists.process('#1',{ criterium = "\synonymparameter\c!criterium" })}%
+ \ctxlua{structures.synonyms.process('#1',{
+ criterium = "\synonymparameter\c!criterium",
+ language = "\synonymparameter\s!language",
+ method = "\synonymparameter\c!method",
+ })}%
\stoppacked
\endgroup}
\def\completelistofsynonyms
{\dodoubleempty\docompletelistofsynonyms}
-\def\docompletelistofsynonyms[#1][#2]% expansion needed to avoid v! (due to french active !)
- {\normalexpanded{\systemsuppliedchapter[#1]{\noexpand\headtext{\synonymparameter\s!single}}}%
+\def\docompletelistofsynonyms[#1][#2]%
+ {\edef\currentsynonym{#1}%
+ \normalexpanded{\systemsuppliedchapter[#1]{\noexpand\headtext{\synonymparameter\s!multi}}}%
\doplacelistofsynonyms[#1][#2]%
\page[\v!yes]}
@@ -262,6 +275,7 @@
%\c!before=,
\c!after=\endgraf,
%\c!expansion=,
+ \c!method=,
\s!language=\currentmainlanguage]
\unexpanded\def\definesorting
@@ -281,7 +295,7 @@
\fi
\getparameters[\??so#1][\s!parent=\??so,\s!multi={#2}]%
\presetheadtext[#2=\Word{#2}]% after \ifthirdargument -)
- %\ctxlua{joblists.define('#1')}%
+ %\ctxlua{structures.synonyms.define('#1')}%
\setvalue{\e!setup #2\e!endsetup}{\dodoubleargument\getparameters[\??so#1]}% to be obsolete
\setvalue{\e!place \e!listof#2}{\placelistofsorts[#1]}%
\setvalue{\e!complete\e!listof#2}{\completelistofsorts[#1]}}
@@ -301,7 +315,7 @@
\else
\edef\currentsortingexpansion{\sortingparameter\c!expansion}%
\preprocessexpansion\currentsortingexpansion\currentsortingtext\currentsortingcoding{#4}%
- \ctxlua{joblists.register("\currentsorting", "sorting", {
+ \ctxlua{structures.synonyms.register("\currentsorting", "sorting", {
metadata = {
catcodes = \the\catcodetable,
coding = "\currentsortingcoding",
@@ -321,34 +335,42 @@
{\begingroup
% no kap currently, of .. we need to map cap onto WORD
\edef\currentsorting{#1}%
- \dosetsynonymattributes\c!style\c!color
- \ctxlua{joblists.synonym("#1","#2")}%
+ \def\currentsortingtag{#2}%
+ \dotagsorting
+ \dostarttagged\t!sorting\currentsorting
+ \dosetsortingattributes\c!style\c!color
+ \ctxlua{structures.synonyms.synonym("#1","#2")}%
+ \dostoptagged
\normalexpanded{\endgroup\sortingparameter\c!next}}
\def\registersort
{\dodoubleargument\doregistersort}
\def\registersort[#1][#2]%
- {\ctxlua{joblists.registerused("#1","#2")}}
+ {\ctxlua{structures.synonyms.registerused("#1","#2")}}
% before after
%
% maybe just 'commandset' and then combine
\unexpanded\def\placelistofsorts
- {\dodoubleempty\placelistofsorts}
+ {\dodoubleempty\doplacelistofsorts}
-\unexpanded\def\placelistofsorts[#1][#2]% NOG EEN RUWE VERSIE MAKEN ZONDER WITRUIMTE ETC ETC
+\def\doplacelistofsorts[#1][#2]% NOG EEN RUWE VERSIE MAKEN ZONDER WITRUIMTE ETC ETC
{\begingroup
\def\currentsorting{#1}%
\getparameters[\??so#1][#2]%
\startpacked
- \ctxlua{joblists.process('#1',{ criterium = "\sortingparameter\c!criterium" })}%
+ \ctxlua{structures.synonyms.process('#1',{
+ criterium = "\sortingparameter\c!criterium",
+ language = "\sortingparameter\s!language",
+ method = "\sortingparameter\c!method",
+ })}%
\stoppacked
\endgroup}
-\def\completelistofsorts
- {\dodoubleemptydocompletelistofsorts}
+\unexpanded\def\completelistofsorts
+ {\dodoubleempty\docompletelistofsorts}
\def\docompletelistofsorts[#1][#2]%
{\normalexpanded{\systemsuppliedchapter[#1]{\noexpand\headtext{#2}}}%
@@ -372,7 +394,7 @@
% \def\mkloadsortedlist#1% class
% {\bgroup
% \getvalue{\s!set#1}%
-% \ctxlua{joblists.process('#1')}%
+% \ctxlua{structures.synonyms.process('#1')}%
% \getvalue{\s!reset#1}%
% \egroup}