[latex3-commits] [l3svn] r6095 - Simplify getting char with different catcode in xparse
noreply at latex-project.org
noreply at latex-project.org
Fri Sep 25 18:17:31 CEST 2015
Author: bruno
Date: 2015-09-25 18:17:31 +0200 (Fri, 25 Sep 2015)
New Revision: 6095
Modified:
trunk/l3packages/xparse/xparse.dtx
Log:
Simplify getting char with different catcode in xparse
The only goal was to get a character that looks the same as
the end-delimiter of a D-type arg in the terminal but is not
matched by the grabber. Instead of using catcode 11 or 7
depending on the catcode of the delimiter, use catcodes 11
or 12, the latter being much easier to produce.
Modified: trunk/l3packages/xparse/xparse.dtx
===================================================================
--- trunk/l3packages/xparse/xparse.dtx 2015-09-25 16:06:28 UTC (rev 6094)
+++ trunk/l3packages/xparse/xparse.dtx 2015-09-25 16:17:31 UTC (rev 6095)
@@ -1925,24 +1925,20 @@
% with different category codes, but that really should not happen in any
% sensible document-level syntax.)
% \begin{macrocode}
- \group_begin:
- \token_if_eq_catcode:NNTF #1 ^
- {
+ \token_if_eq_catcode:NNTF + #1
+ {
+ \group_begin:
\char_set_lccode:nn { `A } { `#1 }
\tex_lowercase:D
{
\group_end:
\l_@@_fn_tl A
}
- }
- {
- \char_set_lccode:nn { `^ } { `#1 }
- \tex_lowercase:D
- {
- \group_end:
- \l_@@_fn_tl ^
- }
- }
+ }
+ {
+ \exp_after:wN \l_@@_fn_tl
+ \token_to_str:N #1
+ }
}
}
% \end{macrocode}
More information about the latex3-commits
mailing list