macro_processor 0.0.12 copy "macro_processor: ^0.0.12" to clipboard
macro_processor: ^0.0.12 copied to clipboard

outdatedDart 1 only

Lightweight macro processor with syntax similar to C language.

macro_rocessor #

Lightweight macro processor with syntax similar to C language.

Version: 0.0.12

Initial release. Use at your own risk!

import "package:macro_processor/macro_processor.dart";

void main() {
  var processor = new MacroProcessor();
  var environment = {};
  environment["OS"] = "linux";
  var blocks = processor.process(text, environment);
  var result = blocks.map((e) => e.text).join();
  print(result);
  ;
}

String text = '''
#define _SIZE_OF_POINTER_ 64

#define _64BIT_ 0x1p7 / (012 / 0x5)
#define _NOT_32BIT_ _64BIT_

#if _SIZE_OF_POINTER_ == _NOT_32BIT_
#error
#endif


#define _HELLO_ _HI_
#define _HI_ Hello
#if OS == windows
_HELLO_ OS
#elif OS == linux
_HELLO_ OS
Bye windows!
#else
_HELLO_ OS
#endif
#define E YEE!
1E2 E
#define _MIN_VERSION_ 100
#define _VERSION_ 180
#if _VERSION_ < _MIN_VERSION_
#error Wrong version 
#endif
Our version: _VERSION_''';

0
likes
20
pub points
1%
popularity

Publisher

unverified uploader

Lightweight macro processor with syntax similar to C language.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

parser_error, text

More

Packages that depend on macro_processor