meta_expression 0.2.1 copy "meta_expression: ^0.2.1" to clipboard
meta_expression: ^0.2.1 copied to clipboard

A meta-expression is one of a kind of (code generator-based) macros.

0.2.1 #

  • The constant values of non-patched nodes (not modified by macros) are now computed and converted into the node values into an intermediate AST and, accordingly, are available for analysis in the the macros implementation functions. This feature is not yet fully implemented.

0.2.0 #

  • All code has been rewritten to use text patches instead of replacing AST nodes. This modification (improvement) allows to modify the source code more accurately, changing only the code that is subject to transformation. Also, due to the fact that the AST does not change, it became possible to use transformers with other software. Also, this improvement will allow using transformers to generate augmented libraries.
  • Added initial support for build_runner. Libraries can now be built by dart run build_runner build. But without support for augmentation in the language, it is not very convenient, because all code is generated in a separate library.
  • Removed support of statements.
  • Added expression optimization feature. For certain expressions, there is the possibility of transformation into a statement. It depends on the location of the expression (its role) and the possibility of safe modification (optimization).
  • Added expression isolator. The purpose of an isolator is to group expressions, enclosing them in parentheses if necessary. Not all cases of the need for grouping have yet been taken into account, so isolator may either not group where required or group where it is not necessary.
  • Added support for simple AST. At the initial stage. The nodes are lightweight, not resolved, only parsred. They are not resolved because they are converted mostly from data generated by macros (from new source code). Not all node types are converted. Only expressions (at the moment only a part of them).

0.1.3 #

  • In order to determine whether meta-expressions are used in a library, analysis of the entire tree of nodes in the library is required. To reduce the load on library builders, a simple ability to indicate that meta-expressions are used in the library has been added. To do this, required to add the @pragma('meta_expression:used') annotation to the library directive.
  • The tool/build_meta_expressions.dart generation script has been modified to use @pragma('meta_expression:used') annotations.

0.1.2 #

  • The tool/build_meta_expressions.dart generation script has been modified. Now it will transform all found files from _name.$.dart to name.dart. This script demonstrates how the file transformation process can be implemented.

0.1.1 #

  • Fixed bugs

0.1.0 #

  • Initial release
3
likes
70
pub points
0%
popularity

Publisher

unverified uploader

A meta-expression is one of a kind of (code generator-based) macros.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

_fe_analyzer_shared, analyzer, build, dart_style, logging, meta_expression_annotation, path, source_gen, source_helper, source_span, tuple

More

Packages that depend on meta_expression