Coder Social home page Coder Social logo

Cannot parse weird tupple index about gccrs HOT 3 CLOSED

P-E-P avatar P-E-P commented on August 20, 2024
Cannot parse weird tupple index

from gccrs.

Comments (3)

nirmal-j-patel avatar nirmal-j-patel commented on August 20, 2024

It appears that this happens because the parser consider 0.0 as floating point number rather than two index operators. Do we need to parse indices differently (by disabling float checking, disallowing index beginning with 0, etc.)?
https://doc.rust-lang.org/reference/tokens.html#tuple-index

from gccrs.

P-E-P avatar P-E-P commented on August 20, 2024

It appears that this happens because the parser consider 0.0 as floating point number rather than two index operators. Do we need to parse indices differently (by disabling float checking, disallowing index beginning with 0, etc.)? https://doc.rust-lang.org/reference/tokens.html#tuple-index

We should look if #2694 fixes the issue then

from gccrs.

P-E-P avatar P-E-P commented on August 20, 2024

#2694 Indeed fixes a part of this code, here is the updated error message (afbd2a4):

./test.rs:5:22: error: expecting ‘;’ but ‘integer literal’ found
    5 |     let _ = tuple.0. 0;
      |                      ^
./test.rs:5:5: error: failed to parse statement or expression in block expression
    5 |     let _ = tuple.0. 0;
      |     ^~~
./test.rs:5:22: error: unrecognised token ‘integer literal’ for start of item
    5 |     let _ = tuple.0. 0;

from gccrs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.