GithubHelp home page GithubHelp logo

cpp-ripper's People

Watchers

 avatar

cpp-ripper's Issues

Unable to parse scientific notation (exponent)

What steps will reproduce the problem?
1. Parse something like "double a = 6.267e-002;"

What is the expected output? What do you see instead?

parsing exception occured while parsing 'literal' expected
'skip(ident_next_char^)'  at line number 9, and character number 18
 {6.26737614678093e-002, -6.21825704935264e-001, 4.38399455776503e-001 },

(error points at the "e" in the first floating point number above)



What version of the product are you using? On what operating system?

revision 5

Original issue reported on code.google.com by [email protected] on 17 Nov 2009 at 6:14

Error parsing enum containing hexadecimal initalizer for an enumeration constant

What steps will reproduce the problem?
1. try to parse attached file.

What is the expected output? What do you see instead?
You can see an exception:

parsing exception occured while parsing 'literal' expected 
'skip(ident_next_char^)'  at 
line number 0, and character number 13
enum a{ B = 0x1} C
             ^

What version of the product are you using? On what operating system?
sept-9-2009-source

Rootcause:
What is happening is, that the 0x1 hexadecimal value is parsed as an 
octal_literal("0") and not as a hex_literal("0x1"). The cause is, that in the 
place of unsigned_literal, the octal_literal is checked first, and that breaks 
the compiler paradigm of searching the longest possible token string.

Proposed fix:
the simplest way to fix this issue is to re-arrange the parsing order from:

            unsigned_literal
                = decimal_literal
                | octal_literal
                | hex_literal;

to:

            unsigned_literal
                = decimal_literal
                | hex_literal
                | octal_literal;

this way the hex literal(which is always longer because of "0x" factor) will be 
parsed before octal. 

Original issue reported on code.google.com by [email protected] on 15 Oct 2013 at 3:02

Attachments:

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.