Comments (2)
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.
Fixed now, since my fork has been merged in.
from fson.
Related Issues (20)
- Unit tests (too long double precision values are not parsed correctly) HOT 1
- callback example. HOT 3
- json-fortran : An updated JSON API HOT 1
- Parse string with escaped character HOT 2
- Exponential format numbers with integer mantissa and negative exponent HOT 1
- create a json object HOT 4
- please add some documentation for installation HOT 1
- string array ? HOT 4
- JSON array with no label HOT 1
- LICENCE HOT 3
- ERROR: Unexpected character while parsing value. 'E' ASCII= 69 HOT 2
- Licensing Issues HOT 1
- Infinite loop in parse_integer HOT 2
- Invalid json strings are parsed successfully
- Providing a CMake build HOT 2
- Read polygon geojson HOT 9
- Implement support for external Zofu HOT 3
- CMake build fails to link to libzofu on macOS, meson build works fine HOT 4
- Build error on 10.7 with Apple Clang: error: invalid instruction mnemonic 'cvttss2sil'
- Runtime error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fson.