-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing escaped string chars #1
Comments
Did you change the naming conventions? There is already |
@phst: Oops, including |
We still are not really clear on what to do about 'strings', are we :-) |
Maybe we should just define |
git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@2232 de43f980-851b-0410-b2f7-c40aca1f87e0
Here, I can't find a real use case, but this ought to arise some day: \dim_set:Nn \l_foo_dim { \token_if_dim_register:NTF #1 { #1 } { 0pt } } and someone might (for some reason hidden in some deeply nested code) give #1=\par. Far fetched, but better safe than sorry. git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@2929 de43f980-851b-0410-b2f7-c40aca1f87e0
The idea is similar to list comprehension in other languages: \seq_set_filter:NNn \l_A_seq \l_B_seq { \int_compare_p:n { #1 > 0 } } copies in \l_A_seq all positive items of \l_B_seq. Similarly, \seq_set_map:NNn \l_A_seq \l_B_seq { \int_eval:n { #1 * #1 } } stores in \l_A_seq the sequence of squares of items in \l_B_seq. git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3085 de43f980-851b-0410-b2f7-c40aca1f87e0
First argument: the file name. Second argument: inline function receiving the line as #1. git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3160 de43f980-851b-0410-b2f7-c40aca1f87e0
I was using \dim_strip_pt:n { #1 pt } for all registers "#1". This of course will fail for large integers. The correct way is to apply "\the", then grab everything until the first "pt". Incidentally, this won't fail with a toks register if it contains something sensible, but it will fail when \count, \dimen, etc are used with an explicit number. git-svn-id: svn+ssh://comedy.dante.de/serv/latex-project/svn/experimental/trunk@3784 de43f980-851b-0410-b2f7-c40aca1f87e0
we want #1 to be executed at the literal very end this might need some more analysis, but this is okay for now (I'm still undecided whether these mapping functions should be made expandable. Is there a speed tradeoff?) git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2187 de43f980-851b-0410-b2f7-c40aca1f87e0
\tl_put_right, etc., all give "#1 not defined" errors so you don't need to use \_tl_if_exist:N for them git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2222 de43f980-851b-0410-b2f7-c40aca1f87e0
git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2232 de43f980-851b-0410-b2f7-c40aca1f87e0
git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2740 de43f980-851b-0410-b2f7-c40aca1f87e0
Here, I can't find a real use case, but this ought to arise some day: \dim_set:Nn \l_foo_dim { \token_if_dim_register:NTF #1 { #1 } { 0pt } } and someone might (for some reason hidden in some deeply nested code) give #1=\par. Far fetched, but better safe than sorry. git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@2929 de43f980-851b-0410-b2f7-c40aca1f87e0
The idea is similar to list comprehension in other languages: \seq_set_filter:NNn \l_A_seq \l_B_seq { \int_compare_p:n { #1 > 0 } } copies in \l_A_seq all positive items of \l_B_seq. Similarly, \seq_set_map:NNn \l_A_seq \l_B_seq { \int_eval:n { #1 * #1 } } stores in \l_A_seq the sequence of squares of items in \l_B_seq. git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3085 de43f980-851b-0410-b2f7-c40aca1f87e0
First argument: the file name. Second argument: inline function receiving the line as #1. git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3160 de43f980-851b-0410-b2f7-c40aca1f87e0
Now \msg_new:nnnn follows the suit of \cs_new:Npn #1 -> \chk_if_free_cs:N #1 \cs_gset:Npn #1 git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3368 de43f980-851b-0410-b2f7-c40aca1f87e0
At first I was unsure whether #1 = intexpr, #2 = real was a good enough syntax, but I think I'm happy with it. git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3690 de43f980-851b-0410-b2f7-c40aca1f87e0
I was using \dim_strip_pt:n { #1 pt } for all registers "#1". This of course will fail for large integers. The correct way is to apply "\the", then grab everything until the first "pt". Incidentally, this won't fail with a toks register if it contains something sensible, but it will fail when \count, \dimen, etc are used with an explicit number. git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@3784 de43f980-851b-0410-b2f7-c40aca1f87e0
This will be needed for frames, but seems general enough that it should be somewhere else. At some stage, a kern interface all seems to be required, perhaps simply \cs_new_protected:Npn \kern:n #1 { \tex_kern:D \__dim_eval:w #1 \dim_eval_end: } which migh tgo along with rules and leaders somewhere. git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4032 de43f980-851b-0410-b2f7-c40aca1f87e0
This alignment type inserts the filling between the sign and the main part of the number. It can be useful when writing a message with a table of numbers. \cs_new:Npn \my_do:n #1 { | \int_format:nn {#1} { 0 = + 5 } | \\ } \msg_new:nnn { my } { do } { \clist_map_function:nN {#1} \my_do:n } \msg_warning:nnn { my } { do } { 1 , 123 , -3263 } git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@4122 de43f980-851b-0410-b2f7-c40aca1f87e0
With variants \tl_map_function_unbraced:NN and \tl_map_function_unbraced:cN. Also implement \tl_map_function_unbraced:Nn. These are basically the same as the \tl_map_function:Nn family, but without latex3#1 receiving latex3#2 braced. Careful use of this macro allows for cleanly mapping multi-argument functions. TODO: The docs here are sucky, but I wrote this months ago and haven't been LaTeXing enough to feel out better wording that isn't incorrect. This is a useful macro, even if a bit awkward & subtle to describe.
Previously, we produced \exp_not:N \token for an expandable \token, which meant that o-expanding that would give a version of \token temporarily set to \relax. Thus, \exp_after:wN \if_meaning:w #1 would not match as expected. Now we do \__kernel_exp_not:w \exp_after:wN { \exp_not:N #1 } to avoid that issue yet still deal with the possibility of outer macros.
At some point in the code the active character is taken as an argument after being turned into a string, but a string space is simply skipped when seeking macro arguments. Now fixed by a trailing brace group that gives an empty argument, and a trailing space that replaces the argument in a followup \int_value:w `#1 ~ construction.
I think perhaps we should have a short list of constant escape characters such as LaTeX2e's
\@backslashchar
. E.g.,and so on. (I think ‘str’ is clearer than ‘char’ here but I could be wrong.)
(Issue by Will, written while logged into the wrong account.)
The text was updated successfully, but these errors were encountered: