-
Notifications
You must be signed in to change notification settings - Fork 108
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
Towards functioning expl3 #1188
Conversation
define CharDef->equals; fix \unless support pdf version & \pdfstrcmp respect \endlinechar in Mouth more careful token comparisions for space, \relax, etc especially in <one optional space> after reading numbers \edef and friends read the body *while* expanding LaTeX \@onefilewithoptions This allows texlive 2016's l3kernel to be read; (there are still issues with 2019). Test cases still need to be added.
…add minor revision for pdf proc
In need of further work:
|
&& Equals($$self{getter}, $$other{getter}) | ||
## && Equals($$self{beforeDigest}, $$other{beforeDigest}) | ||
## && Equals($$self{afterDigest}, $$other{afterDigest}) | ||
; } | ||
#=============================================================================== | ||
1; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we checkout this back to master (pre my pointless commit); it's a no-op.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused by the phrasing "Check it out back to master". Do you mean remove the code block entirely, or do you mean "it's in master, let's rebase"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must meant like git checkout ...\Register
: ie, no change to the file at all, since the only changes have no effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I've removed the changes. Sadly "reverting" to the previous Register isn't simple this many commits later, I just papered over with a new commit.
sub neutralizeTokens { | ||
my ($self, @tokens) = @_; | ||
my @result = (); | ||
foreach my $token (@tokens) { | ||
if ($$token[1] == CC_PARAM) { # Inline ->getCatcode! | ||
push(@result, $token); } | ||
elsif (defined(my $defn = LaTeXML::Core::State::lookupDefinition($STATE, $token))) { | ||
elsif (!defined(my $meaning = LaTeXML::Core::State::lookupMeaning($STATE, $token)) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't both meaning & defintion redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I intended to add here, was also neutralizing undefined command sequences, which is what a negative lookupMeaning
achieves.
If your point is that every time lookupDefinition
is true, then lookupMeaning
is also true, that may be.
The question is, are there cases where lookupMeaning
is true, but lookupDefinition
is false, where we do not want to add a \noexpand
. An example of that is e.g. any T_LETTER
token, and a variety of others. I think adding a \noexpand
before those is simply a no-op, so it may be a "distinction without a difference"... Unsure what is cleanest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we could get away with adding a \noexpand
unconditionally, before every element of the input @tokens
, that would certainly feel most elegant to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh; missed the "!".
Probably all looks good, other than the debugging turds that I left in --- is that worth removing? |
We can squash, certainly. Would you like to leave comments on the bits that need removing? |
Incidentally, with regard to XUntil, I may have finally come around to your POV: that it is legitimate to leave it as is, and require that if you use it, you should probably \let the delimiting token to \relax or something. As it stands, you'll get an error message (right?) which should be relatively decipherable. |
As to XUntil: yes to your question, the last token will shoot an error if it's expanded without being defined. And if you let it to relax, or some such, XUntil will succeed properly. |
Mostly I was thinking of removing the commented out debugging code (eg. prints or otherwise dead code) |
There is still the issue with |
I've removed the debug comments, thanks for mentioning. |
Oh, you mean backing off the extra args to readXToken in |
Indeed - I am trying that change now, but I have a subtle failure in the siunitx tests, need a few more mins... |
take your time; I gotta run errands :> |
…elaxed when undefined
Alright, feeling very good about the refactor of No issues with alignment are visible from the tests - the once encountered with siunits in tables were related to DeclaredUnits not being defined -- let-ing them to relax when needed allowed for smooth passing of the tests. I experimented a little with literal strings and discovered siunitx isn't actually loading some of its dependencies (amsmath and array) so I threw those in for good measure. All good on my end! |
@@ -430,9 +430,14 @@ my @rmletters = ('i', 'v', 'x', 'l', 'c', 'd', 'm'); # [CONSTANT] | |||
|
|||
sub roman_aux { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side comment, the roman
functions really feel like Util
-level pieces of code, rather than Package.pm
bits.
@@ -148,7 +148,7 @@ DefParameterType('GeneralText', sub { | |||
my ($gullet) = @_; | |||
my $open = $gullet->readXToken; | |||
if ($open->equals(T_BEGIN)) { | |||
return $gullet->readBalanced; } | |||
return scalar($gullet->readBalanced); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit stumped at this line. Returning the number of tokens instead of the tokens themselves? From within a parameter type ?!?!? Is this some sort of intermediate code that slipped by or am I missing something extremely obvious?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good news is that all tests pass with the scalar removed. I'm tempted to just push in the change since it looks so horrendous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
my $token = $gullet->readXToken(0); | ||
my @tokens = (); | ||
if ($token->getCatcode == CC_BEGIN) { | ||
return scalar($gullet->readBalanced(1)); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same scalar here...
@@ -473,7 +482,7 @@ sub readArg { | |||
if (!defined $token) { | |||
return; } | |||
elsif ($$token[1] == CC_BEGIN) { # Inline ->getCatcode! | |||
return $self->readBalanced; } | |||
return scalar($self->readBalanced); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And another scalar. Maybe I should wait until I hear a reply, but I just have the strong urge of removing all of these guys.
Please ignore all But of course when you apply the scalar on the function call that ends with |
TeeHee! I knew it'd hit you shortly :> |
Combines #1182 and Bruce's
expl3
branch with additional fixes from my debugging.