Skip to content
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

Parse nested braces in log #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

temporaer
Copy link
Contributor

The warnings that say that the filename might be wrong after unmatched braces occur multiple times for the same file. This small check prevents them from being logged twice in succession.

@aclements
Copy link
Owner

If there are warnings about unmatched braces, I'd much rather fix the log parsing than paper over the problem. Do you know what's confusing the log parser?

@temporaer
Copy link
Contributor Author

The problem is that braces might be nested. E.g., if the log contained

    {\SplitList {,}}

the parser would consume {\SplitList {,} and then find a stray }.

This happened for SIunitx in my case, not sure whether this also happens to other people. My commit fixes it for braces. The function I added could also be used for other delimiters, but so far I don't have issues with them.

@temporaer temporaer force-pushed the master branch 2 times, most recently from 3a328a4 to da3eead Compare July 20, 2015 14:48
@temporaer temporaer changed the title Omit duplicate log-messages Parse nested braces in log Jul 20, 2015
@aclements
Copy link
Owner

Oh, I see. Yes, this makes sense.

It'd be awesome if you could add a test to the test suite that triggers this problem before your fix and exercises the fix.

text containing parentheses could break file stack.
@aclements
Copy link
Owner

Hi @temporaer. I had commented on what I can only assume were previous versions of these commits, but now my comments are nowhere to be found and at least some of them weren't addressed (for example, I had suggested a simpler way to write nested_parenthesis_end). Did you see these comments? Do you know where they went? Did you reply to them and GitHub ate the replies, too?

@temporaer
Copy link
Contributor Author

hey, no idea where they went. I definitely saw the one you mentione, but instead of simplifying, I added functionality (parsing nested parenthesis of different types) that requires the complexity.

@temporaer
Copy link
Contributor Author

Hi @aclements , your line-by-line comments were lost during my rebasing: https://stackoverflow.com/questions/10248666/how-to-view-line-comments-in-github . Sorry for that, I did not know this would happen. I am pretty certain I addressed all of them before rebasing and cleaning up the PR. Maybe you can find the time to review this again.

@EdSchouten
Copy link

Hi there,

Any chance this can still get merged? We observe the same issue using siunitx. Thanks!

latexrun Outdated
self.__message('warning', None,
"unbalanced `{' in log; file names may be wrong")
self.__pos += epos + 1
Copy link

@EdSchouten EdSchouten Oct 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off by one:

if epos == -1:
    ...
else:
    self.__pos += epos

This currently causes it to skip one beyond the block, causing some warnings about bad blocks later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants