Giter Club home page Giter Club logo

Comments (2)

apthorpe avatar apthorpe commented on September 1, 2024

The root cause for this problem is the lack of sign character [+-] handling in parse_integer() on line 412 of fson.f95. The fix is a bit involved but it's pretty straightforward.

The logic is as follows: Sign characters are optional; the default sign is positive. Sign characters cannot follow any other character (i.e. a sign character must be first character if one appears). Only one sign character is allowed.

I created three variables, two logical (found_sign, and found_digit), and one integer (isign); default values are .false., .false., and 1 respectively. found_digit is set to .true. at line 429 (inside the digit detection case).

Two new cases are added to the select block. If "+" is found and both .found_digit. and .found_sign. are .false., .found_sign. is set to .true. otherwise an error results and the code halts (either multiple signs have been found or a sign character was found after a digit.

Handling "-" is identical to the above except isign is set to -1 if there's no error. If the code makes it out of the parse loop alive (down to line 449), if integral > 0 and isign < 1, then integral is set to -integral.

Additionally, count() is an intrinsic function in F9x so I recommend changing the name of the 'count' variable to something like 'icount' to avoid confusion.

Per my previous issue, I've already coded a fix for this and will upload it as soon as I sort out git.

There are other issues regarding the value of the parsed real numbers that I've discovered since this fix, but I'll document them once I understand them better. One thing at a time...

from fson.

acroucher avatar acroucher commented on September 1, 2024

Fixed now, since my fork has been merged in.

from fson.

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.