GithubHelp home page GithubHelp logo

token logic error? about f90nml HOT 8 CLOSED

marshallward avatar marshallward commented on July 18, 2024
token logic error?

from f90nml.

Comments (8)

marshallward avatar marshallward commented on July 18, 2024

Sure, that looks like a bug, I will try to look into it. Thanks for the report.

Things are quite busy for me workwise at the moment, and then I go on one-month leave, so it could potentially take quite a long time. In the meantime, you could try putting string delimiters around it ('%'), which seems to work for me.

from f90nml.

greyltc avatar greyltc commented on July 18, 2024

Thanks for the quick response.
Yep, that's exactly what I'm doing for now.
I'm just a bit worried about other token combos biting me later!

from f90nml.

marshallward avatar marshallward commented on July 18, 2024

Following up on here.. (mostly for myself)

Problem appears to be L357 of parse_variable. We rely on the appearance of those tokens (%, (, =) to identify the end of the current variable and the beginning of the next variable. (This is primarily for when multiple variables, including vectors, are on a single line.)

This may be failing because it sees the % and thinks that it's finished, and then sets the value of units to None.

This will probably be a bit harder to fix. For example, this namelist:

&nml x=y%z=c /

could have two interpretations:

&nml
    x = 'y%'
    z = 'c'
/

&nml
    x = 
    y%z = 'c'
/

But there might be a way out of this particular situation. Your example only has one interpretation, since % would need a variable name to be interpreted as a derived type dereference.

from f90nml.

marshallward avatar marshallward commented on July 18, 2024

Actually I could be wrong about that example... spaces may be able to resolve the case that I mentioned, I'd need to check it out.

from f90nml.

marshallward avatar marshallward commented on July 18, 2024

Sorry for the long delay.

I've testd this case in gfortran and Intel fortran, and the results are similar to #43 in that gfortran rejects the namelist, and Intel fortran parses it differently (specifically it sets units to an empty string).

Given that these non-delimited tokens don't appear to produce the strings that you need, I'm probably not likely to support these.

From what you mentioned in #43, it may be that SDDS is producing very old namelist files that don't produce meaningful output on any actively maintained compiler, so I'm inclined to close these issues as not relevant. It might be more constructive to lean on SDDS to produce syntatically correct namelists rather than supporting incorrect namelists.

I could possibly support this case with a control flag or something that relaxes the parsing rules, but these are very hard edge cases to support, and I don't think I would be able to prioritise them.

from f90nml.

marshallward avatar marshallward commented on July 18, 2024

I'm going to close this ticket, due to the lack of support for these values in gfortran and Intel fortran, the only compilers available to me. If you can find a compiler which supports these values, or just feel like this is an urgent and unsolvable problem for you, then feel free to re-open this and we can talk about a plan. But I probably won't personally be able to devote much time to this one, sorry.

from f90nml.

marshallward avatar marshallward commented on July 18, 2024

Reopening, but explicitly noting this is an SDDS issue.

from f90nml.

marshallward avatar marshallward commented on July 18, 2024

As in #43 this is probably too big a challenge to implement unless its strongly driven by user feedback, so will close for now. Please re-open in the future if necessary.

from f90nml.

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.