Giter Site home page Giter Site logo

Comments (8)

7sharp9 avatar 7sharp9 commented on June 16, 2024

This could be a general property that could be added to all plugins or specific to the lens plugin, all plugins currently take a namespace property in the myriad.toml file. I forget what happens if thats empty...

from myriad.

7sharp9 avatar 7sharp9 commented on June 16, 2024

Ah, lens plugin gets a namespace named UnknownNamespace is its empty

from myriad.

7sharp9 avatar 7sharp9 commented on June 16, 2024

Same with the fields and DU's plugin, there could be a hierarchy, namespace, module, if both of those are empty then the generation occurs in the root, which might potentially mean an invalid ast. I think namespace, module, then root would work as a rule though, its up to the plugin authors to enforce any rules currently as nothing is set or used in myriad.core etc.

from myriad.

7sharp9 avatar 7sharp9 commented on June 16, 2024

I found an issue with generating with a module rather than a namespace.

Modules can be either top-level or nested, top-level modules cannot have comments above them and are defined with no = on the definition. Nested modules are defined by using an = after the module definition. Each plugin is independent and knows nothing about any previous plugins so it's not possible to know whether one plugin is defined at the top level and others are nested so this becomes a bit messy. Unless you generate plugins self-contained with their own namespace so the namespace requirement is by design, I rediscovered this on trying to implement modules rather than namespace generation.

from myriad.

cmeeren avatar cmeeren commented on June 16, 2024

Plugins could allow you to specify the exact string that appears there: "module Foo.Bar", "namespace Baz", etc. Facil does that.

from myriad.

7sharp9 avatar 7sharp9 commented on June 16, 2024

The ast has two constructs one for top-level modules, which is one per file, and another for nested modules, which are any subsequent ones. there are also anonymous modules for script files, I'm still hacking away but it doesn't look like I'm getting anywhere.

from myriad.

7sharp9 avatar 7sharp9 commented on June 16, 2024

Only top-level modules can have a path like module xxx.yyy, nested ones are only allowed to be a simple path like module xxx =

from myriad.

7sharp9 avatar 7sharp9 commented on June 16, 2024

Inline is probably different but there are issues with getting the indentation correctly aligned etc and knowing if you are inside a type or module or namespace already, complexity there.

from myriad.

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.