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

Small bugfixes #52

Conversation

felixauringer
Copy link

We wrote two bugfixes so that the prototype works for our project. We know that our solutions are hacky but we haven't had time to come up with a better solution yet.

  • In order to ignore invalid intervals (I described the problem here) and prevent index out of bound exceptions, we only fill the source map until its end.
  • Because the root node's parent is nil, the message enclosingRule does not work: Undefined Object does not understand ruleName. We added a nil check to prevent this error from happening.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 85.178% when pulling 8afcaeb on felixauringer:bugfix/interval-and-root-node into 9b85725 on hpi-swa:master.

@codeZeilen
Copy link
Member

I will happily merge these as soon as we have the general approach ready! :)

@felixauringer
Copy link
Author

I will happily merge these as soon as we have the general approach ready! :)

I think clamping the interval won't be needed anymore because it is just a workaround for interval values that are not expected. And the handling of the root case with its nil-check isn't SWT-compliant yet ;)

@codeZeilen
Copy link
Member

hm... true re the clamping.

There is actually a method to cover the logic of the nil-check. I think it is called #isParentNode or something like that.

@felixauringer
Copy link
Author

There is actually a method to cover the logic of the nil-check. I think it is called #isParentNode or something like that.

I used #isRootNode, that looks much cleaner.

I think clamping the interval won't be needed anymore because it is just a workaround for interval values that are not expected. And the handling of the root case with its nil-check isn't SWT-compliant yet ;)

Because there are still nodes with an interval outside of the source map's size, the logic is still needed. You actually implemented the same logic in the method OhmSourceMapping>>defaultExpression:.

We think that this could be merged. What do you think?

@felixauringer
Copy link
Author

I'll close this and delete my branch as the interval clamping isn't sufficient and the handling of the root node in enclosingRule is on your whitespace-handling-branch

@felixauringer felixauringer deleted the bugfix/interval-and-root-node branch July 31, 2020 15:32
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