Code Monkey home page Code Monkey logo

purescript-ccap-codegen's People

Contributors

absnook avatar aij avatar charlesfrayne1 avatar cwinebr avatar cwinebrinner avatar damullet avatar dstevenson1 avatar henryxparker avatar jason94 avatar jazzxhands avatar jhilyar avatar jtaylorx2 avatar melgar avatar mobri888 avatar pbrant avatar ptwales avatar rpolley avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

purescript-ccap-codegen's Issues

Can't import from sibling modules

Currently there is no clean way for a template to import types from another template that isn't a child

proj/
├── mod1
│   └── Foo.tmpl
└── mod2
    └── Bar.tmpl

Bar.tmpl should be able to reference types from Foo.tmpl with import mod1.Foo. However,

codegen -m scala -o output proj/mod1/Foo.tmpl proj/mod2/Bar.tmpl

would fail with mod1.Foo not found since there is no mod1 folder in mod2 which is where codegen would look. We could resolve this two ways. One would be to compile Bar.tmpl separately from Foo.tmpl and include the mod1 folder.

codegen -m scala -o output -I proj/mod1 proj/mod2/Bar.tmpl

But that would only work if Bar.tmpl had import Foo not import mod1.Foo. And that what would we do if mod2.Foo existed?

The best solution is also a silly one:

codegen -m scala -o output -I proj/ proj/mod1/Foo.tmpl proj/mod2/Bar.tmpl

Including the source files which we are compiling as though they were external sources is silly. We should just have a flag to say "compile all templates in this folder and include them all in each others scope."

replace output annotations with the old prefix arguments

  • Remove the purs: and scala: annotations.
  • Bring back the prefix arguments as a single -p,--prefix flag.
  • Determine output path as prefix.folders.filename
    • What folders will be the path to the folder from some arbitrary root folder.
      • This might depend on being able to compile all templates in a folder as the root folder.
      • Different language implementations may modify the folders accordingly
        • scala lower cases the folders names.
        • purescript capitalizes the folder names.

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.