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

The second example from libraries.rst crashes Remix IDE #11687

Closed
lie16 opened this issue Jul 24, 2021 · 3 comments
Closed

The second example from libraries.rst crashes Remix IDE #11687

lie16 opened this issue Jul 24, 2021 · 3 comments
Labels

Comments

@lie16
Copy link

lie16 commented Jul 24, 2021

Page

https://docs.soliditylang.org/en/v0.8.6/contracts.html#libraries

Abstract

Remix crashed every time I tried to paste 2nd example, I don't know what's wrong, could someone help me?

Pull request

@chriseth
Copy link
Contributor

The code formatting in the second example of https://docs.soliditylang.org/en/v0.8.6/contracts.html#libraries is weird. My guess is that type is considered a keyword and thus type(uint) does not parse properly. This could also be the reason for the crash in remix. Would be happy for someone to investigate further.

@cameel
Copy link
Member

cameel commented Jul 26, 2021

The code formatting in the second example of https://docs.soliditylang.org/en/v0.8.6/contracts.html#libraries is weird. My guess is that type is considered a keyword and thus type(uint) does not parse properly.

No, it's actually the || operator. Lexer used for highlighting in docs appears to be buggy and has trouble parsing things like &&, ||, ? :, 1e18 or even pragma solidity >x.y.z; (>= is fine). And it's not just this single example. There are actually tons of warnings about code snippets when I build the docs locally but these warnings do not show up in CI because we're using very old Sphinx/Pygments there. I actually have a PR that updates these packages and fixes the warnings (mostly by slightly changing examples or just using :force:): #11662. I think we'll have to fix the lexer ourselves eventually though.

This could also be the reason for the crash in remix.

I just tried it and it does not crash for me. And solc compiles it just fine too. How can I reproduce the crash?

BTW, @lie16 what kind of crash is this? Is there an error message or something?

@cameel cameel changed the title Contract - Libraries -2nd example The second example from libraries.rst crashes Remix IDE Jul 26, 2021
@lie16
Copy link
Author

lie16 commented Jul 27, 2021

This is what happen when I post this problem:

  1. When I try it remix become unresponsive and I had to reopen new remix tab.
  2. When I reopen the file in the new tab, the source code just gone.

Today I try it again it work fine, maybe the crash was related to the solidity file(unfinished code & not compilable) that I already delete yesterday.
Sorry for the trouble.

@lie16 lie16 closed this as completed Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants