Skip to content

v0.4.0

Compare
Choose a tag to compare
@github-actions github-actions released this 04 May 18:14
· 19 commits to master since this release

Struct As Array Element is Supported!

Now you can embed a struct into a array, like this:

struct TestStructArrayElement {
  int32 a[2];
}

struct TestStructArray {
  TestStructArrayElement<10> a;
  TestStructArrayElement<10> b [order = "big"];
}

Huge Refactor of Generator!

Use text/template as template engine for easier support of new target language.

Refactor lots of definition for a clearer structure.

-minimal & -single generate option are separated from target now, with more generate option added!

Options

  • -t <target>: Target language
  • -o <output>: Output Path
  • -inner: Generate Inner Class (Nested Struct)
  • -single: Generate Single File (Combine all definitions into one file, instead of one generated file per source file)
  • -minimal: Generate Minimal Code (Usually without default getter/setter methods)
  • -decnum: Force Generate Decimal Format for Constant Value (Translate 0xFF to 255, 0b1111 to 15, etc.)
  • -signext: Sign Extension Method used for Integer Field (Options: shift, arith)

Syntax Changes

Method name is no more allowed to be duplicate with another method or field in same struct.

Method name sytle camelCase is not recommended any more. Use snake_case instead.

Changelog

  • 43155e9 Refactor code generator. Update README & examples
  • 2f91179 Fix c_single generator standard name
  • be2adcf Fix python enum initial value