Giter Club home page Giter Club logo

Comments (3)

frederichecht avatar frederichecht commented on June 5, 2024

from freefem-sources.

cdoucet avatar cdoucet commented on June 5, 2024

I think there is a bug in mylex::xxxx::open in src/fflib/lex.cpp.

If FF_INCLUDEPATH is empty (i.e. lex->includedir), then the code tries to open ff (i.e. filename). It is ok.

However, if FF_INCLUDEPATH is not empty, then it tries to prepend ff with each path in FF_INCLUDEPATH without trying to open ff alone. But the error message in case of failure says that opening ff failed while it is actually false (even though it is actually the expected behavior). So, I think I will need to modify the original algorithm.

Furthermore, as I would like to modify the behavior of include directive, I need to know in which order files should be searched for. For example, let say that $FF_ROOT/foo.edp includes bar.edp and that it is run from $SOMEWHERE. What is the order of trials?

  1. $FF_ROOT/bar.edp, then $FF_INCLUDEPATH/bar.edp, then $SOMEWHERE/bar.edp
  2. $FF_INCLUDEPATH/bar.edp, then $FF_ROOT/bar.edp, then $SOMEWHERE/bar.edp
  3. $SOMEWHERE/bar.edp, then $FF_ROOT/bar.edp, then $FF_INCLUDEPATH/bar.edp
  4. $SOMEWHERE/bar.edp, then $FF_INCLUDEPATH/bar.edp, then $FF_ROOT/bar.edp

Something else?

from freefem-sources.

cdoucet avatar cdoucet commented on June 5, 2024

After checking, there is no bug in the code. I make a PR with the following behavior:

  1. the file is searched with no path
  2. then the file is searched with the path to the directory of the file which includes it
  3. then the file is searched with paths contained in includedir (FF_INCLUDEPATH and more)

Therefore, only step 2 is new.

from freefem-sources.

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.