3 % Copyright
2009-2010 Taco Hoekwater
<taco@@luatex.org
>
5 % This file is part of LuaTeX.
7 % LuaTeX is free software
; you can redistribute it and
/or modify it under
8 % the terms of the GNU General Public License as published by the Free
9 % Software Foundation
; either version
2 of the License
, or
(at your
10 % option
) any later version.
12 % LuaTeX is distributed in the hope that it will be useful
, but WITHOUT
13 % ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY or
14 % FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 % License for more details.
17 % You should have received a copy of the GNU General Public License along
18 % with LuaTeX
; if not
, see
<http
://www.gnu.org
/licenses
/>.
25 @ Only a dozen or so command codes |
>max_command| can possibly be returned by
26 |get_next|
; in increasing order
, they are |undefined_cs|
, |expand_after|
,
27 |no_expand|
, |input|
, |if_test|
, |fi_or_else|
, |cs_name|
, |convert|
, |the|
,
28 |top_bot_mark|
, |call|
, |long_call|
, |outer_call|
, |long_outer_call|
, and
29 |end_template|.
{\emergencystretch
=40pt\par
}
31 Sometimes
, recursive calls to the following |expand| routine may
32 cause exhaustion of the run-time calling stack
, resulting in
33 forced execution stops by the operating system. To diminish the chance
34 of this happening
, a counter is used to keep track of the recursion
35 depth
, in conjunction with a constant called |expand_depth|.
37 Note that this does not catch all possible infinite recursion loops
,
38 just the ones that exhaust the application calling stack. The
39 actual maximum value of |expand_depth| is outside of our control
, but
40 the initial setting of |
100| should be enough to prevent problems.
41 @^system dependencies@
>
44 static int expand_depth_count
= 0;
47 @ The |expand| subroutine is used when |cur_cmd
>max_command|. It removes a
48 ``call'' or a conditional or one of the other special operations just
49 listed. It follows that |expand| might invoke itself recursively. In all
50 cases
, |expand| destroys the current token
, but it sets things up so that
51 the next |get_next| will deliver the appropriate next token. The value of
52 |cur_tok| need not be known when |expand| is called.
54 Since several of the basic scanning routines communicate via global variables
,
55 their values are saved as local variables of |expand| so that
56 recursive calls don't invalidate them.
65 halfword t
; /* token that is being ``expanded after''
*/
66 halfword p
; /* for list manipulation
*/
67 halfword cur_ptr
; /* for a local token list pointer
*/
68 int cv_backup
; /* to save the global quantity |cur_val|
*/
69 int cvl_backup
, radix_backup
, co_backup
; /* to save |cur_val_level|
, etc.
*/
70 halfword backup_backup
; /* to save |link
(backup_head
)|
*/
71 int save_scanner_status
; /* temporary storage of |scanner_status|
*/
72 incr
(expand_depth_count
);
73 if
(expand_depth_count
>= expand_depth
)
74 overflow
("expansion depth", (unsigned
) expand_depth
);
76 cvl_backup
= cur_val_level
;
78 co_backup
= cur_order
;
79 backup_backup
= token_link
(backup_head
);
81 if
(cur_cmd
< call_cmd
) {
82 /* Expand a nonmacro
*/
83 if
(int_par
(tracing_commands_code
) > 1)
86 case top_bot_mark_cmd
:
87 /* Insert the appropriate mark text into the scanner
*/
88 t
= cur_chr
% marks_code
;
89 if
(cur_chr
>= marks_code
)
95 cur_ptr
= first_mark
(cur_val
);
98 cur_ptr
= bot_mark
(cur_val
);
100 case split_first_mark_code
:
101 cur_ptr
= split_first_mark
(cur_val
);
103 case split_bot_mark_code
:
104 cur_ptr
= split_bot_mark
(cur_val
);
107 cur_ptr
= top_mark
(cur_val
);
111 begin_token_list
(cur_ptr
, mark_text
);
113 case expand_after_cmd
:
115 /* Expand the token after the next token
*/
116 /* It takes only a little shuffling to do what \TeX\ calls \.
{\\expandafter
}.
*/
120 if
(cur_cmd
> max_command_cmd
)
127 } else
{ /* \\unless
*/
128 /* Negate a boolean conditional and |goto reswitch|
*/
129 /* The result of a boolean condition is reversed when the conditional is
130 preceded by \.
{\\unless
}.
*/
132 if
((cur_cmd
== if_test_cmd
) && (cur_chr != if_case_code)) {
133 cur_chr
= cur_chr
+ unless_code
;
136 print_err
("You can't use `\\unless' before `");
137 print_cmd_chr
((quarterword
) cur_cmd
, cur_chr
);
139 help1
("Continue, and I'll forget that it ever happened.");
145 /* Suppress expansion of the next token
*/
146 /* The implementation of \.
{\\noexpand
} is a bit trickier
, because it is
147 necessary to insert a special `|dont_expand|' marker into \TeX's reading
148 mechanism. This special marker is processed by |get_next|
, but it does
149 not slow down the inner loop.
151 Since \.
{\\outer
} macros might arise here
, we must also
152 clear the |scanner_status| temporarily.
155 save_scanner_status
= scanner_status
;
156 scanner_status
= normal
;
158 scanner_status
= save_scanner_status
;
160 back_input
(); /* now |start| and |loc| point to the backed-up token |t|
*/
161 if
(t
>= cs_token_flag
) {
163 set_token_info
(p
, cs_token_flag
+ frozen_dont_expand
);
164 set_token_link
(p
, iloc
);
170 /* Implement \.
{\\primitive
} */
172 The \.
{\\primitive
} handling. If the primitive meaning of the next
173 token is an expandable command
, it suffices to replace the current
174 token with the primitive one and restart |expand|.
176 Otherwise
, the token we just read has to be pushed back
, as well
177 as a token matching the internal form of \.
{\\primitive
}, that is
178 sneaked in as an alternate form of |ignore_spaces|.
180 An implementation problem surfaces
: There really is no |cur_cs|
181 attached to the inserted primitive command
, so it is safer to set
182 |cur_cs| to zero. |cur_tok| has a similar problem. And for the
183 non-expanded branch
, simply pushing back a token that matches the
184 correct internal command does not work
, because that approach would
185 not survive roundtripping to a temporary file or even a token list.
187 In a next version
, it would be smart to create |frozen_| versions of
188 all the primitives. Then
, this problem would not happen
, at the
189 expense of a few hundred extra control sequences.
191 save_scanner_status
= scanner_status
;
192 scanner_status
= normal
;
194 scanner_status
= save_scanner_status
;
195 cur_cs
= prim_lookup
(cs_text
(cur_cs
));
196 if
(cur_cs
!= undefined_primitive
) {
197 t
= get_prim_eq_type
(cur_cs
);
198 if
(t
> max_command_cmd
) {
200 cur_chr
= get_prim_equiv
(cur_cs
);
201 cur_tok
= token_val
(cur_cmd
, cur_chr
);
205 back_input
(); /* now |loc| and |start| point to a one-item list
*/
207 set_token_info
(p
, cs_token_flag
+ frozen_primitive
);
208 set_token_link
(p
, iloc
);
213 print_err
("Missing primitive name");
215 ("The control sequence marked <to be read again> does not",
216 "represent any known primitive.");
223 /* Manufacture a control sequence name
; */
225 manufacture_csname
(0);
226 } else if
(cur_chr
== 1) {
227 inject_last_tested_cs
();
229 manufacture_csname
(1);
233 conv_toks
(); /* this procedure is discussed in Part
27 below
*/
236 ins_the_toks
(); /* this procedure is discussed in Part
27 below
*/
238 case combine_toks_cmd
:
239 combine_the_toks
(cur_chr
);
242 conditional
(); /* this procedure is discussed in Part
28 below
*/
245 /* Terminate the current conditional and skip to \.
{\\fi
} */
246 /* The processing of conditionals is complete except for the following
247 code
, which is actually part of |expand|. It comes into play when
248 \.
{\\or
}, \.
{\\else
}, or \.
{\\fi
} is scanned.
*/
250 if
(int_par
(tracing_ifs_code
) > 0)
251 if
(int_par
(tracing_commands_code
) <= 1)
253 if
(cur_chr
> if_limit
) {
254 if
(if_limit
== if_code
) {
255 insert_relax
(); /* condition not yet evaluated
*/
258 print_cmd_chr
(fi_or_else_cmd
, cur_chr
);
259 help1
("I'm ignoring this; it doesn't match any \\if.");
263 while
(cur_chr
!= fi_code
)
264 pass_text
(); /* skip to \.
{\\fi
} */
265 pop_condition_stack
();
270 /* Initiate or terminate input from a file
*/
273 else if
(cur_chr
== 2)
275 else if
(cur_chr
== 3) {
278 } else if
(name_in_progress
)
290 /* Complain about an undefined macro
*/
291 print_err
("Undefined control sequence");
292 help5
("The control sequence at the end of the top line",
293 "of your error message was never \\def'ed. If you have",
294 "misspelled it (e.g., `\\hobx'), type `I' and the correct",
295 "spelling (e.g., `I\\hbox'). Otherwise just continue,",
296 "and I'll forget about whatever was undefined.");
300 } else if
(cur_cmd
< end_template_cmd
) {
303 /* Insert a token containing |frozen_endv|
*/
304 /* An |end_template| command is effectively changed to an |endv| command
305 by the following code.
(The reason for this is discussed below
; the
306 |frozen_end_template| at the end of the template has passed the
307 |check_outer_validity| test
, so its mission of error detection has been
310 cur_tok
= cs_token_flag
+ frozen_endv
;
315 cur_val_level
= cvl_backup
;
316 radix
= radix_backup
;
317 cur_order
= co_backup
;
318 set_token_link
(backup_head
, backup_backup
);
319 decr
(expand_depth_count
);
323 void complain_missing_csname
(void
)
325 print_err
("Missing \\endcsname inserted");
326 help2
("The control sequence marked <to be read again> should",
327 "not appear between \\csname and \\endcsname.");
332 void manufacture_csname
(boolean use
)
337 p
= r
; /* head of the list of characters
*/
342 store_new_token
(cur_tok
);
343 } while
(cur_cs
== 0);
344 if
(cur_cmd
!= end_cs_name_cmd
) {
345 /* Complain about missing \.
{\\endcsname
} */
346 complain_missing_csname
();
348 /* Look up the characters of list |r| in the hash table
, and set |cur_cs|
*/
349 ss
= tokenlist_to_lstring
(r
, true
);
353 cur_cs
= string_lookup
((char
*) ss-
>s
, ss-
>l
);
357 last_cs_name
= cur_cs
;
360 if
(cur_cs
== null_cs
) {
362 } else if
(eq_type
(cur_cs
) == undefined_cs_cmd
) {
365 cur_tok
= cur_cs
+ cs_token_flag
;
370 no_new_control_sequence
= false
;
371 cur_cs
= string_lookup
((char
*) ss-
>s
, ss-
>l
);
372 no_new_control_sequence
= true
;
374 cur_cs
= null_cs
; /* the list is empty
*/
376 last_cs_name
= cur_cs
;
379 if
(eq_type
(cur_cs
) == undefined_cs_cmd
) {
380 eq_define
(cur_cs
, relax_cmd
, too_big_char
); /* N.B.
: The |save_stack| might change
*/
381 }; /* the control sequence will now match `\.
{\\relax
}'
*/
382 cur_tok
= cur_cs
+ cs_token_flag
;
387 void inject_last_tested_cs
(void
)
389 if
(last_cs_name
!= null_cs
) {
390 cur_cs
= last_cs_name
;
391 cur_tok
= last_cs_name
+ cs_token_flag
;
396 @ Sometimes the expansion looks too far ahead
, so we want to insert
397 a harmless \.
{\\relax
} into the user's input.
400 void insert_relax
(void
)
402 cur_tok
= cs_token_flag
+ cur_cs
;
404 cur_tok
= cs_token_flag
+ frozen_relax
;
406 token_type
= inserted
;
410 @ Here is a recursive procedure that is \TeX's usual way to get the
411 next token of input. It has been slightly optimized to take account of
415 void get_x_token
(void
)
416 { /* sets |cur_cmd|
, |cur_chr|
, |cur_tok|
, and expands macros
*/
419 if
(cur_cmd
<= max_command_cmd
)
421 if
(cur_cmd
>= call_cmd
) {
422 if
(cur_cmd
< end_template_cmd
) {
425 cur_cs
= frozen_endv
;
427 goto DONE
; /* |cur_chr
=null_list|
*/
435 cur_tok
= token_val
(cur_cmd
, cur_chr
);
437 cur_tok
= cs_token_flag
+ cur_cs
;
441 @ The |get_x_token| procedure is equivalent to two consecutive
442 procedure calls
: |get_next
; x_token|.
446 { /* |get_x_token| without the initial |get_next|
*/
447 while
(cur_cmd
> max_command_cmd
) {
452 cur_tok
= token_val
(cur_cmd
, cur_chr
);
454 cur_tok
= cs_token_flag
+ cur_cs
;
458 @ A control sequence that has been \.
{\\def
}'ed by the user is expanded by
459 \TeX's |macro_call| procedure.
461 Before we get into the details of |macro_call|
, however
, let's consider the
462 treatment of primitives like \.
{\\topmark
}, since they are essentially
463 macros without parameters. The token lists for such marks are kept in five
464 global arrays of pointers
; we refer to the individual entries of these
465 arrays by symbolic macros |top_mark|
, etc. The value of |top_mark
(x
)|
, etc.
466 is either |null| or a pointer to the reference count of a token list.
468 The variable |biggest_used_mark| is an aid to try and keep the code
469 somehwat efficient without too much extra work
: it registers the
470 highest mark class ever instantiated by the user
, so the loops
471 in |fire_up| and |vsplit| do not have to traverse the full range
475 halfword top_marks_array
[(biggest_mark
+ 1)];
476 halfword first_marks_array
[(biggest_mark
+ 1)];
477 halfword bot_marks_array
[(biggest_mark
+ 1)];
478 halfword split_first_marks_array
[(biggest_mark
+ 1)];
479 halfword split_bot_marks_array
[(biggest_mark
+ 1)];
480 halfword biggest_used_mark
;
483 void initialize_marks
(void
)
486 biggest_used_mark
= 0;
487 for
(i
= 0; i
<= biggest_mark
; i
++) {
489 first_mark
(i
) = null
;
491 split_first_mark
(i
) = null
;
492 split_bot_mark
(i
) = null
;
497 @ Now let's consider |macro_call| itself
, which is invoked when \TeX\ is
498 scanning a control sequence whose |cur_cmd| is either |call|
, |long_call|
,
499 |outer_call|
, or |long_outer_call|. The control sequence definition
500 appears in the token list whose reference count is in location |cur_chr|
503 The global variable |long_state| will be set to |call| or to |long_call|
,
504 depending on whether or not the control sequence disallows \.
{\\par
}
505 in its parameters. The |get_next| routine will set |long_state| to
506 |outer_call| and emit \.
{\\par
}, if a file ends or if an \.
{\\outer
}
507 control sequence occurs in the midst of an argument.
510 int long_state
; /* governs the acceptance of \.
{\\par
} */
512 @ The parameters
, if any
, must be scanned before the macro is expanded.
513 Parameters are token lists without reference counts. They are placed on
514 an auxiliary stack called |pstack| while they are being scanned
, since
515 the |param_stack| may be losing entries during the matching process.
516 (Note that |param_stack| can't be gaining entries
, since |macro_call| is
517 the only routine that puts anything onto |param_stack|
, and it
521 halfword pstack
[9]; /* arguments supplied to a macro
*/
524 @ After parameter scanning is complete
, the parameters are moved to the
525 |param_stack|. Then the macro body is fed to the scanner
; in other words
,
526 |macro_call| places the defined text of the control sequence at the
527 top of\
/ \TeX's input stack
, so that |get_next| will proceed to read it
530 The global variable |cur_cs| contains the |eqtb| address of the control sequence
531 being expanded
, when |macro_call| begins. If this control sequence has not been
532 declared \.
{\\long
}, i.e.
, if its command code in the |eq_type| field is
533 not |long_call| or |long_outer_call|
, its parameters are not allowed to contain
534 the control sequence \.
{\\par
}. If an illegal \.
{\\par
} appears
, the macro
535 call is aborted
, and the \.
{\\par
} will be rescanned.
538 void macro_call
(void
)
539 { /* invokes a user-defined control sequence
*/
540 halfword r
; /* current node in the macro's token list
*/
541 halfword p
= null
; /* current node in parameter token list being built
*/
542 halfword q
; /* new node being put into the token list
*/
543 halfword s
; /* backup pointer for parameter matching
*/
544 halfword t
; /* cycle pointer for backup recovery
*/
545 halfword u
, v
; /* auxiliary pointers for backup recovery
*/
546 halfword rbrace_ptr
= null
; /* one step before the last |right_brace| token
*/
547 int n
= 0; /* the number of parameters scanned
*/
548 halfword unbalance
; /* unmatched left braces in current parameter
*/
549 halfword m
= 0; /* the number of tokens or groups
(usually
) */
550 halfword ref_count
; /* start of the token list
*/
551 int save_scanner_status
= scanner_status
; /* |scanner_status| upon entry
*/
552 halfword save_warning_index
= warning_index
; /* |warning_index| upon entry
*/
553 int match_chr
= 0; /* character used in parameter
*/
554 warning_index
= cur_cs
;
556 r
= token_link
(ref_count
);
557 if
(int_par
(tracing_macros_code
) > 0) {
558 /* Show the text of the macro being expanded
*/
561 print_cs
(warning_index
);
562 token_show
(ref_count
);
563 end_diagnostic
(false
);
565 if
(token_info
(r
) == protected_token
)
567 if
(token_info
(r
) != end_match_token
) {
568 /* Scan the parameters and make |link
(r
)| point to the macro body
; but
569 |return| if an illegal \.
{\\par
} is detected
*/
570 /* At this point
, the reader will find it advisable to review the explanation
571 of token list format that was presented earlier
, since many aspects of that
572 format are of importance chiefly in the |macro_call| routine.
574 The token list might begin with a string of compulsory tokens before the
575 first |match| or |end_match|. In that case the macro name is supposed to be
576 followed by those tokens
; the following program will set |s
=null| to
577 represent this restriction. Otherwise |s| will be set to the first token of
578 a string that will delimit the next parameter.
581 scanner_status
= matching
;
583 long_state
= eq_type
(cur_cs
);
584 if
(long_state
>= outer_call_cmd
)
585 long_state
= long_state
- 2;
587 set_token_link
(temp_token_head
, null
);
588 if
((token_info
(r
) >= end_match_token
)
589 ||
(token_info
(r
) < match_token
)) {
592 match_chr
= token_info
(r
) - match_token
;
598 /* Scan a parameter until its delimiter string has been found
; or
, if |s
=null|
,
599 simply scan the delimiter string
; */
601 /* If |info
(r
)| is a |match| or |end_match| command
, it cannot be equal to
602 any token found by |get_token|. Therefore an undelimited parameter---i.e.
,
603 a |match| that is immediately followed by |match| or |end_match|
---will
604 always fail the test `|cur_tok
=info
(r
)|' in the following algorithm.
*/
606 get_token
(); /* set |cur_tok| to the next token of input
*/
607 if
(cur_tok
== token_info
(r
)) {
608 /* Advance |r|
; |goto found| if the parameter delimiter has been
609 fully matched
, otherwise |goto continue|
*/
610 /* A slightly subtle point arises here
: When the parameter delimiter ends
611 with `\.
{\#\
{}'
, the token list will have a left brace both before and
612 after the |end_match|\kern-
.4pt. Only one of these should affect the
613 |align_state|
, but both will be scanned
, so we must make a correction.
616 if
((token_info
(r
) >= match_token
)
617 && (token_info(r) <= end_match_token)) {
618 if
(cur_tok
< left_brace_limit
)
626 /* Contribute the recently matched tokens to the current parameter
, and
627 |goto continue| if a partial match is still in effect
; but abort if |s
=null|
*/
629 /* When the following code becomes active
, we have matched tokens from |s| to
630 the predecessor of |r|
, and we have found that |cur_tok
<>info
(r
)|. An
631 interesting situation now presents itself
: If the parameter is to be
632 delimited by a string such as `\.
{ab
}'
, and if we have scanned `\.
{aa
}'
,
633 we want to contribute one `\.a' to the current parameter and resume
634 looking for a `\.b'. The program must account for such partial matches and
635 for others that can be quite complex. But most of the time we have |s
=r|
636 and nothing needs to be done.
638 Incidentally
, it is possible for \.
{\\par
} tokens to sneak in to certain
639 parameters of non-\.
{\\long
} macros. For example
, consider a case like
640 `\.
{\\def\\a\#
1\\par
!\
{...\
}}' where the first \.
{\\par
} is not followed
641 by an exclamation point. In such situations it does not seem appropriate
642 to prohibit the \.
{\\par
}, so \TeX\ keeps quiet about this bending of
647 /* Report an improper use of the macro and abort
*/
648 print_err
("Use of ");
649 sprint_cs
(warning_index
);
650 tprint
(" doesn't match its definition");
652 ("If you say, e.g., `\\def\\a1{...}', then you must always",
653 "put `1' after `\\a', since control sequence names are",
654 "made up of letters only. The macro here has not been",
655 "followed by the required stuff, so I'm ignoring it.");
662 store_new_token
(token_info
(t
));
668 if
(cur_tok
!= token_info
(v
)) {
675 if
(token_info
(u
) != token_info
(v
))
683 r
= s
; /* at this point
, no tokens are recently matched
*/
687 if
(cur_tok
== par_token
)
688 if
(long_state
!= long_call_cmd
)
689 if
(!int_par
(suppress_long_error_code
)) {
692 if
(cur_tok
< right_brace_limit
) {
693 if
(cur_tok
< left_brace_limit
) {
694 /* Contribute an entire group to the current parameter
*/
697 fast_store_new_token
(cur_tok
);
699 if
(cur_tok
== par_token
) {
700 if
(long_state
!= long_call_cmd
) {
701 if
(!int_par
(suppress_long_error_code
)) {
707 if
(cur_tok
< right_brace_limit
) {
708 if
(cur_tok
< left_brace_limit
) {
718 store_new_token
(cur_tok
);
721 /* Report an extra right brace and |goto continue|
*/
723 print_err
("Argument of ");
724 sprint_cs
(warning_index
);
725 tprint
(" has an extra }");
727 ("I've run across a `}' that doesn't seem to match anything.",
728 "For example, `\\def\\a#1{...}' and `\\a}' would produce",
729 "this error. If you simply proceed now, the `\\par' that",
730 "I've just inserted will cause me to report a runaway",
731 "argument that might be the root of the problem. But if",
732 "your `}' was spurious, just type `2' and it will go away.");
734 long_state
= call_cmd
;
738 /* a white lie
; the \.
{\\par
} won't always trigger a runaway
*/
741 /* Store the current token
, but |goto continue| if it is
742 a blank space that would become an undelimited parameter
*/
743 if
(cur_tok
== space_token
)
744 if
(token_info
(r
) <= end_match_token
)
745 if
(token_info
(r
) >= match_token
)
747 store_new_token
(cur_tok
);
751 if
(token_info
(r
) > end_match_token
)
753 if
(token_info
(r
) < match_token
)
757 /* Tidy up the parameter just scanned
, and tuck it away
*/
758 /* If the parameter consists of a single group enclosed in braces
, we must
759 strip off the enclosing braces. That's why |rbrace_ptr| was introduced.
*/
760 if
((m
== 1) && (token_info(p) < right_brace_limit)
761 && (p != temp_token_head)) {
762 set_token_link
(rbrace_ptr
, null
);
764 p
= token_link
(temp_token_head
);
765 pstack
[n
] = token_link
(p
);
768 pstack
[n
] = token_link
(temp_token_head
);
771 if
(int_par
(tracing_macros_code
) > 0) {
776 show_token_list
(pstack
[n
- 1], null
, 1000);
777 end_diagnostic
(false
);
782 /* now |info
(r
)| is a token whose command code is either |match| or |end_match|
*/
783 } while
(token_info
(r
) != end_match_token
);
786 /* Feed the macro body and its parameters to the scanner
*/
787 /* Before we put a new token list on the input stack
, it is wise to clean off
788 all token lists that have recently been depleted. Then a user macro that ends
789 with a call to itself will not require unbounded stack space.
*/
790 while
((istate
== token_list
) && (iloc == null) && (token_type != v_template)) {
791 /* conserve stack space
*/
794 begin_token_list
(ref_count
, macro
);
795 iname
= warning_index
;
796 iloc
= token_link
(r
);
798 if
(param_ptr
+ n
> max_param_stack
) {
799 max_param_stack
= param_ptr
+ n
;
800 if
(max_param_stack
> param_size
)
801 overflow
("parameter stack size", (unsigned
) param_size
);
803 for
(m
= 0; m
<= n
- 1; m
++)
804 param_stack
[param_ptr
+ m
] = pstack
[m
];
805 param_ptr
= param_ptr
+ n
;
809 /* Report a runaway argument and abort
*/
810 /* If |long_state
=outer_call|
, a runaway argument has already been reported.
*/
811 if
(long_state
== call_cmd
) {
813 print_err
("Paragraph ended before ");
814 sprint_cs
(warning_index
);
815 tprint
(" was complete");
816 help3
("I suspect you've forgotten a `}', causing me to apply this",
817 "control sequence to too much text. How can we recover?",
818 "My plan is to forget the whole thing and hope for the best.");
821 pstack
[n
] = token_link
(temp_token_head
);
822 align_state
= align_state
- unbalance
;
823 for
(m
= 0; m
<= n
; m
++)
824 flush_list
(pstack
[m
]);
827 scanner_status
= save_scanner_status
;
828 warning_index
= save_warning_index
;