preprocessor 0.1.0 copy "preprocessor: ^0.1.0" to clipboard
preprocessor: ^0.1.0 copied to clipboard

outdatedDart 1 only

Preprocessor

The preprocessor parse the source code and uses comments to build different versions of the same code.

Directives #

if [elseif ]* [ else] endif #

/*#if DEV*/
the DEV code
/*#else*/
the PROD code
/*#/if*/

/*#if test1*/
when test1 is true
/*#elseif test2*/
when test2 is true
/*#/if*/

if ! #

/*#if ! DEV*/
the PROD code
/*#else*/
the DEV code
/*#/if*/

ifdef, ifndef #

/*#ifdef var1*/
if var1 is defined
/*#/if*/

/*#ifndef var2*/
if var2 is not defined
/*#/if*/

value #

/*#ifdef blog.title*/
The title blog: /*#val blog.title*/
/*#/if*/

API #

Preprocessor p = new Preprocessor('js');
p.process({ 'DEV': true },"test(/*#val value*/0);")
  .then((String result){
  	print result;
  });
0
likes
0
points
3
downloads

Publisher

unverified uploader

Weekly Downloads

Preprocessor

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

mutable_string, unittest

More

Packages that depend on preprocessor