1
2
3
4
5
6
7
8
9
10
11
12
13
14\registerctxluafile{systaux}{}
15\registerctxluafile{systmac}{}
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42\unprotect
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57\let\unexpanded\normalprotected
58
59\def\startlmtxmode#1\stoplmtxmode{}
60\let\stoplmtxmode \relax
61\let\startmkivmode\relax
62\let\stopmkivmode \relax
63
64
65
66\ifdefined\c_syst_helpers_n_of_namespaces
67
68
69
70\else
71
72 \newcount\c_syst_helpers_n_of_namespaces \c_syst_helpers_n_of_namespaces\pluseight
73
74 \def\v_interfaces_prefix_template_system{\number \c_syst_helpers_n_of_namespaces>>}
75
76
77\fi
78
79\protected\def\installsystemnamespace#1
80 {\ifcsname ??#1\endcsname
81 \writestatus\m!system{duplicate system namespace #1}\wait
82 \else
83 \global\advance\c_syst_helpers_n_of_namespaces\plusone
84 \expandafter\edef\csname ??#1\endcsname{\v_interfaces_prefix_template_system}
85 \fi}
86
87
88
89
90
91
92\def\normalspace{ }
93
94
95
96
97
98
99
100
101\newcount\!!counta \newtoks\!!toksa \newdimen\!!dimena \newbox\!!boxa
102\newcount\!!countb \newtoks\!!toksb \newdimen\!!dimenb \newbox\!!boxb
103\newcount\!!countc \newtoks\!!toksc \newdimen\!!dimenc \newbox\!!boxc
104\newcount\!!countd \newtoks\!!toksd \newdimen\!!dimend \newbox\!!boxd
105\newcount\!!counte \newtoks\!!tokse \newdimen\!!dimene \newbox\!!boxe
106\newcount\!!countf \newtoks\!!toksf \newdimen\!!dimenf \newbox\!!boxf
107 \newdimen\!!dimeng
108 \newdimen\!!dimenh
109 \newdimen\!!dimeni
110 \newdimen\!!dimenj
111 \newdimen\!!dimenk
112
113\let\!!stringa\empty \let\!!stringb\empty \let\!!stringc\empty
114\let\!!stringd\empty \let\!!stringe\empty \let\!!stringf\empty
115
116\newdimen\!!widtha \newdimen\!!heighta \newdimen\!!deptha
117\newdimen\!!widthb \newdimen\!!heightb \newdimen\!!depthb
118\newdimen\!!widthc \newdimen\!!heightc \newdimen\!!depthc
119\newdimen\!!widthd \newdimen\!!heightd \newdimen\!!depthd
120
121\newif\if!!donea \newif\if!!doneb \newif\if!!donec
122\newif\if!!doned \newif\if!!donee \newif\if!!donef
123
124\def\!!zerocount {0}
125\def\!!minusone {1}
126\def\!!plusone {1}
127\def\!!plustwo {2}
128\def\!!plusthree {3}
129\def\!!plusfour {4}
130\def\!!plusfive {5}
131\def\!!plussix {6}
132\def\!!plusseven {7}
133\def\!!pluseight {8}
134\def\!!plusnine {9}
135
136\setnewconstant \uprotationangle 0
137\setnewconstant\rightrotationangle 90
138\setnewconstant \downrotationangle 180
139\setnewconstant \leftrotationangle 270
140
141\ifdefined\data \else \let\data \relax \fi
142
143
144
145
146
147
148
149\def\v!prefix! {v!}
150\def\c!prefix! {c!}
151\def\s!prefix! {s!}
152
153\def\s!next {next}
154\def\s!default {default}
155\def\s!dummy {dummy}
156\def\s!unknown {unknown}
157
158\def\s!do {do}
159\def\s!dodo {dodo}
160
161\def\s!complex {complex}
162\def\s!start {start}
163\def\s!simple {simple}
164\def\s!stop {stop}
165
166\def\s!empty {empty}
167
168
169
170
171\let\@EA \singleexpandafter
172\let\@EAEAEA \doubleexpandafter
173\let\@EAEAEAEAEAEA\tripleexpandafter
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189\let\m_syst_helpers_expanded\empty
190
191\protected\def\expanded#1
192 {\xdef\m_syst_helpers_expanded{\noexpand#1}\m_syst_helpers_expanded}
193
194\protected\def\startexpanded#1\stopexpanded
195 {\xdef\m_syst_helpers_expanded{#1}\m_syst_helpers_expanded}
196
197\let\stopexpanded\relax
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216\def\gobbleoneargument #1{}
217\def\gobbletwoarguments #1#2{}
218\def\gobblethreearguments#1#2#3{}
219\def\gobblefourarguments #1#2#3#4{}
220\def\gobblefivearguments #1#2#3#4#5{}
221\def\gobblesixarguments #1#2#3#4#5#6{}
222\def\gobblesevenarguments#1#2#3#4#5#6#7{}
223\def\gobbleeightarguments#1#2#3#4#5#6#7#8{}
224\def\gobbleninearguments #1#2#3#4#5#6#7#8#9{}
225\def\gobbletenarguments #1{\gobbleninearguments}
226
227\def\gobbleoneoptional [#1]{}
228\def\gobbletwooptionals [#1][#2]{}
229\def\gobblethreeoptionals[#1][#2][#3]{}
230\def\gobblefouroptionals [#1][#2][#3][#4]{}
231\def\gobblefiveoptionals [#1][#2][#3][#4][#5]{}
232
233
234
235\let\donothing\empty
236
237\let\m_syst_string_one \empty
238\let\m_syst_string_two \empty
239\let\m_syst_string_three\empty
240\let\m_syst_string_four \empty
241
242\let\m_syst_action_yes \empty
243\let\m_syst_action_nop \empty
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266\let\next \relax
267\let\nextnext \relax
268\let\nextnextnext \relax
269\let\nexttoken \relax
270\let\charactertoken\relax
271
272\let\m_syst_action_yes\relax
273\let\m_syst_action_nop\relax
274
275\def\syst_helpers_inspect_next_character
276 {\ifx\nexttoken\blankspace
277 \expandafter\syst_helpers_reinspect_next_character
278 \else
279 \expandafter\syst_helpers_inspect_next_character_indeed
280 \fi}
281
282\def\syst_helpers_inspect_next_character_indeed
283 {\ifx\nexttoken\charactertoken
284 \expandafter\m_syst_action_yes
285 \else
286 \expandafter\m_syst_action_nop
287 \fi}
288
289\protected\def\doifelsenextchar#1#2#3
290 {\let\charactertoken=#1
291 \def\m_syst_action_yes{#2}
292 \def\m_syst_action_nop{#3}
293 \futurelet\nexttoken\syst_helpers_inspect_next_character}
294
295\protected\def\doifelsenextcharcs#1#2#3
296 {\let\charactertoken=#1
297 \let\m_syst_action_yes#2
298 \let\m_syst_action_nop#3
299 \futurelet\nexttoken\syst_helpers_inspect_next_character}
300
301\let\doifnextcharelse \doifelsenextchar
302\let\doifnextcharcselse\doifelsenextcharcs
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318\newif\if_next_blank_space_token
319
320\let\syst_helpers_next_optional_character_token=[
321
322\def\syst_helpers_inspect_next_optional_character
323 {\ifx\nexttoken\blankspace
324 \expandafter\syst_helpers_reinspect_next_optional_character
325 \else
326 \expandafter\syst_helpers_inspect_next_optional_character_indeed
327 \fi}
328
329\def\syst_helpers_inspect_next_optional_character_indeed
330 {\ifx\nexttoken\syst_helpers_next_optional_character_token
331 \expandafter\m_syst_action_yes
332 \else
333 \expandafter\m_syst_action_nop
334 \fi}
335
336\protected\def\doifelsenextoptional#1#2
337 {\def\m_syst_action_yes{#1}
338 \def\m_syst_action_nop{#2}
339 \let\if_next_blank_space_token\iffalse
340 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
341
342\protected\def\doifelsenextoptionalcs#1#2
343 {\let\m_syst_action_yes#1
344 \let\m_syst_action_nop#2
345 \let\if_next_blank_space_token\iffalse
346 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
347
348\let\doifnextoptionalelse \doifelsenextoptional
349\let\doifnextoptionalcselse\doifelsenextoptionalcs
350
351
352
353
354
355
356
357
358
359
360
361
362
363\let\syst_helpers_next_bgroup_character_token\bgroup
364
365\def\syst_helpers_inspect_next_bgroup_character
366 {\ifx\nexttoken\blankspace
367 \expandafter\syst_helpers_reinspect_next_bgroup_character
368 \else
369 \expandafter\syst_helpers_inspect_next_bgroup_character_indeed
370 \fi}
371
372\def\syst_helpers_inspect_next_bgroup_character_indeed
373 {\ifx\nexttoken\syst_helpers_next_bgroup_character_token
374 \expandafter\m_syst_action_yes
375 \else
376 \expandafter\m_syst_action_nop
377 \fi}
378
379\protected\def\doifelsenextbgroup#1#2
380 {\def\m_syst_action_yes{#1}
381 \def\m_syst_action_nop{#2}
382 \let\if_next_blank_space_token\iffalse
383 \futurelet\nexttoken\syst_helpers_inspect_next_bgroup_character}
384
385\protected\def\doifelsenextbgroupcs#1#2
386 {\let\m_syst_action_yes#1
387 \let\m_syst_action_nop#2
388 \let\if_next_blank_space_token\iffalse
389 \futurelet\nexttoken\syst_helpers_inspect_next_bgroup_character}
390
391\let\doifnextbgroupelse \doifelsenextbgroup
392\let\doifnextbgroupcselse\doifelsenextbgroupcs
393
394\let\syst_helpers_next_parenthesis_character_token(
395
396\def\syst_helpers_inspect_next_parenthesis_character
397 {\ifx\nexttoken\blankspace
398 \expandafter\syst_helpers_reinspect_next_parenthesis_character
399 \else
400 \expandafter\syst_helpers_inspect_next_parenthesis_character_indeed
401 \fi}
402
403\def\syst_helpers_inspect_next_parenthesis_character_indeed
404 {\ifx\nexttoken\syst_helpers_next_parenthesis_character_token
405 \expandafter\m_syst_action_yes
406 \else
407 \expandafter\m_syst_action_nop
408 \fi}
409
410\protected\def\doifelsenextparenthesis#1#2
411 {\def\m_syst_action_yes{#1}
412 \def\m_syst_action_nop{#2}
413 \let\if_next_blank_space_token\iffalse
414 \futurelet\nexttoken\syst_helpers_inspect_next_parenthesis_character}
415
416\let\doifnextparenthesiselse\doifelsenextparenthesis
417
418
419
420\def\syst_helpers_do_if_fast_optional_check_else
421 {\ifx\nexttoken\syst_helpers_next_optional_character_token
422 \expandafter\m_syst_action_yes
423 \else
424 \expandafter\m_syst_action_nop
425 \fi}
426
427\protected\def\doifelsefastoptionalcheck#1#2
428 {\def\m_syst_action_yes{#1}
429 \def\m_syst_action_nop{#2}
430 \futurelet\nexttoken\syst_helpers_do_if_fast_optional_check_else}
431
432\protected\def\doifelsefastoptionalcheckcs#1#2
433 {\let\m_syst_action_yes#1
434 \let\m_syst_action_nop#2
435 \futurelet\nexttoken\syst_helpers_do_if_fast_optional_check_else}
436
437\let\doiffastoptionalcheckelse \doifelsefastoptionalcheck
438\let\doiffastoptionalcheckcselse\doifelsefastoptionalcheckcs
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469\protected\def\assumelongusagecs#1
470 {\let\m_syst_action#1
471 \futurelet\nexttoken\syst_helpers_ignore_spacing}
472
473\def\syst_helpers_ignore_spacing
474 {\ifx\nexttoken\blankspace
475 \singleexpandafter\syst_helpers_ignore_spacing_blankspace
476 \else\ifx\nexttoken\par
477 \doubleexpandafter\syst_helpers_ignore_spacing_partoken
478 \else
479 \doubleexpandafter\m_syst_action
480 \fi\fi}
481
482\def\syst_helpers_ignore_spacing_partoken\par
483 {\futurelet\nexttoken\syst_helpers_ignore_spacing}
484
485
486
487
488
489
490
491
492
493
494
495
496
497 \let\next\:
498
499 \def\:{\let\blankspace= } \:
500
501 \def\:{\syst_helpers_reinspect_next_character}
502 \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\syst_helpers_inspect_next_character}
503
504 \def\:{\syst_helpers_reinspect_next_optional_character}
505 \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
506
507 \def\:{\syst_helpers_reinspect_next_bgroup_character}
508 \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\syst_helpers_inspect_next_bgroup_character}
509
510 \def\:{\syst_helpers_reinspect_next_parenthesis_character}
511 \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\syst_helpers_inspect_next_parenthesis_character}
512
513 \def\:{\syst_helpers_ignore_spacing_blankspace}
514 \expandafter\def\: {\futurelet\nexttoken\syst_helpers_ignore_spacing}
515
516 \let\:\next
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572\def\setvalue #1{\expandafter\def \csname#1\endcsname}
573\def\setgvalue #1{\expandafter\gdef\csname#1\endcsname}
574\def\setevalue #1{\expandafter\edef\csname#1\endcsname}
575\def\setxvalue #1{\expandafter\xdef\csname#1\endcsname}
576\def\getvalue #1{\begincsname#1\endcsname}
577\def\letvalue #1{\expandafter\let \csname#1\endcsname}
578\def\letgvalue #1{\expandafter\glet\csname#1\endcsname}
579\def\resetvalue #1{\expandafter\let \csname#1\endcsname\empty}
580\def\undefinevalue#1{\expandafter\let \csname#1\endcsname\undefined}
581\def\ignorevalue#1#2{\expandafter\let \csname#1\endcsname\empty}
582
583\def\setuvalue #1{\protected\expandafter \def\csname#1\endcsname}
584\def\setuevalue #1{\protected\expandafter\edef\csname#1\endcsname}
585\def\setugvalue #1{\protected\expandafter\gdef\csname#1\endcsname}
586\def\setuxvalue #1{\protected\expandafter\xdef\csname#1\endcsname}
587
588\protected\def\getuvalue#1{\begincsname#1\endcsname}
589
590
591
592
593
594
595
596
597\let\globallet\glet
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632\def\doifelseundefined#1
633 {\ifcsname#1\endcsname
634 \expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments
635 \fi}
636
637\def\doifelsedefined#1
638 {\ifcsname#1\endcsname
639 \expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments
640 \fi}
641
642\def\doifundefined#1
643 {\ifcsname#1\endcsname
644 \expandafter\gobbleoneargument\else\expandafter\firstofoneargument
645 \fi}
646
647\def\doifdefined#1
648 {\ifcsname#1\endcsname
649 \expandafter\firstofoneargument\else\expandafter\gobbleoneargument
650 \fi}
651
652\let\doifundefinedelse\doifelseundefined
653\let\doifdefinedelse \doifelsedefined
654
655
656
657
658
659
660
661
662
663\protected\def\letbeundefined#1
664 {\expandafter\let\csname#1\endcsname\undefined}
665
666\protected\def\localundefine#1
667 {\ifcsname#1\endcsname\expandafter\let\csname#1\endcsname\undefined\fi}
668
669\protected\def\globalundefine#1
670 {\ifcsname#1\endcsname\expandafter\glet\csname#1\endcsname\undefined\fi}
671
672
673
674
675
676
677
678\protected\def\doifelsealldefined#1
679 {\begingroup
680 \donetrue
681 \processcommalist[#1]\syst_helpers_do_if_all_defined_else
682 \ifdone
683 \endgroup\expandafter\firstoftwoarguments
684 \else
685 \endgroup\expandafter\secondoftwoarguments
686 \fi}
687
688\let\doifalldefinedelse\doifelsealldefined
689
690\def\syst_helpers_do_if_all_defined_else#1
691 {\ifcsname#1\endcsname\else
692 \donefalse
693 \expandafter\quitcommalist
694 \fi}
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713\protected\def\doif#1#2
714 {\edef\m_syst_string_one{#1}
715 \edef\m_syst_string_two{#2}
716 \ifx\m_syst_string_one\m_syst_string_two
717 \expandafter\firstofoneargument
718 \else
719 \expandafter\gobbleoneargument
720 \fi}
721
722\protected\def\doifnot#1#2
723 {\edef\m_syst_string_one{#1}
724 \edef\m_syst_string_two{#2}
725 \ifx\m_syst_string_one\m_syst_string_two
726 \expandafter\gobbleoneargument
727 \else
728 \expandafter\firstofoneargument
729 \fi}
730
731\protected\def\doifelse#1#2
732 {\edef\m_syst_string_one{#1}
733 \edef\m_syst_string_two{#2}
734 \ifx\m_syst_string_one\m_syst_string_two
735 \expandafter\firstoftwoarguments
736 \else
737 \expandafter\secondoftwoarguments
738 \fi}
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753\protected\def\doifelseempty#1
754 {\def\m_syst_string_one{#1}
755 \ifx\m_syst_string_one\empty
756 \expandafter\firstoftwoarguments
757 \else
758 \expandafter\secondoftwoarguments
759 \fi}
760
761\let\doifemptyelse\doifelseempty
762
763\protected\def\doifempty#1
764 {\def\m_syst_string_one{#1}
765 \ifx\m_syst_string_one\empty
766 \expandafter\firstofoneargument
767 \else
768 \expandafter\gobbleoneargument
769 \fi}
770
771\protected\def\doifnotempty#1
772 {\def\m_syst_string_one{#1}
773 \ifx\m_syst_string_one\empty
774 \expandafter\gobbleoneargument
775 \else
776 \expandafter\firstofoneargument
777 \fi}
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944\protected\def\doifelseinset#1#2{\clf_doifelseinset{#1}{#2}}
945\protected\def\doifinset #1#2{\clf_doifinset {#1}{#2}}
946\protected\def\doifnotinset #1#2{\clf_doifnotinset {#1}{#2}}
947
948
949\let\doifinsetelse\doifelseinset
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041\protected\def\doifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}}
1042\protected\def\doifcommon #1#2{\clf_doifcommon {#1}{#2}}
1043\protected\def\doifnotcommon #1#2{\clf_doifnotcommon {#1}{#2}}
1044
1045\let\doifcommonelse\doifelsecommon
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079\newcount\commalevel
1080
1081\installsystemnamespace{nextcommalevel}
1082
1083\def\syst_helpers_do_do_do_process_comma_item
1084 {\csname\??nextcommalevel\the\commalevel\endcsname}
1085
1086
1087
1088 \def\syst_helpers_do_process_comma_item
1089 {\futurelet\nexttoken\syst_helpers_do_do_process_comma_item}
1090
1091 \def\syst_helpers_do_do_process_comma_item
1092 {\ifx\nexttoken\blankspace
1093 \expandafter\syst_helpers_re_do_process_comma_item
1094 \else
1095 \expandafter\syst_helpers_do_do_process_comma_item_indeed
1096 \fi}
1097
1098 \def\syst_helpers_do_do_process_comma_item_indeed
1099 {\ifx\nexttoken]
1100 \expandafter\gobbleoneargument
1101 \else
1102 \expandafter\syst_helpers_do_do_do_process_comma_item
1103 \fi}
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115\protected\def\processcommalist[
1116 {\futurelet\nexttoken\syst_helpers_do_check_comma_item}
1117
1118\def\syst_helpers_do_check_comma_item
1119 {\ifx\nexttoken]
1120 \expandafter\gobblethreearguments
1121 \else
1122 \expandafter\syst_helpers_do_process_comma_list
1123 \fi
1124 \relax}
1125
1126
1127
1128
1129
1130
1131
1132
1133\def\syst_helpers_do_process_comma_list#1]#2
1134 {\global\advance\commalevel \plusone
1135 \expandafter\def\csname\??nextcommalevel\the\commalevel\endcsname##1,
1136 {#2{##1}\syst_helpers_do_process_comma_item}
1137 \syst_helpers_do_do_process_comma_item_gobble#1,]\relax
1138 \global\advance\commalevel \minusone }
1139
1140\def\syst_helpers_do_do_process_comma_item_gobble#1{\syst_helpers_do_do_process_comma_item}
1141
1142
1143
1144\protected\def\quitcommalist
1145 {\begingroup\let\syst_helpers_do_process_comma_item\syst_helpers_do_quit_comma_list}
1146
1147\def\syst_helpers_do_quit_comma_list#1]
1148 {\endgroup}
1149
1150\protected\def\quitprevcommalist
1151 {\begingroup\let\syst_helpers_do_process_comma_item\syst_helpers_do_quit_prev_comma_list}
1152
1153\def\syst_helpers_do_quit_prev_comma_list#1]
1154 {\let\syst_helpers_do_process_comma_item\syst_helpers_do_quit_comma_list}
1155
1156
1157
1158
1159
1160
1161 \let\next\:
1162
1163 \def\:{\syst_helpers_re_do_process_comma_item}
1164
1165 \expandafter\def\: {\futurelet\nexttoken\syst_helpers_do_do_process_comma_item}
1166
1167 \let\:\next
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201\protected\def\processcommacommand[#1]
1202 {\normalexpanded{\processcommalist[#1]}}
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217\protected\def\processcommalistwithparameters[#1]#2
1218 {\def\syst_helpers_do_process_comma_list_with_parameters##1{#2[##1]}
1219 \processcommalist[#1]\syst_helpers_do_process_comma_list_with_parameters}
1220
1221
1222
1223
1224
1225
1226\let\syst_helpers_comma_list_step\relax
1227
1228\protected\def\startprocesscommalist[#1]#2\stopprocesscommalist
1229 {\def\syst_helpers_comma_list_step##1{\def\currentcommalistitem{##1}#2}
1230 \processcommalist[#1]\syst_helpers_comma_list_step}
1231
1232\protected\def\startprocesscommacommand[#1]#2\stopprocesscommacommand
1233 {\def\syst_helpers_comma_list_step##1{\def\currentcommalistitem{##1}#2}
1234 \normalexpanded{\processcommalist[#1]}\syst_helpers_comma_list_step}
1235
1236\let\stopprocesscommalist \relax
1237\let\stopprocesscommacommand\relax
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276\newcount\processlevel
1277
1278
1279
1280\protected\def\syst_helpers_do_compare_process_action_a[#1=>#2][#3]
1281 {\edef\m_syst_string_two{#1}
1282 \ifx\m_syst_string_two\s!default
1283 \let\commalistelement\empty
1284 #2
1285 \fi}
1286
1287
1288
1289\protected\def\syst_helpers_do_compare_process_action_b[#1=>#2][#3]
1290 {\edef\m_syst_string_two{#1}
1291 \ifx\m_syst_string_one\m_syst_string_two
1292 \def\commalistelement{#3}
1293 #2
1294 \expandafter\quitcommalist
1295 \else\ifx\m_syst_string_two\s!unknown
1296 \def\commalistelement{#3}
1297 #2
1298 \fi\fi}
1299
1300\protected\def\processaction[#1]#2[
1301 {\edef\m_syst_string_one{#1}
1302 \ifx\m_syst_string_one\empty
1303 \let\syst_helpers_do_compare_process_action\syst_helpers_do_compare_process_action_a
1304 \else
1305 \let\syst_helpers_do_compare_process_action\syst_helpers_do_compare_process_action_b
1306 \fi
1307 \edef\syst_helpers_do_process_action##1{\syst_helpers_do_compare_process_action[##1][#1]}
1308 \processnextcommalist\relax\relax\syst_helpers_do_process_action[}
1309
1310\protected\def\syst_helpers_do_compare_process_action_c[#1=>#2][#3]
1311 {\edef\m_syst_string_one{#1}
1312 \edef\m_syst_string_two{#3}
1313 \ifx\m_syst_string_one\m_syst_string_two
1314 \def\commalistelement{#3}
1315 #2
1316 \expandafter\quitprevcommalist
1317 \else
1318 \edef\m_syst_string_one{#1}
1319 \ifx\m_syst_string_one\s!unknown
1320 \def\commalistelement{#3}
1321 #2
1322 \fi
1323 \fi}
1324
1325\protected\def\processfirstactioninset[#1]
1326 {\edef\m_syst_string_one{#1}
1327 \ifx\m_syst_string_one\empty
1328 \expandafter\processaction
1329 \else
1330 \expandafter\syst_helpers_process_first_action_in_set_indeed
1331 \fi
1332 [#1]}
1333
1334\protected\def\syst_helpers_process_first_action_in_set_indeed[#1]#2[#3]
1335 {\def\syst_helpers_do_process_action##1
1336 {\def\syst_helpers_do_do_process_action####1{\syst_helpers_do_compare_process_action_c[####1][##1]}
1337 \processcommalist[#3]\syst_helpers_do_do_process_action}
1338 \normalexpanded{\processcommalist[#1]}\syst_helpers_do_process_action}
1339
1340\protected\def\syst_helpers_do_compare_process_action_d[#1=>#2][#3]
1341 {\edef\m_syst_string_one{#1}
1342 \edef\m_syst_string_two{#3}
1343 \ifx\m_syst_string_one\m_syst_string_two
1344 \def\commalistelement{#3}
1345 #2
1346 \expandafter\quitcommalist
1347 \else
1348 \edef\m_syst_string_one{#1}
1349 \ifx\m_syst_string_one\s!unknown
1350 \def\commalistelement{#3}
1351 #2
1352 \fi
1353 \fi}
1354
1355\installsystemnamespace{nextactionlevel}
1356
1357\protected\def\syst_helpers_do_process_all_actions_in_set
1358 {\csname\??nextactionlevel\the\processlevel\endcsname}
1359
1360\protected\def\processallactionsinset[#1]
1361 {\edef\m_syst_string_one{#1}
1362 \ifx\m_syst_string_one\empty
1363 \expandafter\processaction
1364 \else
1365 \expandafter\syst_helpers_process_all_actions_in_set_indeed
1366 \fi
1367 [#1]}
1368
1369\protected\def\syst_helpers_process_all_actions_in_set_indeed[#1]#2[#3]
1370 {\advance\processlevel \plusone
1371 \expandafter\def\csname\??nextactionlevel\the\processlevel\endcsname##1
1372 {\def\syst_helpers_do_do_process_action####1{\syst_helpers_do_compare_process_action_d[####1][##1]}
1373 \processcommalist[#3]\syst_helpers_do_do_process_action}
1374 \normalexpanded{\processcommalist[#1]}\syst_helpers_do_process_all_actions_in_set
1375 \advance\processlevel\minusone}
1376
1377
1378
1379\protected\def\processnextcommalist#1#2#3[#4#5]
1380 {#1
1381 \let\nexttoken#4
1382 \global\advance\commalevel \plusone
1383 \expandafter\def\csname\??nextcommalevel\the\commalevel\endcsname##1,
1384 {#3{##1}\syst_helpers_do_process_comma_item}
1385 \syst_helpers_do_do_process_comma_item#4#5,]\relax
1386 \global\advance\commalevel\minusone
1387 #2}
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402\let\firstcharacter \empty
1403\let\remainingcharacters\empty
1404
1405\protected\def\getfirstcharacter #1{\clf_getfirstcharacter{#1}}
1406\protected\def\doifelsefirstchar #1#2{\clf_doifelsefirstchar{#1}{#2}}
1407\protected\def\thefirstcharacter #1{\clf_thefirstcharacter{#1}}
1408\protected\def\theremainingcharacters#1{\clf_theremainingcharacters{#1}}
1409
1410\let\doiffirstcharelse\doifelsefirstchar
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421\let\m_syst_sub_string\empty
1422
1423\protected\def\doifelseinstring#1
1424 {\edef\m_syst_sub_string{#1}
1425 \ifx\m_syst_sub_string\empty
1426 \expandafter\thirdofthreearguments
1427 \else
1428 \expandafter\syst_helpers_do_if_in_string_else_indeed
1429 \fi}
1430
1431\let\doifinstringelse\doifelseinstring
1432
1433\protected\def\syst_helpers_do_if_in_string_else_indeed#1
1434 {\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}
1435 \expandafter\firstoftwoarguments
1436 \else
1437 \expandafter\secondoftwoarguments
1438 \fi}
1439
1440\protected\def\doifinstring#1
1441 {\edef\m_syst_sub_string{#1}
1442 \ifx\m_syst_sub_string\empty
1443 \expandafter\gobbletwoarguments
1444 \else
1445 \expandafter\syst_helpers_do_if_in_string_indeed
1446 \fi}
1447
1448\protected\def\syst_helpers_do_if_in_string_indeed#1
1449 {\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}
1450 \expandafter\firstofoneargument
1451 \else
1452 \expandafter\gobbleoneargument
1453 \fi}
1454
1455\protected\def\doifnotinstring#1
1456 {\edef\m_syst_sub_string{#1}
1457 \ifx\m_syst_sub_string\empty
1458
1459 \expandafter\secondoftwoarguments
1460 \else
1461 \expandafter\syst_helpers_do_if_not_in_string_indeed
1462 \fi}
1463
1464\protected\def\syst_helpers_do_if_not_in_string_indeed#1
1465 {\syst_helpers_do_if_in_string_else\m_syst_sub_string{#1}
1466 \expandafter\gobbleoneargument
1467 \else
1468 \expandafter\firstofoneargument
1469 \fi}
1470
1471
1472
1473
1474
1475
1476
1477
1478\protected\def\syst_helpers_do_if_in_string_else#1#2
1479 {\expandafter\def\expandafter\syst_helpers_do_do_if_in_string_else
1480 \expandafter##\expandafter1#1##2##30004{\unless\ifx##20003}
1481 \expandafter\syst_helpers_do_do_if_in_string_else\normalexpanded{#2#1}000300030004}
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504\protected\def\syst_helpers_do_if_in_csname_else#1#2
1505 {\def\syst_helpers_do_do_if_in_csname_else##1#1##2##30004
1506 {\unless\ifx##20003}
1507 \expandafter\syst_helpers_do_do_if_in_csname_else#2#1000300030004}
1508
1509\protected\def\doifelseincsname#1#2
1510 {\normalexpanded{\syst_helpers_do_if_in_csname_else{#1}}{#2}
1511 \expandafter\firstoftwoarguments
1512 \else
1513 \expandafter\secondoftwoarguments
1514 \fi}
1515
1516\let\doifincsnameelse\doifelseincsname
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532\def\doifelsenumber#1
1533 {\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space
1534 \expandafter\secondoftwoarguments
1535 \else
1536 \expandafter\firstoftwoarguments
1537 \fi}
1538
1539\def\doifnumber#1
1540 {\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space
1541 \expandafter\firstofoneargument
1542 \else
1543 \expandafter\gobbleoneargument
1544 \fi}
1545
1546\def\doifnotnumber#1
1547 {\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space
1548 \expandafter\gobbleoneargument
1549 \else
1550 \expandafter\firstofoneargument
1551 \fi}
1552
1553\let\doifnumberelse\doifelsenumber
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564\def\percentdimen#1#2
1565 {\dimexpr\clf_percentageof{#2}\dimexpr#1\relax}
1566
1567\protected\def\setpercentdimen#1#2
1568 {#1=\clf_percentageof{#2}\dimexpr#1\relax}
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595\protected\def\makerawcommalist[#1]#2
1596 {\def\syst_helpers_do_make_raw_comma_list##1
1597 {\ifx#2\empty
1598 \def#2{##1}
1599 \else
1600 \expandafter\def\expandafter#2\expandafter{#2,##1}
1601 \fi}
1602 \let#2\empty
1603 \processcommalist[#1]\syst_helpers_do_make_raw_comma_list}
1604
1605\def\syst_helpers_raw_process_comma_item#1,#2
1606 {\if]#1\else
1607 \csname\??nextcommalevel\the\commalevel\endcsname{#1}
1608 \expandafter\syst_helpers_raw_process_comma_item
1609 \fi#2}
1610
1611\protected\def\rawprocesscommalist[#1]#2
1612 {\global\advance\commalevel \plusone
1613 \expandafter\let\csname\??nextcommalevel\the\commalevel\endcsname#2
1614 \expandafter\syst_helpers_raw_process_comma_item#1,],
1615 \global\advance\commalevel \minusone }
1616
1617\protected\def\rawprocesscommacommand[#1]
1618 {\normalexpanded{\rawprocesscommalist[#1]}}
1619
1620
1621
1622\protected\def\syst_helpers_fast_process_comma_item#1,#2
1623 {\if]#1\else
1624 \syst_helpers_fast_process_comma_command{#1}
1625 \expandafter\syst_helpers_fast_process_comma_item
1626 \fi#2}
1627
1628\protected\def\fastprocesscommalist[#1]#2
1629 {\let\syst_helpers_fast_process_comma_command#2
1630 \expandafter\syst_helpers_fast_process_comma_item#1,],}
1631
1632\protected\def\fastprocesscommacommand[#1]#2
1633 {\let\syst_helpers_fast_process_comma_command#2
1634 \normalexpanded{\syst_helpers_fast_process_comma_item#1},],}
1635
1636
1637
1638
1639\def\m_syst_two_commas{,,}
1640
1641\protected\def\rawdoifelseinset#1
1642 {\edef\m_syst_sub_string{,#1,}
1643 \ifx\m_syst_sub_string\m_syst_two_commas
1644 \expandafter\thirdofthreearguments
1645 \else
1646 \expandafter\syst_helpers_raw_do_if_in_set_else
1647 \fi}
1648
1649\let\rawdoifinsetelse\rawdoifelseinset
1650
1651\protected\def\syst_helpers_raw_do_if_in_set_else#1
1652 {\syst_helpers_do_if_in_string_else\m_syst_sub_string{,#1,}
1653 \expandafter\firstoftwoarguments
1654 \else
1655 \expandafter\secondoftwoarguments
1656 \fi}
1657
1658\protected\def\rawdoifinset#1
1659 {\edef\m_syst_sub_string{,#1,}
1660 \ifx\m_syst_sub_string\m_syst_two_commas
1661 \expandafter\gobbletwoarguments
1662 \else
1663 \expandafter\syst_helpers_raw_do_if_in_set
1664 \fi}
1665
1666\protected\def\syst_helpers_raw_do_if_in_set#1
1667 {\syst_helpers_do_if_in_string_else\m_syst_sub_string{,#1,}
1668 \expandafter\firstofoneargument
1669 \else
1670 \expandafter\gobbleoneargument
1671 \fi}
1672
1673
1674
1675\def\syst_helpers_do_raw_process_action[#1][#2]
1676 {\def\syst_helpers_do_do_raw_process_action##1,#1=>##2,##30004
1677 {\if##3@\else
1678 \def\m_syst_helpers_process_action{##2}
1679 \fi}
1680 \syst_helpers_do_do_raw_process_action,#2,#1=>,@0004}
1681
1682\protected\def\rawprocessaction[#1]#2[#3]
1683 {\edef\m_syst_string_one{#1}
1684 \edef\m_syst_string_two{undefined}
1685 \let\m_syst_helpers_process_action\m_syst_string_two
1686 \ifx\m_syst_string_one\empty
1687 \expandafter\syst_helpers_do_raw_process_action\expandafter[\s!default][#3]
1688 \else
1689 \expandafter\syst_helpers_do_raw_process_action\expandafter[\m_syst_string_one][#3]
1690 \ifx\m_syst_helpers_process_action\m_syst_string_two
1691 \expandafter\syst_helpers_do_raw_process_action\expandafter[\s!unknown][#3]
1692 \fi
1693 \fi
1694 \ifx\m_syst_helpers_process_action\m_syst_string_two
1695 \else
1696 \m_syst_helpers_process_action
1697 \fi}
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722\def\dosetvalue#1#2
1723 {\expandafter\def\csname#1#2\endcsname}
1724
1725\def\dosetevalue#1#2
1726 {\expandafter\edef\csname#1#2\endcsname}
1727
1728\def\dosetgvalue#1#2
1729 {\expandafter\gdef\csname#1#2\endcsname}
1730
1731\def\doresetvalue#1#2
1732 {\expandafter\let\csname#1#2\endcsname\empty}
1733
1734\def\doignorevalue#1#2#3
1735 {\expandafter\let\csname#1#2\endcsname\empty}
1736
1737\def\docopyvalue#1#2#3
1738 {\expandafter\def\csname#1#3\endcsname{\csname#2#3\endcsname}}
1739
1740
1741
1742\edef\m_syst_protected{\detokenize{protected}}
1743
1744\protected\def\aliasmacro#1#2
1745 {\doifinstring{\m_syst_protected}{\meaning#2}\protected
1746 \def#1{#2}}
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780\protected\def\showassignerror#1#2
1781 {\writestatus{setup}{missing or ungrouped = after #1 in line #2}}
1782
1783\protected\def\doassignempty[#1][#2=#3]
1784 {\ifcsname#1#2\endcsname\else\dosetvalue{#1}{#2}{#3}\fi}
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851\let\currentvalue\empty
1852
1853\protected\def\getparameters {\dogetparameters\dosetvalue}
1854\protected\def\geteparameters {\dogetparameters\dosetevalue}
1855\protected\def\getgparameters {\dogetparameters\dosetgvalue}
1856\protected\def\getxparameters {\dogetparameters\dosetxvalue}
1857\protected\def\forgetparameters{\dogetparameters\doignorevalue}
1858
1859\let\getexpandedparameters\geteparameters
1860
1861\protected\def\dogetparameters#1[#2]#3[#4
1862 {\if\noexpand#4]
1863 \expandafter\gobbleoneargument
1864 \else
1865 \let\setsomevalue#1
1866 \def\syst_helpers_get_parameters_assign{\syst_helpers_get_parameters_assign_indeed#2}
1867 \expandafter\syst_helpers_get_parameters
1868 \fi#4}
1869
1870\def\syst_helpers_get_parameters#1]
1871 {\xprocesscommaitem#1,],0004}
1872
1873\def\syst_helpers_process_comma_item#1,#2
1874 {\if,#1,
1875 \expandafter\syst_helpers_process_comma_item
1876 \else\if]#1
1877 \doubleexpandafter\gobbleoneargument
1878 \else
1879 \syst_helpers_get_parameters_assign0004#1==\empty0004
1880 \doubleexpandafter\syst_helpers_process_comma_item
1881 \fi\fi#2}
1882
1883\def\syst_helpers_assign_error#1#2#3
1884 {\showassignerror{#2}{\the\inputlineno\space(#1)}}
1885
1886\def\syst_helpers_get_parameters_assign_normal#10004#2=#3=#4#50004
1887 {\ifx\empty#2\empty
1888 \expandafter\syst_helpers_assign_error
1889 \else\ifx#4\empty
1890 \doubleexpandafter\syst_helpers_assign_error
1891 \else
1892 \doubleexpandafter\setsomevalue
1893 \fi\fi
1894 {#1}{#2}{#3}}
1895
1896\def\syst_helpers_get_parameters_assign_error#10004#2=#3=#4#50004
1897 {\ifx\empty#2\empty
1898 \expandafter\syst_helpers_assign_error
1899 \else\ifx#4\empty
1900 \doubleexpandafter\syst_helpers_assign_error
1901 \else
1902 \ifcsname#1#2\endcsname
1903 \expandafter\let\expandafter\currentvalue\csname#1#2\endcsname
1904 \else
1905 \let\currentvalue\empty
1906 \fi
1907 \doubleexpandafter\setsomevalue
1908 \fi\fi
1909 {#1}{#2}{#3}}
1910
1911\let\syst_helpers_get_parameters_assign_indeed\syst_helpers_get_parameters_assign_normal
1912
1913\protected\def\doassign [#1][#2]{\let\setsomevalue\dosetvalue \syst_helpers_get_parameters_assign_indeed#10004#2==\empty0004}
1914\protected\def\doeassign [#1][#2]{\let\setsomevalue\dosetevalue \syst_helpers_get_parameters_assign_indeed#10004#2==\empty0004}
1915\protected\def\undoassign[#1][#2]{\let\setsomevalue\doresetvalue\syst_helpers_get_parameters_assign_indeed#10004#2==\empty0004}
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931\protected\def\processassignmentlist[#1]#2
1932 {\def\syst_helpers_process_assignment_entry##1{#2}
1933 \dogetparameters\syst_helpers_process_assignment_entry[][#1]}
1934
1935\protected\def\processassignmentcommand[#1]
1936 {\normalexpanded{\processassignmentlist[#1]}}
1937
1938\protected\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist
1939 {\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}
1940 \processassignmentlist[#1]\currentassignmentlistcommand}
1941
1942\protected\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand
1943 {\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}
1944 \normalexpanded{\processassignmentlist[#1]}\currentassignmentlistcommand}
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980\def\syst_helpers_get_parameters_normal#1]
1981 {\syst_helpers_process_comma_item#1,],0004}
1982
1983\def\syst_helpers_get_parameters_expanded#1]
1984 {\let\dosetnvalue\setsomevalue
1985 \let\setsomevalue\dosetevalue
1986 \let\syst_helpers_get_parameters_assign_indeed\syst_helpers_get_parameters_assign_error
1987 \let\setsomevalue\dosetevalue
1988 \syst_helpers_process_comma_item#1,],0004
1989 \let\syst_helpers_get_parameters_assign_indeed\syst_helpers_get_parameters_assign_normal
1990 \let\setsomevalue\dosetnvalue
1991 \let\syst_helpers_get_parameters\syst_helpers_get_parameters_normal
1992 \let\currentvalue\empty}
1993
1994\let\syst_helpers_get_parameters\syst_helpers_get_parameters_normal
1995
1996\protected\def\expandparameters
1997 {\let\syst_helpers_get_parameters\syst_helpers_get_parameters_expanded}
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009\protected\def\getemptyparameters[#1]#2[#3]
2010 {\def\syst_helpers_get_empty_parameters##1{\doassignempty[#1][##1]}
2011 \processcommalist[#3]\syst_helpers_get_empty_parameters}
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042\protected\def\copyparameters[#1]#2[#3]#4[#5]
2043 {\doifnot{#1}{#3}
2044 {\def\syst_helpers_copy_parameter{\docopyvalue{#1}{#3}}
2045 \processcommalist[#5]\syst_helpers_copy_parameter}}
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060\newif\ifparameters
2061
2062\def\syst_helpers_check_parameters#1=#2#30004
2063 {\if#20003\parametersfalse\else\parameterstrue\fi}
2064
2065\protected\def\checkparameters[#1]
2066 {\syst_helpers_check_parameters#1=000300030004}
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095\newcount\commalistcounter
2096
2097\def\commalistsize{0}
2098
2099\def\syst_helpers_get_comma_list_size#1
2100 {\advance\commalistcounter\plusone}
2101
2102\protected\def\getcommalistsize#1]
2103 {\commalistcounter\zerocount
2104 \processcommalist#1]\syst_helpers_get_comma_list_size
2105 \edef\commalistsize{\the\commalistcounter}}
2106
2107
2108
2109
2110
2111
2112\protected\def\getcommacommandsize[#1]
2113 {\normalexpanded{\getcommalistsize[#1]}}
2114
2115\def\syst_helpers_get_from_comma_list#1
2116 {\advance\commalistcounter \minusone
2117 \ifcase\commalistcounter
2118 \def\commalistelement{#1}
2119 \expandafter\quitcommalist
2120 \fi}
2121
2122\protected\def\getfromcommalist[#1]#2[#3]
2123 {\let\commalistelement\empty
2124 \commalistcounter#3\relax
2125 \processcommalist[#1]\syst_helpers_get_from_comma_list}
2126
2127\protected\def\getfromcommacommand[#1]
2128 {\normalexpanded{\getfromcommalist[#1]}}
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162\def\syst_helpers_get_comma_list_element#1\from#2,#3,#4,#5,#6,#7,#8\to#9
2163 {\edef#9{\ifcase#1\relax\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}}
2164
2165\def\dogetcommacommandelement#1\from#2\to
2166 {\expandafter\syst_helpers_get_comma_list_element\expandafter#1\expandafter\from#2,,,,,,\to}
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237\newif\iffirstargument
2238\newif\ifsecondargument
2239\newif\ifthirdargument
2240\newif\iffourthargument
2241\newif\iffifthargument
2242\newif\ifsixthargument
2243\newif\ifseventhargument
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308\newtoks\t_syst_aux
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351\def\syst_helpers_empty_spaced_six {\the\t_syst_aux[][][][][][] }
2352\def\syst_helpers_empty_normal_six {\the\t_syst_aux[][][][][][]}
2353\def\syst_helpers_empty_spaced_five {\the\t_syst_aux[][][][][] }
2354\def\syst_helpers_empty_normal_five {\the\t_syst_aux[][][][][]}
2355\def\syst_helpers_empty_spaced_four {\the\t_syst_aux[][][][] }
2356\def\syst_helpers_empty_normal_four {\the\t_syst_aux[][][][]}
2357\def\syst_helpers_empty_spaced_three{\the\t_syst_aux[][][] }
2358\def\syst_helpers_empty_normal_three{\the\t_syst_aux[][][]}
2359\def\syst_helpers_empty_spaced_two {\the\t_syst_aux[][] }
2360\def\syst_helpers_empty_normal_two {\the\t_syst_aux[][]}
2361\def\syst_helpers_empty_spaced_one {\the\t_syst_aux[] }
2362\def\syst_helpers_empty_normal_one {\the\t_syst_aux[]}
2363
2364\def\syst_helpers_single_empty_one_yes {\firstargumenttrue \the\t_syst_aux}
2365\def\syst_helpers_double_empty_two_yes {\secondargumenttrue \the\t_syst_aux}
2366\def\syst_helpers_triple_empty_three_yes {\thirdargumenttrue \the\t_syst_aux}
2367\def\syst_helpers_quadruple_empty_four_yes {\fourthargumenttrue \the\t_syst_aux}
2368\def\syst_helpers_quintuple_empty_five_yes {\fifthargumenttrue \the\t_syst_aux}
2369\def\syst_helpers_sixtuple_empty_six_yes {\sixthargumenttrue \the\t_syst_aux}
2370\def\syst_helpers_seventuple_empty_seven_yes{\seventhargumenttrue\the\t_syst_aux}
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384\protected\def\dosingleempty#1
2385 {
2386 \t_syst_aux{#1}
2387 \let\m_syst_action_yes\syst_helpers_single_empty_one_yes
2388 \let\m_syst_action_nop\syst_helpers_single_empty_one_nop
2389 \let\if_next_blank_space_token\iffalse
2390 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2391
2392\def\syst_helpers_single_empty_one_nop
2393 {\firstargumentfalse
2394 \the\t_syst_aux[]}
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426\protected\def\dodoubleempty#1
2427 {
2428 \t_syst_aux{#1}
2429 \let\m_syst_action_yes\syst_helpers_double_empty_one_yes
2430 \let\m_syst_action_nop\syst_helpers_double_empty_one_nop
2431 \let\if_next_blank_space_token\iffalse
2432 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2433
2434\def\syst_helpers_double_empty_one_yes[#1]
2435 {\firstargumenttrue
2436 \toksapp\t_syst_aux{[{#1}]}
2437 \let\m_syst_action_yes\syst_helpers_double_empty_two_yes
2438 \let\m_syst_action_nop\syst_helpers_double_empty_two_nop
2439 \let\if_next_blank_space_token\iffalse
2440 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2441
2442\def\syst_helpers_double_empty_one_nop
2443 {\firstargumentfalse
2444 \secondargumentfalse
2445 \the\t_syst_aux[][]}
2446
2447\def\syst_helpers_double_empty_two_nop
2448 {\secondargumentfalse
2449 \if_next_blank_space_token
2450 \expandafter\syst_helpers_empty_spaced_one
2451 \else
2452 \expandafter\syst_helpers_empty_normal_one
2453 \fi}
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503\protected\def\dotripleempty#1
2504 {
2505 \t_syst_aux{#1}
2506 \let\m_syst_action_yes\syst_helpers_triple_empty_one_yes
2507 \let\m_syst_action_nop\syst_helpers_triple_empty_one_nop
2508 \let\if_next_blank_space_token\iffalse
2509 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2510
2511\def\syst_helpers_triple_empty_one_yes[#1]
2512 {\firstargumenttrue
2513 \toksapp\t_syst_aux{[{#1}]}
2514 \let\m_syst_action_yes\syst_helpers_triple_empty_two_yes
2515 \let\m_syst_action_nop\syst_helpers_triple_empty_two_nop
2516 \let\if_next_blank_space_token\iffalse
2517 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2518
2519\def\syst_helpers_triple_empty_two_yes[#1]
2520 {\secondargumenttrue
2521 \toksapp\t_syst_aux{[{#1}]}
2522 \let\m_syst_action_yes\syst_helpers_triple_empty_three_yes
2523 \let\m_syst_action_nop\syst_helpers_triple_empty_three_nop
2524 \let\if_next_blank_space_token\iffalse
2525 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2526
2527\def\syst_helpers_triple_empty_one_nop
2528 {\firstargumentfalse
2529 \secondargumentfalse
2530 \thirdargumentfalse
2531 \the\t_syst_aux[][][]}
2532
2533\def\syst_helpers_triple_empty_two_nop
2534 {\secondargumentfalse
2535 \thirdargumentfalse
2536 \if_next_blank_space_token
2537 \expandafter\syst_helpers_empty_spaced_two
2538 \else
2539 \expandafter\syst_helpers_empty_normal_two
2540 \fi}
2541
2542\def\syst_helpers_triple_empty_three_nop
2543 {\thirdargumentfalse
2544 \if_next_blank_space_token
2545 \expandafter\syst_helpers_empty_spaced_one
2546 \else
2547 \expandafter\syst_helpers_empty_normal_one
2548 \fi}
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617\protected\def\doquadrupleempty#1
2618 {
2619 \t_syst_aux{#1}
2620 \let\m_syst_action_yes\syst_helpers_quadruple_empty_one_yes
2621 \let\m_syst_action_nop\syst_helpers_quadruple_empty_one_nop
2622 \let\if_next_blank_space_token\iffalse
2623 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2624
2625\def\syst_helpers_quadruple_empty_one_yes[#1]
2626 {\firstargumenttrue
2627 \toksapp\t_syst_aux{[{#1}]}
2628 \let\m_syst_action_yes\syst_helpers_quadruple_empty_two_yes
2629 \let\m_syst_action_nop\syst_helpers_quadruple_empty_two_nop
2630 \let\if_next_blank_space_token\iffalse
2631 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2632
2633\def\syst_helpers_quadruple_empty_two_yes[#1]
2634 {\secondargumenttrue
2635 \toksapp\t_syst_aux{[{#1}]}
2636 \let\m_syst_action_yes\syst_helpers_quadruple_empty_three_yes
2637 \let\m_syst_action_nop\syst_helpers_quadruple_empty_three_nop
2638 \let\if_next_blank_space_token\iffalse
2639 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2640
2641\def\syst_helpers_quadruple_empty_three_yes[#1]
2642 {\thirdargumenttrue
2643 \toksapp\t_syst_aux{[{#1}]}
2644 \let\m_syst_action_yes\syst_helpers_quadruple_empty_four_yes
2645 \let\m_syst_action_nop\syst_helpers_quadruple_empty_four_nop
2646 \let\if_next_blank_space_token\iffalse
2647 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2648
2649\def\syst_helpers_quadruple_empty_one_nop
2650 {\firstargumentfalse
2651 \secondargumentfalse
2652 \thirdargumentfalse
2653 \fourthargumentfalse
2654 \the\t_syst_aux[][][][]}
2655
2656\def\syst_helpers_quadruple_empty_two_nop
2657 {\secondargumentfalse
2658 \thirdargumentfalse
2659 \fourthargumentfalse
2660 \if_next_blank_space_token
2661 \expandafter\syst_helpers_empty_spaced_three
2662 \else
2663 \expandafter\syst_helpers_empty_normal_three
2664 \fi}
2665
2666\def\syst_helpers_quadruple_empty_three_nop
2667 {\thirdargumentfalse
2668 \fourthargumentfalse
2669 \if_next_blank_space_token
2670 \expandafter\syst_helpers_empty_spaced_two
2671 \else
2672 \expandafter\syst_helpers_empty_normal_two
2673 \fi}
2674
2675\def\syst_helpers_quadruple_empty_four_nop
2676 {\fourthargumentfalse
2677 \if_next_blank_space_token
2678 \expandafter\syst_helpers_empty_spaced_one
2679 \else
2680 \expandafter\syst_helpers_empty_normal_one
2681 \fi}
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770\protected\def\doquintupleempty#1
2771 {
2772 \t_syst_aux{#1}
2773 \let\m_syst_action_yes\syst_helpers_quintuple_empty_one_yes
2774 \let\m_syst_action_nop\syst_helpers_quintuple_empty_one_nop
2775 \let\if_next_blank_space_token\iffalse
2776 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2777
2778\def\syst_helpers_quintuple_empty_one_yes[#1]
2779 {\firstargumenttrue
2780 \toksapp\t_syst_aux{[{#1}]}
2781 \let\m_syst_action_yes\syst_helpers_quintuple_empty_two_yes
2782 \let\m_syst_action_nop\syst_helpers_quintuple_empty_two_nop
2783 \let\if_next_blank_space_token\iffalse
2784 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2785
2786\def\syst_helpers_quintuple_empty_two_yes[#1]
2787 {\secondargumenttrue
2788 \toksapp\t_syst_aux{[{#1}]}
2789 \let\m_syst_action_yes\syst_helpers_quintuple_empty_three_yes
2790 \let\m_syst_action_nop\syst_helpers_quintuple_empty_three_nop
2791 \let\if_next_blank_space_token\iffalse
2792 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2793
2794\def\syst_helpers_quintuple_empty_three_yes[#1]
2795 {\thirdargumenttrue
2796 \toksapp\t_syst_aux{[{#1}]}
2797 \let\m_syst_action_yes\syst_helpers_quintuple_empty_four_yes
2798 \let\m_syst_action_nop\syst_helpers_quintuple_empty_four_nop
2799 \let\if_next_blank_space_token\iffalse
2800 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2801
2802\def\syst_helpers_quintuple_empty_four_yes[#1]
2803 {\fourthargumenttrue
2804 \toksapp\t_syst_aux{[{#1}]}
2805 \let\m_syst_action_yes\syst_helpers_quintuple_empty_five_yes
2806 \let\m_syst_action_nop\syst_helpers_quintuple_empty_five_nop
2807 \let\if_next_blank_space_token\iffalse
2808 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2809
2810\def\syst_helpers_quintuple_empty_one_nop
2811 {\firstargumentfalse
2812 \secondargumentfalse
2813 \thirdargumentfalse
2814 \fourthargumentfalse
2815 \fifthargumentfalse
2816 \the\t_syst_aux[][][][][]}
2817
2818\def\syst_helpers_quintuple_empty_two_nop
2819 {\secondargumentfalse
2820 \thirdargumentfalse
2821 \fourthargumentfalse
2822 \fifthargumentfalse
2823 \if_next_blank_space_token
2824 \expandafter\syst_helpers_empty_spaced_four
2825 \else
2826 \expandafter\syst_helpers_empty_normal_four
2827 \fi}
2828
2829\def\syst_helpers_quintuple_empty_three_nop
2830 {\thirdargumentfalse
2831 \fourthargumentfalse
2832 \fifthargumentfalse
2833 \if_next_blank_space_token
2834 \expandafter\syst_helpers_empty_spaced_three
2835 \else
2836 \expandafter\syst_helpers_empty_normal_three
2837 \fi}
2838
2839\def\syst_helpers_quintuple_empty_four_nop
2840 {\fourthargumentfalse
2841 \fifthargumentfalse
2842 \if_next_blank_space_token
2843 \expandafter\syst_helpers_empty_spaced_two
2844 \else
2845 \expandafter\syst_helpers_empty_normal_two
2846 \fi}
2847
2848\def\syst_helpers_quintuple_empty_five_nop
2849 {\fifthargumentfalse
2850 \if_next_blank_space_token
2851 \expandafter\syst_helpers_empty_spaced_one
2852 \else
2853 \expandafter\syst_helpers_empty_normal_one
2854 \fi}
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964\protected\def\dosixtupleempty#1
2965 {
2966 \t_syst_aux{#1}
2967 \let\m_syst_action_yes\syst_helpers_sixtuple_empty_one_yes
2968 \let\m_syst_action_nop\syst_helpers_sixtuple_empty_one_nop
2969 \let\if_next_blank_space_token\iffalse
2970 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2971
2972\def\syst_helpers_sixtuple_empty_one_yes[#1]
2973 {\firstargumenttrue
2974 \toksapp\t_syst_aux{[{#1}]}
2975 \let\m_syst_action_yes\syst_helpers_sixtuple_empty_two_yes
2976 \let\m_syst_action_nop\syst_helpers_sixtuple_empty_two_nop
2977 \let\if_next_blank_space_token\iffalse
2978 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2979
2980\def\syst_helpers_sixtuple_empty_two_yes[#1]
2981 {\secondargumenttrue
2982 \toksapp\t_syst_aux{[{#1}]}
2983 \let\m_syst_action_yes\syst_helpers_sixtuple_empty_three_yes
2984 \let\m_syst_action_nop\syst_helpers_sixtuple_empty_three_nop
2985 \let\if_next_blank_space_token\iffalse
2986 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2987
2988\def\syst_helpers_sixtuple_empty_three_yes[#1]
2989 {\thirdargumenttrue
2990 \toksapp\t_syst_aux{[{#1}]}
2991 \let\m_syst_action_yes\syst_helpers_sixtuple_empty_four_yes
2992 \let\m_syst_action_nop\syst_helpers_sixtuple_empty_four_nop
2993 \let\if_next_blank_space_token\iffalse
2994 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
2995
2996\def\syst_helpers_sixtuple_empty_four_yes[#1]
2997 {\fourthargumenttrue
2998 \toksapp\t_syst_aux{[{#1}]}
2999 \let\m_syst_action_yes\syst_helpers_sixtuple_empty_five_yes
3000 \let\m_syst_action_nop\syst_helpers_sixtuple_empty_five_nop
3001 \let\if_next_blank_space_token\iffalse
3002 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3003
3004\def\syst_helpers_sixtuple_empty_five_yes[#1]
3005 {\fifthargumenttrue
3006 \toksapp\t_syst_aux{[{#1}]}
3007 \let\m_syst_action_yes\syst_helpers_sixtuple_empty_six_yes
3008 \let\m_syst_action_nop\syst_helpers_sixtuple_empty_six_nop
3009 \let\if_next_blank_space_token\iffalse
3010 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3011
3012\def\syst_helpers_sixtuple_empty_one_nop
3013 {\firstargumentfalse
3014 \secondargumentfalse
3015 \thirdargumentfalse
3016 \fourthargumentfalse
3017 \fifthargumentfalse
3018 \sixthargumentfalse
3019 \the\t_syst_aux[][][][][][]}
3020
3021\def\syst_helpers_sixtuple_empty_two_nop
3022 {\secondargumentfalse
3023 \thirdargumentfalse
3024 \fourthargumentfalse
3025 \fifthargumentfalse
3026 \sixthargumentfalse
3027 \if_next_blank_space_token
3028 \expandafter\syst_helpers_empty_spaced_five
3029 \else
3030 \expandafter\syst_helpers_empty_normal_five
3031 \fi}
3032
3033\def\syst_helpers_sixtuple_empty_three_nop
3034 {\thirdargumentfalse
3035 \fourthargumentfalse
3036 \fifthargumentfalse
3037 \sixthargumentfalse
3038 \if_next_blank_space_token
3039 \expandafter\syst_helpers_empty_spaced_four
3040 \else
3041 \expandafter\syst_helpers_empty_normal_four
3042 \fi}
3043
3044\def\syst_helpers_sixtuple_empty_four_nop
3045 {\fourthargumentfalse
3046 \fifthargumentfalse
3047 \sixthargumentfalse
3048 \if_next_blank_space_token
3049 \expandafter\syst_helpers_empty_spaced_three
3050 \else
3051 \expandafter\syst_helpers_empty_normal_three
3052 \fi}
3053
3054\def\syst_helpers_sixtuple_empty_five_nop
3055 {\fifthargumentfalse
3056 \sixthargumentfalse
3057 \if_next_blank_space_token
3058 \expandafter\syst_helpers_empty_spaced_two
3059 \else
3060 \expandafter\syst_helpers_empty_normal_two
3061 \fi}
3062
3063\def\syst_helpers_sixtuple_empty_six_nop
3064 {\sixthargumentfalse
3065 \if_next_blank_space_token
3066 \expandafter\syst_helpers_empty_spaced_one
3067 \else
3068 \expandafter\syst_helpers_empty_normal_one
3069 \fi}
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201\protected\def\doseventupleempty#1
3202 {
3203 \t_syst_aux{#1}
3204 \let\m_syst_action_yes\syst_helpers_seventuple_empty_one_yes
3205 \let\m_syst_action_nop\syst_helpers_seventuple_empty_one_nop
3206 \let\if_next_blank_space_token\iffalse
3207 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3208
3209\def\syst_helpers_seventuple_empty_one_yes[#1]
3210 {\firstargumenttrue
3211 \toksapp\t_syst_aux{[{#1}]}
3212 \let\m_syst_action_yes\syst_helpers_seventuple_empty_two_yes
3213 \let\m_syst_action_nop\syst_helpers_seventuple_empty_two_nop
3214 \let\if_next_blank_space_token\iffalse
3215 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3216
3217\def\syst_helpers_seventuple_empty_two_yes[#1]
3218 {\secondargumenttrue
3219 \toksapp\t_syst_aux{[{#1}]}
3220 \let\m_syst_action_yes\syst_helpers_seventuple_empty_three_yes
3221 \let\m_syst_action_nop\syst_helpers_seventuple_empty_three_nop
3222 \let\if_next_blank_space_token\iffalse
3223 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3224
3225\def\syst_helpers_seventuple_empty_three_yes[#1]
3226 {\thirdargumenttrue
3227 \toksapp\t_syst_aux{[{#1}]}
3228 \let\m_syst_action_yes\syst_helpers_seventuple_empty_four_yes
3229 \let\m_syst_action_nop\syst_helpers_seventuple_empty_four_nop
3230 \let\if_next_blank_space_token\iffalse
3231 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3232
3233\def\syst_helpers_seventuple_empty_four_yes[#1]
3234 {\fourthargumenttrue
3235 \toksapp\t_syst_aux{[{#1}]}
3236 \let\m_syst_action_yes\syst_helpers_seventuple_empty_five_yes
3237 \let\m_syst_action_nop\syst_helpers_seventuple_empty_five_nop
3238 \let\if_next_blank_space_token\iffalse
3239 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3240
3241\def\syst_helpers_seventuple_empty_five_yes[#1]
3242 {\fifthargumenttrue
3243 \toksapp\t_syst_aux{[{#1}]}
3244 \let\m_syst_action_yes\syst_helpers_seventuple_empty_six_yes
3245 \let\m_syst_action_nop\syst_helpers_seventuple_empty_six_nop
3246 \let\if_next_blank_space_token\iffalse
3247 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3248
3249\def\syst_helpers_seventuple_empty_six_yes[#1]
3250 {\sixthargumenttrue
3251 \toksapp\t_syst_aux{[{#1}]}
3252 \let\m_syst_action_yes\syst_helpers_seventuple_empty_seven_yes
3253 \let\m_syst_action_nop\syst_helpers_seventuple_empty_seven_nop
3254 \let\if_next_blank_space_token\iffalse
3255 \futurelet\nexttoken\syst_helpers_inspect_next_optional_character}
3256
3257\def\syst_helpers_seventuple_empty_one_nop
3258 {\firstargumentfalse
3259 \secondargumentfalse
3260 \thirdargumentfalse
3261 \fourthargumentfalse
3262 \fifthargumentfalse
3263 \sixthargumentfalse
3264 \seventhargumentfalse
3265 \the\t_syst_aux[][][][][][][]}
3266
3267\def\syst_helpers_seventuple_empty_two_nop
3268 {\secondargumentfalse
3269 \thirdargumentfalse
3270 \fourthargumentfalse
3271 \fifthargumentfalse
3272 \sixthargumentfalse
3273 \seventhargumentfalse
3274 \if_next_blank_space_token
3275 \expandafter\syst_helpers_empty_spaced_six
3276 \else
3277 \expandafter\syst_helpers_empty_normal_six
3278 \fi}
3279
3280\def\syst_helpers_seventuple_empty_three_nop
3281 {\thirdargumentfalse
3282 \fourthargumentfalse
3283 \fifthargumentfalse
3284 \sixthargumentfalse
3285 \seventhargumentfalse
3286 \if_next_blank_space_token
3287 \expandafter\syst_helpers_empty_spaced_five
3288 \else
3289 \expandafter\syst_helpers_empty_normal_five
3290 \fi}
3291
3292\def\syst_helpers_seventuple_empty_four_nop
3293 {\fourthargumentfalse
3294 \fifthargumentfalse
3295 \sixthargumentfalse
3296 \seventhargumentfalse
3297 \if_next_blank_space_token
3298 \expandafter\syst_helpers_empty_spaced_four
3299 \else
3300 \expandafter\syst_helpers_empty_normal_four
3301 \fi}
3302
3303\def\syst_helpers_seventuple_empty_five_nop
3304 {\fifthargumentfalse
3305 \sixthargumentfalse
3306 \seventhargumentfalse
3307 \if_next_blank_space_token
3308 \expandafter\syst_helpers_empty_spaced_three
3309 \else
3310 \expandafter\syst_helpers_empty_normal_three
3311 \fi}
3312
3313\def\syst_helpers_seventuple_empty_six_nop
3314 {\sixthargumentfalse
3315 \seventhargumentfalse
3316 \if_next_blank_space_token
3317 \expandafter\syst_helpers_empty_spaced_two
3318 \else
3319 \expandafter\syst_helpers_empty_normal_two
3320 \fi}
3321
3322\def\syst_helpers_seventuple_empty_seven_nop
3323 {\seventhargumentfalse
3324 \if_next_blank_space_token
3325 \expandafter\syst_helpers_empty_spaced_one
3326 \else
3327 \expandafter\syst_helpers_empty_normal_one
3328 \fi}
3329
3330
3331
3332\let\dosingleargument \dosingleempty
3333\let\dodoubleargument \dodoubleempty
3334\let\dotripleargument \dotripleempty
3335\let\doquadrupleargument \doquadrupleempty
3336\let\doquintupleargument \doquintupleempty
3337\let\dosixtupleargument \dosixtupleempty
3338\let\doseventupleargument\doseventupleempty
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354\let\strippedcsname\csstring
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395\protected\def\complexorsimple#1
3396 {
3397 \doifelsenextoptional
3398 {\firstargumenttrue \csname\s!complex\csstring#1\endcsname}
3399 {\firstargumentfalse\csname\s!simple \csstring#1\endcsname}}
3400
3401\protected\def\complexorsimpleempty#1
3402 {
3403 \doifelsenextoptional
3404 {\firstargumenttrue \csname\s!complex\csstring#1\endcsname}
3405 {\firstargumentfalse\csname\s!complex\csstring#1\endcsname[]}}
3406
3407
3408
3409
3410
3411
3412
3413\protected\def\syst_helpers_complex_or_simple#1#2
3414 {\doifelsenextoptional{\firstargumenttrue#1}{\firstargumentfalse#2}}
3415
3416\protected\def\syst_helpers_complex_or_simple_empty#1
3417 {\doifelsenextoptional{\firstargumenttrue#1}{\firstargumentfalse#1[]}}
3418
3419\protected\def\definecomplexorsimple#1
3420 {\protected\edef#1{\syst_helpers_complex_or_simple
3421 \expandafter\noexpand\csname\s!complex\csstring#1\endcsname
3422 \expandafter\noexpand\csname\s!simple \csstring#1\endcsname}}
3423
3424\protected\def\definecomplexorsimpleempty#1
3425 {\protected\edef#1{\syst_helpers_complex_or_simple_empty
3426 \expandafter\noexpand\csname\s!complex\csstring#1\endcsname}}
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461\newconditional\c_syst_helpers_permit_spaces_between_groups
3462
3463\protected\def \permitspacesbetweengroups{\settrue \c_syst_helpers_permit_spaces_between_groups}
3464\protected\def\dontpermitspacesbetweengroups{\setfalse\c_syst_helpers_permit_spaces_between_groups}
3465
3466\dontpermitspacesbetweengroups
3467
3468
3469
3470
3471
3472
3473\protected\def\syst_helpers_get_grouped_argument#1#2
3474 {\let\syst_helpers_get_grouped_argument_yes#1
3475 \let\syst_helpers_get_grouped_argument_nop#2
3476 \futurelet\nextargument\syst_helpers_get_grouped_argument_indeed}
3477
3478\def\syst_helpers_get_grouped_argument_indeed
3479 {\ifx\nextargument\bgroup
3480 \expandafter\syst_helpers_get_grouped_argument_a
3481 \else
3482 \expandafter\syst_helpers_get_grouped_argument_b
3483 \fi}
3484
3485\def\syst_helpers_get_grouped_argument_a
3486 {
3487 \syst_helpers_get_grouped_argument_yes\syst_helpers_get_grouped_argument_nested}
3488
3489\def\syst_helpers_get_grouped_argument_b
3490 {\ifconditional\c_syst_helpers_permit_spaces_between_groups
3491 \expandafter\syst_helpers_get_grouped_argument_f
3492 \else
3493 \expandafter\syst_helpers_get_grouped_argument_d
3494 \fi}
3495
3496\def\syst_helpers_get_grouped_argument_d
3497 {
3498 \syst_helpers_get_grouped_argument_nop\syst_helpers_get_grouped_argument_nested{}}
3499
3500\begingroup
3501 \def\\ {\syst_helpers_get_grouped_argument\syst_helpers_get_grouped_argument_yes\syst_helpers_get_grouped_argument_nop}
3502 \glet\syst_helpers_get_grouped_argument_e\\
3503\endgroup
3504
3505\def\syst_helpers_get_grouped_argument_f
3506 {\ifx\nextargument\blankspace
3507 \expandafter\syst_helpers_get_grouped_argument_e
3508 \else
3509 \expandafter\syst_helpers_get_grouped_argument_d
3510 \fi}
3511
3512\protected\def\dosinglegroupempty#1
3513 {\def\syst_helpers_get_grouped_argument_nested
3514 {\dontpermitspacesbetweengroups
3515 #1}
3516 \syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
3517
3518\protected\def\dodoublegroupempty#1
3519 {\def\syst_helpers_get_grouped_argument_nested##1
3520 {\def\syst_helpers_get_grouped_argument_nested
3521 {\dontpermitspacesbetweengroups
3522 #1{##1}}
3523 \syst_helpers_get_grouped_argument\secondargumenttrue\secondargumentfalse}
3524 \syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
3525
3526\protected\def\dotriplegroupempty#1
3527 {\def\syst_helpers_get_grouped_argument_nested##1
3528 {\def\syst_helpers_get_grouped_argument_nested####1
3529 {\def\syst_helpers_get_grouped_argument_nested
3530 {\dontpermitspacesbetweengroups
3531 #1{##1}{####1}}
3532 \syst_helpers_get_grouped_argument\thirdargumenttrue\thirdargumentfalse}
3533 \syst_helpers_get_grouped_argument\secondargumenttrue\secondargumentfalse}
3534 \syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
3535
3536\protected\def\doquadruplegroupempty#1
3537 {\def\syst_helpers_get_grouped_argument_nested##1
3538 {\def\syst_helpers_get_grouped_argument_nested####1
3539 {\def\syst_helpers_get_grouped_argument_nested########1
3540 {\def\syst_helpers_get_grouped_argument_nested
3541 {\dontpermitspacesbetweengroups
3542 #1{##1}{####1}{########1}}
3543 \syst_helpers_get_grouped_argument\fourthargumenttrue\fourthargumentfalse}
3544 \syst_helpers_get_grouped_argument\thirdargumenttrue\thirdargumentfalse}
3545 \syst_helpers_get_grouped_argument\secondargumenttrue\secondargumentfalse}
3546 \syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
3547
3548\protected\def\doquintuplegroupempty#1
3549 {\def\syst_helpers_get_grouped_argument_nested##1
3550 {\def\syst_helpers_get_grouped_argument_nested####1
3551 {\def\syst_helpers_get_grouped_argument_nested########1
3552 {\def\syst_helpers_get_grouped_argument_nested################1
3553 {\def\syst_helpers_get_grouped_argument_nested
3554 {\dontpermitspacesbetweengroups
3555 #1{##1}{####1}{########1}{################1}}
3556 \syst_helpers_get_grouped_argument\fifthargumenttrue\fifthargumentfalse}
3557 \syst_helpers_get_grouped_argument\fourthargumenttrue\fourthargumentfalse}
3558 \syst_helpers_get_grouped_argument\thirdargumenttrue\thirdargumentfalse}
3559 \syst_helpers_get_grouped_argument\secondargumenttrue\secondargumentfalse}
3560 \syst_helpers_get_grouped_argument\firstargumenttrue\firstargumentfalse}
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589\def\firstofoneargument #1{#1}
3590
3591\def\firstoftwoarguments #1#2{#1}
3592\def\secondoftwoarguments #1#2{#2}
3593
3594\def\firstofthreearguments #1#2#3{#1}
3595\def\secondofthreearguments #1#2#3{#2}
3596\def\thirdofthreearguments #1#2#3{#3}
3597
3598\def\firstoffourarguments #1#2#3#4{#1}
3599\def\secondoffourarguments #1#2#3#4{#2}
3600\def\thirdoffourarguments #1#2#3#4{#3}
3601\def\fourthoffourarguments #1#2#3#4{#4}
3602
3603\def\firstoffivearguments #1#2#3#4#5{#1}
3604\def\secondoffivearguments #1#2#3#4#5{#2}
3605\def\thirdoffivearguments #1#2#3#4#5{#3}
3606\def\fourthoffivearguments #1#2#3#4#5{#4}
3607\def\fifthoffivearguments #1#2#3#4#5{#5}
3608
3609\def\firstofsixarguments #1#2#3#4#5#6{#1}
3610\def\secondofsixarguments#1#2#3#4#5#6{#2}
3611\def\thirdofsixarguments #1#2#3#4#5#6{#3}
3612\def\fourthofsixarguments#1#2#3#4#5#6{#4}
3613\def\fifthofsixarguments #1#2#3#4#5#6{#5}
3614\def\sixthofsixarguments #1#2#3#4#5#6{#6}
3615
3616\protected\def\firstofoneunexpanded #1{#1}
3617
3618\protected\def\firstoftwounexpanded #1#2{#1}
3619\protected\def\secondoftwounexpanded #1#2{#2}
3620
3621\protected\def\firstofthreeunexpanded #1#2#3{#1}
3622\protected\def\secondofthreeunexpanded#1#2#3{#2}
3623\protected\def\thirdofthreeunexpanded #1#2#3{#3}
3624
3625
3626
3627
3628
3629
3630
3631
3632\protected\def\letempty #1{\let #1\empty}
3633\protected\def\globalletempty#1{\glet#1\empty}
3634
3635\protected\def\letvalueempty #1{\expandafter\let \csname#1\endcsname\empty}
3636\protected\def\letgvalueempty#1{\expandafter\glet\csname#1\endcsname\empty}
3637\protected\def\letvaluerelax #1{\expandafter\let \csname#1\endcsname\relax}
3638\protected\def\letgvalurelax #1{\expandafter\glet\csname#1\endcsname\relax}
3639
3640\protected\def\relaxvalueifundefined#1
3641 {\ifcsname#1\endcsname \else
3642 \expandafter\let\csname#1\endcsname\relax
3643 \fi}
3644
3645
3646
3647
3648
3649
3650
3651\protected\def\wait
3652 {\begingroup
3653 \read16 to \wait
3654 \endgroup}
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673\setnewconstant\statuswidth 15
3674\setnewconstant\statuswrite 128
3675
3676\ifdefined\writestring \else
3677
3678 \protected\def\writestring{\immediate\write\statuswrite}
3679 \protected\def\writeline {\writestring{}}
3680
3681\fi
3682
3683\protected\def\normalwritestatus#1#2
3684 {\writestring{\expandafter\syst_helpers_split_status_yes\expandafter\statuswidth#1
3685 \space\space\space\space\space\space\space
3686 \space\space\space\space\space\space\space
3687 \space\space\space\space\space\space\end
3688 \space:\space#2}}
3689
3690\def\syst_helpers_split_status_yes#1#2
3691 {\ifcase#1 \expandafter\syst_helpers_split_status_nop\fi#2
3692 \expandafter\syst_helpers_split_status_yes\expandafter{\the\numexpr#1\minusone\relax}}
3693
3694\def\syst_helpers_split_status_nop#1\end
3695 {}
3696
3697
3698
3699
3700
3701
3702\let\immediatemessage\clf_immediatemessage
3703
3704
3705
3706
3707
3708
3709\protected\def\rawsetparameter#1=#2,
3710 {\if]#1\else
3711 \expandafter\def\csname\rawparameterprefix#1\endcsname{#2}
3712 \expandafter\rawsetparameter
3713 \fi}
3714
3715\protected\def\rawgetparameters[#1][#2
3716 {\ifx#2]
3717 \expandafter\gobbleoneargument
3718 \else
3719 \def\rawparameterprefix{#1}
3720 \expandafter\dorawgetparameters
3721 \fi#2}
3722
3723\def\dorawgetparameters#1]
3724 {\expandafter\rawsetparameter#1,]=,}
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736\protected\def\resetglobal
3737 {\let\redoglobal\relax
3738 \let\dodoglobal\relax}
3739
3740\resetglobal
3741
3742\protected\def\doglobal
3743 {\ifx\redoglobal\relax
3744 \let\redoglobal\global
3745 \let\dodoglobal\syst_helpers_dodo_global
3746 \fi}
3747
3748\def\syst_helpers_dodo_global
3749 {\resetglobal\global}
3750
3751\def\saveglobal
3752 {\let\syst_helpers_dodo_global\dodoglobal
3753 \let\syst_helpers_redo_global\redoglobal}
3754
3755\def\restoreglobal
3756 {\let\redoglobal\syst_helpers_redo_global
3757 \let\dodoglobal\syst_helpers_dodo_global}
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788\protected\def\newif#1
3789 {\let\new_if_saved\newif
3790 \let\newif\new_if_check
3791 \expandafter\redoglobal\expandafter\def\csname\expandafter\newif\csstring#1true\endcsname {\let#1\iftrue }
3792 \expandafter\redoglobal\expandafter\def\csname\expandafter\newif\csstring#1false\endcsname{\let#1\iffalse}
3793 \dodoglobal\csname\expandafter\newif\csstring#1false\endcsname
3794 \let\newif\new_if_saved}
3795
3796
3797
3798\protected\def\define#1
3799 {\ifdefined#1
3800 \message{[\noexpand#1is already defined]}
3801 \protected\expandafter\def\expandafter\gobbleddefinition
3802 \else
3803 \protected\expandafter\def
3804 \fi#1}
3805
3806\protected\def\redefine#1
3807 {\ifdefined#1
3808 \message{[\noexpand#1is redefined]}
3809 \fi
3810 \protected\def#1}
3811
3812\protected\def\definemacro#1
3813 {\ifdefined#1
3814 \message{[\noexpand#1is already defined]}
3815 \protected\expandafter\def\expandafter\gobbleddefinition
3816 \else
3817 \protected\expandafter\def
3818 \fi#1}
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842\def\s!unexpanded{unexpanded}
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920\bgroup \obeylines
3921
3922\glet\stoptexdefinition\relax
3923
3924\protected\gdef\starttexdefinition
3925 {\bgroup
3926 \obeylines
3927 \syst_helpers_start_tex_definition}
3928
3929\gdef\syst_helpers_start_tex_definition#1
3930 {\catcode\endoflineasciicode\ignorecatcode
3931 \clf_texdefinition_one{#1}}
3932
3933\gdef\dostarttexdefinition#1\stoptexdefinition
3934 {\egroup
3935 \clf_texdefinition_two{#1}}
3936
3937\egroup
3938
3939
3940
3941\protected\def\texdefinition#1{\begincsname#1\endcsname}
3942
3943
3944
3945\protected\def\starttexcode{\unprotect}
3946\protected\def\stoptexcode {\protect}
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999\def\zerocountervalue{0}
4000
4001\protected\def\newcounter#1
4002 {\dodoglobal\let#1\zerocountervalue}
4003
4004
4005
4006\def\syst_helpers_do_increment#1{\dodoglobal\edef#1{\the\numexpr\ifdefined#1\ifx#1\relax\else#1\fi\fi\plusone \relax}}
4007\def\syst_helpers_do_decrement#1{\dodoglobal\edef#1{\the\numexpr\ifdefined#1\ifx#1\relax\else#1\fi\fi\minusone\relax}}
4008
4009\def\syst_helpers_do_do_do_increment#1,#2){\dodoglobal\edef#1{\the\numexpr\ifdefined#1\ifx#1\relax\else#1\fi\fi#2\relax}}
4010\def\syst_helpers_do_do_do_decrement#1,#2){\dodoglobal\edef#1{\the\numexpr\ifdefined#1\ifx#1\relax\else#1\fi\fi#2\relax}}
4011
4012\def\syst_helpers_do_do_increment(#1
4013 {\def\m_syst_action_yes{\syst_helpers_do_do_do_increment#1}
4014 \def\m_syst_action_nop{\syst_helpers_do_do_do_increment#1,\plusone}
4015 \doifelsenextcharcs,\m_syst_action_yes\m_syst_action_nop}
4016
4017\def\syst_helpers_do_do_decrement(#1
4018 {\def\m_syst_action_yes{\syst_helpers_do_do_do_decrement#1}
4019 \def\m_syst_action_nop{\syst_helpers_do_do_do_decrement#1,\plusone}
4020 \doifelsenextcharcs,\m_syst_action_yes\m_syst_action_nop}
4021
4022\protected\def\increment{\doifelsenextcharcs(\syst_helpers_do_do_increment\syst_helpers_do_increment}
4023\protected\def\decrement{\doifelsenextcharcs(\syst_helpers_do_do_decrement\syst_helpers_do_decrement}
4024
4025\protected\def\fastincrement#1{\dodoglobal\edef#1{\the\numexpr#1\plusone \relax}}
4026\protected\def\fastdecrement#1{\dodoglobal\edef#1{\the\numexpr#1\minusone\relax}}
4027
4028\protected\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname}
4029\protected\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname}
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046\newdimen\maximumsignal
4047
4048\protected\def\newsignal#1
4049 {\ifdefined#1\else
4050 \advance\maximumsignal 2\scaledpoint
4051 \edef#1{\the\maximumsignal}
4052 \fi}
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070\let\checkedstrippedcsname\csstring
4071
4072
4073
4074
4075
4076
4077\protected\def\savenormalmeaning#1
4078 {\ifcsname normal\csstring#1\endcsname \else
4079 \expandafter\let\csname normal\csstring#1\endcsname#1
4080 \fi}
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119\newcount\outerrecurse
4120\newcount\innerrecurse
4121
4122\def\recursedepth{\the\outerrecurse}
4123\def\recurselevel{0}
4124
4125\let\syst_helpers_stepwise_next\relax
4126
4127\installsystemnamespace{recurseindex}
4128\installsystemnamespace{recurseaction}
4129
4130\protected\def\dostepwiserecurse#1#2#3#4
4131 {\global\advance\outerrecurse \plusone
4132 \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#4}
4133 \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
4134 \ifnum#3>\zerocount\relax
4135 \ifnum#2<#1\relax
4136 \let\syst_helpers_stepwise_next\syst_helpers_stepwise_exit
4137 \else
4138 \let\syst_helpers_stepwise_next\syst_helpers_stepwise_recurse
4139 \fi
4140 \else
4141 \ifnum#3<\zerocount\relax
4142 \ifnum#1<#2\relax
4143 \let\syst_helpers_stepwise_next\syst_helpers_stepwise_exit
4144 \else
4145 \let\syst_helpers_stepwise_next\syst_helpers_stepwise_reverse
4146 \fi
4147 \else
4148 \let\syst_helpers_stepwise_next\syst_helpers_stepwise_exit
4149 \fi
4150 \fi\normalexpanded{\syst_helpers_stepwise_next{\number#1}{\number#2}{\number#3}}}
4151
4152\protected\def\syst_helpers_stepwise_recurse#1#2#3
4153 {\ifnum#1>#2\relax
4154 \expandafter\syst_helpers_stepwise_recurse_nop
4155 \else
4156 \def\recurselevel{#1}
4157 \doubleexpandafter\syst_helpers_stepwise_recurse_yes\expandafter
4158 \fi\expandafter{\the\numexpr\recurselevel#3\relax}{#2}{#3}}
4159
4160\protected\def\syst_helpers_recurse_content
4161 {\csname\??recurseaction\the\outerrecurse\endcsname}
4162
4163\protected\def\syst_helpers_stepwise_recurse_yes
4164 {\syst_helpers_recurse_content
4165 \syst_helpers_stepwise_recurse}
4166
4167\protected\def\syst_helpers_stepwise_reverse#1#2#3
4168 {\ifnum#1<#2\relax
4169 \expandafter\syst_helpers_stepwise_recurse_nop
4170 \else
4171 \def\recurselevel{#1}
4172 \innerrecurse#1\relax
4173 \advance\innerrecurse#3\relax
4174 \doubleexpandafter\syst_helpers_stepwise_reverse_yes\expandafter
4175 \fi\expandafter{\the\innerrecurse}{#2}{#3}}
4176
4177\protected\def\syst_helpers_stepwise_reverse_yes
4178 {\syst_helpers_recurse_content
4179 \syst_helpers_stepwise_reverse}
4180
4181\protected\def\syst_helpers_stepwise_exit
4182 {\syst_helpers_stepwise_recurse_nop\relax}
4183
4184\protected\def\syst_helpers_stepwise_recurse_nop#1#2#3#4
4185 {\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
4186 \global\advance\outerrecurse\minusone}
4187
4188
4189
4190
4191
4192\protected\def\dorecurse#1
4193 {\dostepwiserecurse\plusone{#1}\plusone}
4194
4195\def\doexpandedrecurse#1#2
4196 {\ifnum#1>\zerocount
4197 #2\expandafter\doexpandedrecurse\expandafter{\the\numexpr#1\plusone\relax}{#2}
4198 \fi}
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217\protected\def\dorecurse#1
4218 {\ifcase#1\relax
4219 \expandafter\gobbletwoarguments
4220 \or
4221 \expandafter\syst_helpers_recurse_y
4222 \else
4223 \expandafter\syst_helpers_recurse_x
4224 \fi{#1}}
4225
4226\protected\def\syst_helpers_recurse_x#1#2
4227 {\global\advance\outerrecurse \plusone
4228 \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#2}
4229 \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
4230 \expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}}
4231
4232\protected\def\syst_helpers_recurse_y#1#2
4233 {\global\advance\outerrecurse \plusone
4234 \expandafter\glet\csname\??recurseindex\the\outerrecurse\endcsname\recurselevel
4235 \let\recurselevel\!!plusone
4236 #2
4237 \expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
4238 \global\advance\outerrecurse \minusone}
4239
4240\protected\def\syst_helpers_recurse_indeed#1#2
4241 {\ifnum#1>#2\relax
4242 \expandafter\syst_helpers_recurse_indeed_nop
4243 \else
4244 \def\recurselevel{#1}
4245 \doubleexpandafter\syst_helpers_recurse_indeed_yes
4246 \fi\expandafter{\the\numexpr\recurselevel\plusone\relax}{#2}}
4247
4248\protected\def\syst_helpers_recurse_indeed#1#2
4249 {\ifnum#1>#2\relax
4250 \expandafter\syst_helpers_recurse_indeed_nop
4251 \else
4252 \def\recurselevel{#1}
4253 \innerrecurse#1\advance\innerrecurse\plusone
4254 \doubleexpandafter\syst_helpers_recurse_indeed_yes
4255 \fi\expandafter{\the\innerrecurse}{#2}}
4256
4257\protected\def\syst_helpers_recurse_indeed_yes
4258 {\syst_helpers_recurse_content
4259 \syst_helpers_recurse_indeed}
4260
4261\protected\def\syst_helpers_recurse_indeed_nop#1#2#3
4262 {\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
4263 \global\advance\outerrecurse \minusone }
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274\protected\def\dowith#1#2
4275 {\def\syst_helpers_with##1{#2}
4276 \normalexpanded{\processcommalist[#1]}\syst_helpers_with}
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294\let\endofloop\donothing
4295
4296\protected\def\doloop#1
4297 {\global\advance\outerrecurse \plusone
4298 \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#1}
4299 \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
4300 \let\endofloop\syst_helpers_loop
4301 \syst_helpers_loop1}
4302
4303\protected\def\syst_helpers_loop#1
4304 {\def\recurselevel{#1}
4305 \expandafter\syst_helpers_loop_yes\expandafter{\the\numexpr\recurselevel\plusone\relax}}
4306
4307\protected\def\syst_helpers_loop_yes
4308 {\syst_helpers_recurse_content
4309 \endofloop}
4310
4311\protected\def\syst_helpers_loop_nop#1
4312 {\let\endofloop\syst_helpers_loop
4313 \expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
4314 \global\advance\outerrecurse\minusone}
4315
4316\protected\def\exitloop
4317 {\let\endofloop\syst_helpers_loop_nop}
4318
4319\protected\def\exitloopnow#1\endofloop
4320 {\syst_helpers_loop_nop}
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358\def\syst_helpers_recurse_content
4359 {\csname\??recurseaction\the\outerrecurse\expandafter\expandafter\expandafter\endcsname
4360 \expandafter\expandafter\expandafter{\expandafter\recurselevel\expandafter}\expandafter{\the\outerrecurse}}
4361
4362\protected\def\syst_helpers_recurse_x#1#2
4363 {\global\advance\outerrecurse \plusone
4364 \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}
4365 \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
4366 \expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}}
4367
4368\protected\def\syst_helpers_recurse_y#1#2
4369 {\global\advance\outerrecurse \plusone
4370 \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
4371 \let\recurselevel\!!plusone
4372 \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}
4373 \syst_helpers_recurse_content
4374 \expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
4375 \global\advance\outerrecurse \minusone}
4376
4377\protected\def\doloop#1
4378 {\global\advance\outerrecurse \plusone
4379 \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#1}
4380 \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
4381 \let\endofloop\syst_helpers_loop
4382 \syst_helpers_loop1}
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428\installsystemnamespace{recursestepwise}
4429
4430\protected\def\dostepwiserecurse#1#2#3#4
4431 {\global\advance\outerrecurse \plusone
4432 \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}
4433 \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
4434 \csname\??recursestepwise
4435
4436 \ifnum#3>\zerocount
4437 \ifnum#2<#1x\else d\fi
4438 \else\ifnum#3<\zerocount
4439 \ifnum#1<#2x\else r\fi
4440 \else
4441 x
4442 \fi\fi
4443 \expandafter\endcsname\normalexpanded{{\number#1}{\number#2}{\number#3}}}
4444
4445
4446\letvalue{\??recursestepwise x}\syst_helpers_stepwise_exit
4447\letvalue{\??recursestepwise d}\syst_helpers_stepwise_recurse
4448\letvalue{\??recursestepwise r}\syst_helpers_stepwise_reverse
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477\newcount\fastloopindex
4478\newcount\fastloopfinal
4479
4480\let\m_syst_helpers_fast_loop_cs\relax
4481
4482\protected\def\dofastloopcs#1
4483 {\fastloopfinal#1\relax
4484 \ifcase\fastloopfinal
4485 \expandafter\gobbleoneargument
4486 \else
4487 \expandafter\syst_helpers_fast_loop_cs
4488 \fi}
4489
4490\protected\def\syst_helpers_fast_loop_cs#1
4491 {\let\m_syst_helpers_fast_loop_cs#1
4492 \fastloopindex\plusone
4493 \syst_helpers_fast_loop_cs_step}
4494
4495\protected\def\syst_helpers_fast_loop_cs_step
4496 {\ifnum\fastloopindex>\fastloopfinal
4497 \let\m_syst_helpers_fast_loop_cs\relax
4498 \else
4499 \m_syst_helpers_fast_loop_cs
4500 \advance\fastloopindex\plusone
4501 \expandafter\syst_helpers_fast_loop_cs_step
4502 \fi}
4503
4504
4505
4506\protected\def\resetrecurselevel{\let\recurselevel\!!zerocount}
4507
4508\let\recurselevel \!!zerocount
4509\let\recurseaction\relax
4510\let\recursestring\empty
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537\protected\def\doloopoverlist#1#2
4538 {\global\advance\outerrecurse\plusone
4539 \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1{\edef\recursestring{##1}#2}
4540 \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recursestring
4541 \normalexpanded{\processcommalist[#1]{\expandafter\noexpand\csname\??recurseaction\the\outerrecurse\endcsname}}
4542 \expandafter\let\expandafter\recursestring\csname\??recurseindex\the\outerrecurse\endcsname
4543 \global\advance\outerrecurse\minusone}
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567\installsystemnamespace{extraevery}
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581\protected\def\newevery#1#2
4582 {\ifx#1\everypar\else\newtoks#1\fi
4583 \ifx#2\relax\else\ifdefined#2\else
4584 \expandafter\newtoks\csname\??extraevery\csstring#1\endcsname
4585 \edef#2{\syst_helpers_every#1\csname\??extraevery\csstring#1\endcsname}
4586 \fi\fi}
4587
4588\protected\def\syst_helpers_every#1#2
4589 {\removetoks\the#2\from#1
4590 \appendtoks\the#2\to #1
4591 #2}
4592
4593
4594
4595\newevery \everypar \EveryPar
4596\newevery \everyline \EveryLine
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613\newtoks \neverypar
4614
4615\protected\def\forgeteverypar
4616 {\everypar{\the\neverypar}}
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681\protected\def\convertvalue#1\to
4682 {\expandafter\convertcommand\csname#1\endcsname\to}
4683
4684\protected\def\defconvertedvalue#1#2
4685 {\expandafter\defconvertedcommand\expandafter#1\csname#2\endcsname}
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705\def\syst_helpers_check_if_assignment_else#1=#2#30004{\if#20003}
4706\def\syst_helpers_check_else_assignment_if#1=#2#30004{\unless\if#20003}
4707
4708\protected\def\doifelseassignment#1
4709 {\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=000300030004
4710 \expandafter\secondoftwoarguments
4711 \else
4712 \expandafter\firstoftwoarguments
4713 \fi}
4714
4715\protected\def\doifelseassignmentcs#1#2#3
4716 {\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=000300030004
4717 \expandafter#3
4718 \else
4719 \expandafter#2
4720 \fi}
4721
4722\let\doifassignmentelse \doifelseassignment
4723\let\doifassignmentelsecs\doifelseassignmentcs
4724
4725\newif\ifassignment
4726
4727\protected\def\docheckassignment#1
4728 {\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=000300030004
4729 \assignmentfalse
4730 \else
4731 \assignmenttrue
4732 \fi}
4733
4734
4735
4736\protected\def\validassignment#1
4737 {\expandafter\syst_helpers_check_else_assignment_if\detokenize{#1}=000300030004}
4738
4739\protected\def\novalidassignment#1
4740 {\expandafter\syst_helpers_check_if_assignment_else\detokenize{#1}=000300030004}
4741
4742
4743
4744
4745
4746
4747\protected\def\convertargument#1\to#2{\dodoglobal\edef#2{\detokenize{#1}}}
4748\protected\def\convertcommand #1\to#2{\dodoglobal\edef#2{\expandafter\detokenize\expandafter{#1}}}
4749
4750\protected\def\defconvertedargument #1#2{\edef#1{\detokenize{#2}}}
4751\protected\def\defconvertedcommand #1#2{\edef#1{\detokenize\expandafter{#2}}}
4752\protected\def\edefconvertedargument#1#2{\edef#1{#2}
4753 \edef#1{\detokenize\expandafter{#1}}}
4754\protected\def\gdefconvertedargument#1#2{\xdef#1{\detokenize{#2}}}
4755\protected\def\gdefconvertedcommand #1#2{\xdef#1{\detokenize\expandafter{#2}}}
4756\protected\def\xdefconvertedargument#1#2{\xdef#1{#2}
4757 \xdef#1{\detokenize\expandafter{#1}}}
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780\protected\def\showvalue#1
4781 {\ifcsname#1\endcsname
4782 \expandafter\show\csname#1\endcsname
4783 \else
4784 \show\undefined
4785 \fi}
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800\protected\def\doifelsemeaning#1#2
4801 {\edef\m_syst_string_one{\normalmeaning#1}
4802 \def \m_syst_string_two{#2}
4803 \edef\m_syst_string_two{\normalmeaning\m_syst_string_two}
4804 \ifx\m_syst_string_one\m_syst_string_two
4805 \expandafter\firstoftwoarguments
4806 \else
4807 \expandafter\secondoftwoarguments
4808 \fi}
4809
4810\let\doifmeaningelse\doifelsemeaning
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824\def\syst_helpers_if_samestring_else#1#2#3#4
4825 {\edef\m_syst_string_one{\detokenize\expandafter{\normalexpanded{#3}}}
4826 \edef\m_syst_string_two{\detokenize\expandafter{\normalexpanded{#4}}}
4827 \ifx\m_syst_string_one\m_syst_string_two\expandafter#1\else\expandafter#2\fi}
4828
4829\protected\def\doifelsesamestring{\syst_helpers_if_samestring_else\firstoftwoarguments\secondoftwoarguments}
4830\protected\def\doifsamestring {\syst_helpers_if_samestring_else\firstofoneargument \gobbleoneargument }
4831\protected\def\doifnotsamestring {\syst_helpers_if_samestring_else\gobbleoneargument \firstofoneargument }
4832
4833\let\doifsamestringelse\doifelsesamestring
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859\protected\def\ConvertToConstant#1#2#3
4860 {\edef\m_syst_string_one{\expandafter\detokenize\expandafter{#2}}
4861 \edef\m_syst_string_two{\expandafter\detokenize\expandafter{#3}}
4862 #1{\m_syst_string_one}{\m_syst_string_two}}
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889\protected\def\CheckConstantAfter#1#2
4890 {\expandafter\convertargument\v!prefix!\to\ascii
4891 \convertargument#1\to#2\relax
4892 \doifelseinstring\ascii{#2}
4893 {\expandafter\convertargument#1\to#2}
4894 {}}
4895
4896\protected\def\ConvertConstantAfter#1#2#3
4897 {\CheckConstantAfter{#2}\asciia
4898 \CheckConstantAfter{#3}\asciib
4899 #1{\asciia}{\asciib}}
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912\protected\def\assignifempty#1#2
4913 {\doifnothing{#1}{\def#1{#2}}}
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951\let\syst_helpers_grab_indeed\relax
4952
4953\protected\def\syst_helpers_grab#1#2
4954 {\def\syst_helpers_grab_indeed##1#1{#2{##1}}\syst_helpers_grab_indeed}
4955
4956\protected\def\grabuntil#1
4957 {\expandafter\syst_helpers_grab\expandafter{\csname#1\endcsname}}
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981\let\syst_helpers_gobble_indeed\relax
4982
4983\protected\def\processbetween#1#2
4984 {\setvalue{\s!start#1}{\grabuntil{\s!stop#1}{#2}}}
4985
4986\protected\def\gobbleuntil#1
4987 {\def\syst_helpers_gobble_indeed##1#1{}\syst_helpers_gobble_indeed}
4988
4989\protected\def\gobbleuntilrelax#1\relax
4990 {}
4991
4992
4993
4994\protected\def\gobblenested#1#2#3
4995 {\normalexpanded{\def\noexpand\next##1\csname#2\endcsname}{\csname#3\endcsname}
4996 \next}
4997
4998
4999
5000
5001
5002
5003
5004\let\syst_helpers_until_indeed\relax
5005
5006\protected\def\processuntil#1
5007 {\def\syst_helpers_until_indeed##1#1{##1}\syst_helpers_until_indeed}
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073\let\m_syst_helpers_handle_group_after \relax
5074\let\m_syst_helpers_handle_group_before\relax
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150\protected\def\syst_helpers_handle_group_nop
5151 {\ifnum\currentgrouptype=\semisimplegroupcode
5152 \expandafter\syst_helpers_handle_group_nop_a
5153 \else
5154 \expandafter\syst_helpers_handle_group_nop_b
5155 \fi}
5156
5157\def\syst_helpers_handle_group_nop_a
5158 {\begingroup
5159 \aftergroup\m_syst_helpers_handle_group_a
5160 \aftergroup\endgroup
5161 \m_syst_helpers_handle_group_b}
5162
5163\def\syst_helpers_handle_group_nop_b
5164 {\bgroup
5165 \aftergroup\m_syst_helpers_handle_group_a
5166 \aftergroup\egroup
5167 \m_syst_helpers_handle_group_b}
5168
5169\protected\def\syst_helpers_handle_group_normal
5170 {\bgroup
5171 \afterassignment\m_syst_helpers_handle_group_normal_before
5172 \let\next=}
5173
5174\def\m_syst_helpers_handle_group_normal_before
5175 {\bgroup
5176 \m_syst_helpers_handle_group_b
5177 \bgroup
5178 \aftergroup\m_syst_helpers_handle_group_a
5179 \aftergroup\egroup
5180 \aftergroup\egroup}
5181
5182\protected\def\syst_helpers_handle_group_simple
5183 {\bgroup
5184 \afterassignment\m_syst_helpers_handle_group_simple_before
5185 \let\next=}
5186
5187\def\m_syst_helpers_handle_group_simple_before
5188 {\bgroup
5189 \aftergroup\m_syst_helpers_handle_group_simple_after
5190 \m_syst_helpers_handle_group_b}
5191
5192\def\m_syst_helpers_handle_group_simple_after
5193 {\m_syst_helpers_handle_group_a
5194 \egroup}
5195
5196\protected\def\syst_helpers_handle_group_pickup
5197 {\bgroup
5198 \afterassignment\m_syst_helpers_handle_group_pickup_before
5199 \let\next=}
5200
5201\def\m_syst_helpers_handle_group_pickup_before
5202 {\bgroup
5203 \aftergroup\m_syst_helpers_handle_group_a
5204 \aftergroup\egroup
5205 \aftergroup\m_syst_helpers_handle_group_p
5206 \m_syst_helpers_handle_group_b}
5207
5208\protected\def\syst_helpers_handle_group_nop_x
5209 {\ifnum\currentgrouptype=\semisimplegroupcode
5210 \begingroup
5211 \aftergroup\endgroup
5212 \else
5213 \bgroup
5214 \aftergroup\egroup
5215 \fi
5216 \m_syst_helpers_handle_group_b}
5217
5218\protected\def\syst_helpers_handle_group_normal_x
5219 {\bgroup
5220 \afterassignment\m_syst_helpers_handle_group_normal_before_x
5221 \let\next=}
5222
5223\def\m_syst_helpers_handle_group_normal_before_x
5224 {\bgroup
5225 \m_syst_helpers_handle_group_b
5226 \bgroup
5227 \aftergroup\egroup
5228 \aftergroup\egroup}
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259\protected\def\groupedcommand#1#2
5260 {\def\m_syst_helpers_handle_group_b{#1}
5261 \def\m_syst_helpers_handle_group_a{#2}
5262 \doifelsenextbgroupcs\syst_helpers_handle_group_normal\syst_helpers_handle_group_nop}
5263
5264\protected\def\groupedcommandcs#1#2
5265 {\let\m_syst_helpers_handle_group_b#1
5266 \let\m_syst_helpers_handle_group_a#2
5267 \doifelsenextbgroupcs\syst_helpers_handle_group_normal\syst_helpers_handle_group_nop}
5268
5269\protected\def\simplegroupedcommand#1#2
5270 {\def\m_syst_helpers_handle_group_b{#1}
5271 \def\m_syst_helpers_handle_group_a{#2}
5272 \doifelsenextbgroupcs\syst_helpers_handle_group_simple\syst_helpers_handle_group_nop}
5273
5274\protected\def\pickupgroupedcommand#1#2#3
5275 {\def\m_syst_helpers_handle_group_b{#1}
5276 \def\m_syst_helpers_handle_group_a{#2}
5277 \def\m_syst_helpers_handle_group_p{#3}
5278 \doifelsenextbgroupcs\syst_helpers_handle_group_pickup\syst_helpers_handle_group_nop}
5279
5280\protected\def\triggergroupedcommand#1
5281 {\def\m_syst_helpers_handle_group_b{#1}
5282 \doifelsenextbgroupcs\syst_helpers_handle_group_normal_x\syst_helpers_handle_group_nop_x}
5283
5284\protected\def\triggergroupedcommandcs#1
5285 {\let\m_syst_helpers_handle_group_b#1
5286 \doifelsenextbgroupcs\syst_helpers_handle_group_normal_x\syst_helpers_handle_group_nop_x}
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313\protected\def\showdefinederror#1#2
5314 {\writestatus\m!system{#1 #2 replaces a macro, use CAPITALS!}}
5315
5316\protected\def\checkdefined#1#2#3
5317 {\doifdefined{#3}{\showdefinederror{#2}{#3}}}
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368\newtoks\BeforePar
5369\newtoks\AfterPar
5370
5371\protected\def\redowithpar\par
5372 {\doifelsenextchar\par\redowithpar\dodowithpar}
5373
5374\protected\def\dowithpar#1#2
5375 {\def\dodowithpar##1\par{#1##1#2}
5376 \redowithpar\par}
5377
5378\protected\def\redogotopar\par
5379 {\doifelsenextchar\par\redogotopar\dodogotopar}
5380
5381\protected\def\dogotopar#1
5382 {\def\dodogotopar{#1}
5383 \redogotopar\par}
5384
5385\protected\def\dogotoparcs#1
5386 {\let\dodogotopar#1
5387 \redogotopar\par}
5388
5389\ifdefined \ignorepars \else
5390 \protected\def\ignorepars{\dogotoparcs\relax}
5391\fi
5392
5393\protected\def\GetPar
5394 {\expanded
5395 {\dowithpar
5396 {\the\BeforePar
5397 \BeforePar\emptytoks}
5398 {\the\AfterPar
5399 \BeforePar\emptytoks
5400 \AfterPar\emptytoks}}}
5401
5402\protected\def\GotoPar
5403 {\expanded
5404 {\dogotopar
5405 {\the\BeforePar
5406 \BeforePar\emptytoks}}}
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438\let\syst_helpers_next_par\relax
5439\let\syst_helpers_next_arg\relax
5440
5441\protected\def\dowithpargument#1
5442 {\def\syst_helpers_next_par##1 \par{#1{##1}}
5443 \def\syst_helpers_next_arg##1{#1{##1}}
5444 \doifelsenextbgroup\syst_helpers_next_arg{\doifelsenextchar\par{#1{}}\syst_helpers_next_par}}
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466\let\syst_helpers_next_war\relax
5467\let\syst_helpers_next_arg\relax
5468
5469\protected\def\dowithwargument#1
5470 {\def\syst_helpers_next_war##1 {#1{##1}}
5471 \def\syst_helpers_next_arg##1{#1{##1}}
5472 \doifelsenextbgroup\syst_helpers_next_arg\syst_helpers_next_war}
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503\protected\def\dorepeatwithcommand[#1]
5504 {\syst_helpers_repeat_with_command#1*\empty*\relax}
5505
5506\def\syst_helpers_repeat_with_command#1*#2#3*#4\relax#5
5507 {\ifx#2\empty\syst_helpers_repeat_with_command_again[#1]#5\else\syst_helpers_repeat_with_command_indeed{#1}{#2}{#3}#5\fi}
5508
5509\def\syst_helpers_repeat_with_command_indeed#1#2#3#4
5510 {\ifx#2\empty
5511 #4{#1}
5512 \else\ifnum#1<\zerocount
5513
5514 \dorecurse{#1}{#4{#2#3}}
5515 \else\ifx#2
5516 \dorecurse{#1}{#4{#3}}
5517 \else
5518 \dorecurse{#1}{#4{#2#3}}
5519 \fi\fi\fi}
5520
5521\def\syst_helpers_repeat_with_command_again[#1]#2
5522 {#2{#1}}
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559\def\syst_helpers_if_instring_else_indeed#1
5560 {\if#1@
5561 \expandafter\secondoftwoarguments
5562 \else
5563 \expandafter\firstoftwoarguments
5564 \fi}
5565
5566\def\doifelsestringinstring#1#2
5567 {\expandafter\def\expandafter\syst_helpers_if_instring_else\expandafter##\expandafter1#1##2##30004
5568 {\syst_helpers_if_instring_else_indeed##2}
5569 \expandafter\expandafter\expandafter\syst_helpers_if_instring_else\expandafter#2#1@@0004}
5570
5571\let\doifstringinstringelse\doifelsestringinstring
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589\newtoks\t_syst_helpers_scratch
5590\let \m_syst_helpers_scratch\empty
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653\protected\def\appendtoks#1\to#2
5654 {\ifx\dodoglobal\relax
5655 \expandafter\toksapp
5656 \else
5657 \resetglobal
5658 \expandafter\gtoksapp
5659 \fi#2{#1}}
5660
5661\protected\def\prependtoks#1\to#2
5662 {\ifx\dodoglobal\relax
5663 \expandafter\tokspre
5664 \else
5665 \resetglobal
5666 \expandafter\gtokspre
5667 \fi#2{#1}}
5668
5669\def\syst_helpers_append_toks_indeed
5670 {\ifx\dodoglobal\relax
5671 \expandafter\toksapp
5672 \else
5673 \resetglobal
5674 \expandafter\gtoksapp
5675 \fi\m_syst_helpers_scratch\t_syst_helpers_scratch}
5676
5677\def\syst_helpers_prepend_toks_indeed
5678 {\ifx\dodoglobal\relax
5679 \expandafter\tokspre
5680 \else
5681 \resetglobal
5682 \expandafter\gtokspre
5683 \fi\m_syst_helpers_scratch\t_syst_helpers_scratch}
5684
5685\protected\def\appendtoksonce#1\to#2
5686 {\let\m_syst_helpers_scratch#2
5687 \t_syst_helpers_scratch{#1}
5688 \doifelseintoks\t_syst_helpers_scratch\m_syst_helpers_scratch
5689 \donothing
5690 \syst_helpers_append_toks_indeed}
5691
5692\protected\def\prependtoksonce#1\to#2
5693 {\let\m_syst_helpers_scratch#2
5694 \t_syst_helpers_scratch{#1}
5695 \doifelseintoks\t_syst_helpers_scratch\m_syst_helpers_scratch
5696 \donothing
5697 \syst_helpers_prepend_toks_indeed}
5698
5699
5700
5701\protected\def\doifelseintoks#1#2
5702 {\edef\asciia{\detokenize\expandafter{\the#1}}
5703 \edef\asciib{\detokenize\expandafter{\the#2}}
5704 \doifelsestringinstring\asciia\asciib}
5705
5706\let\doifintokselse\doifelseintoks
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727\newtoks \collectingtoks
5728
5729\protected\def\startcollect #1\stopcollect {\toksapp \collectingtoks{#1}}
5730\protected\def\startexpandedcollect#1\stopexpandedcollect{\etoksapp\collectingtoks{#1}}
5731
5732\protected\def\startcollecting{\collectingtoks\emptytoks}
5733\protected\def\stopcollecting {\the\collectingtoks}
5734
5735\protected\def\collect {\toksapp \collectingtoks}
5736\protected\def\collectexpanded{\etoksapp\collectingtoks}
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746\protected\def\removetoks#1\from#2
5747 {\def\syst_helpers_remove_toks##1#1##2\empty\empty\empty##30004
5748 {\def\m_syst_string_one{##3}
5749 \ifx\m_syst_string_one\empty#2{##1}\else#2{##1##2}\fi}
5750 \expandafter\syst_helpers_remove_toks\the#2\empty\empty\empty#1\empty\empty\empty0004}
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769\protected\def\appendetoks#1\to#2
5770 {\ifx\dodoglobal\relax
5771 \expandafter\etoksapp
5772 \else
5773 \resetglobal
5774 \expandafter\xtoksapp
5775 \fi#2{#1}}
5776
5777\protected\def\prependetoks#1\to#2
5778 {\ifx\dodoglobal\relax
5779 \expandafter\etokspre
5780 \else
5781 \resetglobal
5782 \expandafter\xtokspre
5783 \fi#2{#1}}
5784
5785
5786
5787\protected\def\flushtoks#1
5788 {\t_syst_helpers_scratch#1\relax
5789 \dodoglobal#1\emptytoks
5790 \the\t_syst_helpers_scratch\relax}
5791
5792
5793
5794\let\dotoks\the
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812\let\syst_helpers_split_string\relax
5813
5814\protected\def\beforesplitstring#1\at#2\to#3
5815 {\def\syst_helpers_split_string##1#2##2#2##3\\
5816 {\def#3{##1}}
5817 \expandafter\syst_helpers_split_string#1#2#2\\}
5818
5819\protected\def\aftersplitstring#1\at#2\to#3
5820 {\def\syst_helpers_split_string##1#2##2@@@##3\\
5821 {\def#3{##2}}
5822 \expandafter\syst_helpers_split_string#1@@@#2@@@\\}
5823
5824
5825
5826
5827
5828
5829\protected\def\splitstring#1\at#2\to#3\and#4
5830 {\def\syst_helpers_split_string##1#2##2\empty\empty\empty##3\\
5831 {\def#3{##1}
5832 \def\syst_helpers_split_string{##3}
5833 \ifx\syst_helpers_split_string\empty
5834 \let#4\empty
5835 \else
5836 \def#4{##2}
5837 \fi}
5838 \expandafter\syst_helpers_split_string#1\empty\empty\empty#2\empty\empty\empty\\}
5839
5840\protected\def\greedysplitstring#1\at#2\to#3\and#4
5841 {\edef\asciib{#1}
5842 \let\asciic\asciib
5843 \let#3\empty
5844 \let#4\empty
5845 \doloop
5846 {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib
5847 \ifx\asciib\empty
5848 \exitloop
5849 \else
5850
5851
5852 \edef#3{\ifcase\recurselevel\or\else#3#2\fi\asciia}
5853 \let#4\asciib
5854 \fi}
5855 \ifx#3\empty\let#3\asciic\fi}
5856
5857
5858
5859
5860
5861
5862\protected\def\beforetestandsplitstring#1\at#2\to#3
5863 {\def\syst_helpers_split_string##1#2##2#2##3##4\\
5864 {\ifx##3\empty\let#3\empty\else\def#3{##1}\fi}
5865 \expandafter\syst_helpers_split_string#1#2#2\empty\\}
5866
5867\protected\def\aftertestandsplitstring#1\at#2\to#3
5868 {\def\syst_helpers_split_string ##1#2##2@@@##3##4\\
5869 {\ifx##3\empty\let#3\empty\else\def#3{##2}\fi}
5870 \expandafter\syst_helpers_split_string #1@@@#2@@@\empty\\}
5871
5872\def\testandsplitstring#1\at#2\to#3\and#4
5873 {\def\syst_helpers_split_string##1#2##2#2##3##4\\
5874 {\ifx##3\empty\let#3\empty\let#4\empty\else\def#3{##1}\def#4{##2}\fi}
5875 \expandafter\syst_helpers_split_string#1#2#2\empty\\}
5876
5877
5878
5879
5880
5881
5882
5883
5884\protected\def\splitatperiod #1{\normalexpanded{\syst_helpers_splitatperiod #1}..\relax}
5885\protected\def\splitatcomma #1{\normalexpanded{\syst_helpers_splitatcomma #1},,\relax}
5886\protected\def\splitatasterisk#1{\normalexpanded{\syst_helpers_splitatasterisk#1}**\relax}
5887\protected\def\splitatcolon #1{\normalexpanded{\syst_helpers_splitatcolon #1}::\relax}
5888\protected\def\splitatcolons #1{\normalexpanded{\syst_helpers_splitatcolons #1}::::\relax}
5889
5890\protected\def\syst_helpers_splitatperiod #1.#2.#3\relax#4#5{\def#4{#1}\def#5{#2}}
5891\protected\def\syst_helpers_splitatcomma #1,#2,#3\relax#4#5{\def#4{#1}\def#5{#2}}
5892\protected\def\syst_helpers_splitatasterisk #1*#2*#3\relax#4#5{\def#4{#1}\def#5{#2}}
5893\protected\def\syst_helpers_splitatcolon #1:#2:#3\relax#4#5{\def#4{#1}\def#5{#2}}
5894\protected\def\syst_helpers_splitatcolons #1::#2::#3\relax#4#5{\edef#4{#1}\edef#5{#2}}
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907\protected\def\removesubstring#1\from#2\to#3
5908 {\splitstring#2\to\m_syst_string_one\and\m_syst_string_two
5909 \dodoglobal#3{\m_syst_string_one\m_syst_string_two}}
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964\protected\def\appendtocommalist#1#2
5965 {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}
5966
5967\protected\def\prependtocommalist#1#2
5968 {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}
5969
5970\protected\def\addtocommalist#1#2
5971 {\rawdoifelseinset{#1}#2\resetglobal
5972 {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}}
5973
5974\protected\def\pretocommalist#1#2
5975 {\rawdoifelseinset{#1}#2\resetglobal
5976 {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}}
5977
5978\protected\def\robustdoifelseinset#1#2
5979 {\edef\m_syst_string_one{\detokenize\expandafter{\normalexpanded{#1}}}
5980 \edef\m_syst_string_two{\detokenize\expandafter{\normalexpanded{#2}}}
5981 \rawdoifelseinset\m_syst_string_one\m_syst_string_two}
5982
5983\let\robustdoifinsetelse\robustdoifelseinset
5984
5985\protected\def\robustaddtocommalist#1#2
5986 {\robustdoifelseinset{#1}#2\resetglobal
5987 {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}}
5988
5989\protected\def\robustpretocommalist#1#2
5990 {\robustdoifelseinset{#1}#2\resetglobal
5991 {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}}
5992
5993\protected\def\xsplitstring#1#2
5994 {\def\syst_helpers_split_string##1,#2,##2,#2,##3\\
5995 {\edef\m_syst_string_one{\bcleanedupcommalist##1\empty\empty\relax}
5996 \edef\m_syst_string_two{\acleanedupcommalist##2,,\relax}}
5997 \expandafter\syst_helpers_split_string\expandafter,#1,,#2,,#2,\\}
5998
5999\def\bcleanedupcommalist#1#2#3\relax{\if#1,\else#1\fi\if#2,\else#2\fi#3}
6000\def\bcleanedupcommalist#1#2\relax{\if#1,\else#1\fi#2}
6001\def\acleanedupcommalist#1,,#2\relax{#1}
6002
6003\protected\def\removefromcommalist#1#2
6004 {\rawdoifelseinset{#1}#2
6005 {\normalexpanded{\xsplitstring\noexpand#2{#1}}
6006 \dodoglobal\edef#2
6007 {\ifx\m_syst_string_one\empty
6008 \m_syst_string_two
6009 \else
6010 \m_syst_string_one\ifx\m_syst_string_two\empty\else,\m_syst_string_two\fi
6011 \fi}}
6012 \resetglobal}
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029\def\syst_helpers_substitute_in_comma_list_step#1
6030 {\edef\m_syst_string_three{#1}
6031 \ifx\m_syst_string_one\m_syst_string_three
6032 \ifx\m_syst_string_two\empty \else
6033 \edef\m_syst_string_four{\ifx\m_syst_string_four\empty\else\m_syst_string_four,\fi\m_syst_string_two}
6034 \fi
6035 \else
6036 \edef\m_syst_string_four{\ifx\m_syst_string_four\empty\else\m_syst_string_four,\fi#1}
6037 \fi}
6038
6039\protected\def\substituteincommalist#1#2#3
6040 {\edef\m_syst_string_one{#1}
6041 \edef\m_syst_string_two{#2}
6042 \let\m_syst_string_four\empty
6043 \normalexpanded{\rawprocesscommacommand[#3]}\syst_helpers_substitute_in_comma_list_step
6044 \let#3\m_syst_string_four}
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068\newcount\c_syst_helpers_comma_list_index
6069\let \m_syst_helpers_comma_list_target\empty
6070
6071\let\newcommalistelement\empty
6072
6073\def\syst_helpers_replace_in_comma_list_step#1
6074 {\ifnum\commalistcounter=\c_syst_helpers_comma_list_index\relax
6075 \ifx\newcommalistelement\empty\else
6076 \ifx\m_syst_helpers_comma_list_target\empty
6077 \let\m_syst_helpers_comma_list_target\newcommalistelement
6078 \else
6079 \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter
6080 \m_syst_helpers_comma_list_target\expandafter\expandafter\expandafter
6081 {\expandafter\m_syst_helpers_comma_list_target\expandafter,\newcommalistelement}
6082 \fi
6083 \fi
6084 \def\commalistelement{#1}
6085 \else
6086 \ifx\m_syst_helpers_comma_list_target\empty
6087 \ifx\nexttoken\bgroup
6088 \def\m_syst_helpers_comma_list_target{{#1}}
6089 \else
6090 \def\m_syst_helpers_comma_list_target{#1}
6091 \fi
6092 \else
6093 \ifx\nexttoken\bgroup
6094 \expandafter\def\expandafter\m_syst_helpers_comma_list_target\expandafter{\m_syst_helpers_comma_list_target,{#1}}
6095 \else
6096 \expandafter\def\expandafter\m_syst_helpers_comma_list_target\expandafter{\m_syst_helpers_comma_list_target,#1}
6097 \fi
6098 \fi
6099 \fi
6100 \advance\commalistcounter\plusone}
6101
6102\protected\def\replaceincommalist#1#2
6103 {\c_syst_helpers_comma_list_index#2\relax
6104 \let\m_syst_helpers_comma_list_target\empty
6105 \let\commalistelement\empty
6106 \commalistcounter\plusone
6107 \expandafter\processcommalist\expandafter[#1]\syst_helpers_replace_in_comma_list_step
6108 \dodoglobal\let#1\m_syst_helpers_comma_list_target}
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118\let\m_syst_helpers_comma_list_command_global\empty
6119
6120\def\syst_helpers_comma_list_command_global_step#1,
6121 {\if]#1\else
6122 \m_syst_helpers_comma_list_command_global{#1}
6123 \expandafter\syst_helpers_comma_list_command_global_step
6124 \fi}
6125
6126\protected\def\globalprocesscommalist[#1]#2
6127 {\glet\m_syst_helpers_comma_list_command_global#2
6128 \expandafter\syst_helpers_comma_list_command_global_step#1,],}
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140{\catcode\.=\othercatcode
6141 \catcode\p=\othercatcode
6142 \catcode\t=\othercatcode
6143 \gdef\WITHOUTPT#1pt{#1}}
6144
6145\def\withoutpt#1
6146 {\expandafter\WITHOUTPT#1}
6147
6148
6149
6150
6151
6152
6153
6154\def\PtToCm#1
6155 {\withoutpt\the\dimexpr0.0351459804\dimexpr#1\relax\relax cm}
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169\def\dimensiontocount#1#2{#2\numexpr\dimexpr#1\relax\maxcard\relax}
6170 |