Git Product home page Git Product logo

regen's Introduction

Regen

Regen is an intuitive in-code templating engine based on a C#-Python like regen-lang created to replace T4 Templating.
Regen as a template compiler/engine allows to expand in-line templates to be compiled into C# code and inserted into the same source file.
It is mainly used to generate repetitive code - for instance the efficient handling of primitive types without boxing requires a branch for every type that executes the same operation.

Current version: 0.27a-2

Installation

Regen is shipped as a visual studio extension (VSIX) and currently supports vs2017 and vs2019.
Official releases can be downloaded here or in the releases page.

Getting Started

Regen provides a handy Visual Studio plugin which compiles embedded regen-lang templates in your C# source files. For an in-depth language introduction, make sure to read our getting started page!

Contributions

Contributions are welcome, if you would like to help: check out our TODO page.
Thought about a new feature that might come handy? Create an issue about it and get started!

Expectations

  • Any new feature is expected to be fully tested.
  • Any new code is expected to be formatted according to the file it is in or exactly like the neighbor files.

Powered by Regen

These libraries heavily rely on Regen to generate repetitive code:

regen's People

Contributors

nucs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

regen's Issues

Access to array using i variable

It's possible to access and array by index, inside a for each loop?

For example, I'm not able to do that

#if _REGEN
    %codes = ["code1", "code2"]
   
    %foreach codes%
        #(code[i])
    % 
#else
#endif

Of course, in this example I know that I can just use '#1
In the real situation I have more than one array, but I simplify the code for the question

Is that posible?

Not clear how to access nested for loops.

Nested for loops are supported but accessing the tokens is done by using #101 for the first item and #102 for the second etc. I found this by going through the unit tests and experimenting, but it would be nice for it to be in a tutorial.

Implement extension for Rider

The extension itself isn't that complex. It mostly takes care of finding the open file, listening to a hotkey and replacing the content of the file with the result from a simple method call in a #if _REGEN block.

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.